Thank you for all the help, I got it parsing the way I want (I attached the grammar file for anyone interested). Now I am wondering what the best method is to walk the AST tree. In a groovy script, I used their visitor pattern (SourceCodeTraversal in combination with their VisitorAdapter class) to extract the information I wanted.
Basically for this, I want the values of the tags: PageMetaData: name: This is a test name categories: category1, category2, category3 notes: These are notes that the newlines are important, but not the leading whitespace So I would like the name,"This is a test name", categories in a way I can parse them into java enum constants added to a java-collection, etc. Is building a visitor a good way to go for this, or perhaps using code blocks in the parser to capture the text I want, or what other suggestions might you have on a recommended approach to interact with the parsed code or AST? Thanks again.
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
PageMetaData.g
Description: Binary data
-- 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.
