I have written the following small antlr grammar, to unserialize an AST from the output generated by the toStringTree() method. I'm sending it to the list, since I think it would be useful for many antlr users.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
SymTabLoader.g
Description: Binary data
parser grammar SymTabLoader;
/* Unserializes an AST serialized with toStringTree - uses the input
lexer symbols used to create the
ast initially. Note: EVEN abstract tokens need to have a lexical
representation for this to work.*/
options {
tokenVocab = InputSyntax;
output = AST;
}
program : module ;
module : '(' firstSymb subTree* ')' -> ^(firstSymb subTree*) ;
firstSymb :
~( '(' | ')' )
;
subTree : firstSymb
| module
;
---------------------------------
How many National Democrats does it take to change a light bulb?
108: 8 who smashes the rest of the light bulbs, and 100 to blame a
zionist world conspiracy for the darkness
--------------------------
Tommy Nordgren
[email protected]
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
