[antlr-interest] help required: accessing intermediary output ASTs in tree parser
Si Fraser
mail at sifraser.com
Fri Jan 30 15:23:53 PST 2004
I think I'm probably missing somthing obvious here, but please somebody
point it out to me -- I'm getting incredibly frustrated! Consider the
following tree parser:
start! : #(spec:SPECIFICATION (section|paragraph)+)
{ // How do I refer to the children of SPECIFICATION
// that have been modified by the following rules?
// If I use spec.getFirstChild() I get first child
// of original parse tree, and not the transformed
// tree that has been created by the section/
// paragraph rules
// If I do (s:section|p:paragraph)+ then I only get
// the reference to the last section/paragraph
// created.
// I'm assuming that there must be some way to refer
// to the indiviual section/paragraphs matched and
// their associated trees. Having searched the docs.
// etc. I can't it! Can anyone help me??
}
section! : #(NAMED_SECTION NAME LEFTSQ FORMALS RIGHTSQ (paragraph)+)
{ // Manual tree creation
}
paragraph! : #(GEN_SCH_PARA NAME schema_text END)
{ // Manual tree creation
}
etc....
Any help would be greatly appreciated. Please let me know if I need to
clarify what I'm asking (it's quite hard to express exactly what I want).
Cheers,
Si
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.566 / Virus Database: 357 - Release Date: 22/01/2004
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list