[antlr-interest] Tree walking Q
Gerald B. Rosenberg
gbr at newtechlaw.com
Sat Jun 4 18:19:29 PDT 2005
At 04:06 PM 6/4/2005, Terence Parr wrote:
>On Jun 4, 2005, at 3:37 PM, Gerald B. Rosenberg wrote:
>
>>Is there a default rule identifier? Or, is there another mechanism
>>to enable the tree-parser to simply walk past those tokens not
>>otherwise identified to the parser?
>
>Hi. In the lexer, we such a filtering mechanism, but there isn't
>such a beast for tree parsing unless than the brute force "find this
>subtree" kind of thing.
Looks like that is where I am headed.
>I suggest you look at JBurg, which is technically used for generating
>machine instructions but it does a great job of finding subtrees in a
>large tree. You can even assign costs to each subtree match and it
>will find the best match. Now that I say it, it is exactly what you
>want. JBurg should merge nicely with ANTLR :)
Interesting, but I am just not sure it will meet my needs. Looks like it
would take quite a bit of work to coerce it into functioning as just a
selective tree-walker. BTW, it does have explicit ANTLR integration.
Rather than putting the work into generating my own dedicated tree-walker
or fudging around JBurg, is there any interest in my adding the feature to
ANTLR? Obviously not a widely needed feature, but it would make ANTLR just
a bit more generalized.
Thanks again,
Gerald
----
Gerald B. Rosenberg, Esq.
NewTechLaw
285 Hamilton Avenue, Suite 520
Palo Alto, CA 94301-2576
650.325.2100 (office) / 650.703.1724 (cell)
650.325.2107 (fax)
www.newtechlaw.com
More information about the antlr-interest
mailing list