[prev in list] [next in list] [prev in thread] [next in thread] 

List:       antlr-interest
Subject:    [antlr-interest] How do you use template output with backtracking
From:       whalliburton () gmail ! com (William Halliburton)
Date:       2007-06-30 0:23:48
Message-ID: 4e7bd29e0706291723u796dae7dhd6b54781516e9c4a () mail ! gmail ! com
[Download RAW message or body]

How do I use the the output of a stringtemplate in predicates while
backtracking? I believe antlr only completes the template for the final path
and not for the subsequent failures.

Also, maybe this is the wrong approach and any other method would be most
appreciated.

Below is a simplification of my current project to demonstrate the problem.

I have a java function that takes a stringtemplate and checks its string
against a list. If backtracking is turned on then it receives a null, while
I need to to actually receive the template of bar.

Thank you.

----

tree grammar testing;

options {
    output=template;
    backtrack=true;
}

foo : ^(T1 a=bar) {myJavaFunction($a.st)}? -> {%{"asdfasdf"}}
    | alternative -> {$alternative.st}
    ;

----

Thank you all for this smart system.

William Halliburton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/antlr-interest/attachments/20070629/73b4c8ec/attachment.html 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic