[antlr-interest] Build AST in multilexer

Jose Ventura jose.ventura.roda at gmail.com
Tue May 30 00:02:22 PDT 2006


Hi Bryan,

You are right. I will change the rule.

Thank's
José Ventura


2006/5/29, Bryan Ewbank <ewbank at gmail.com>:
>
> I think you are misreading the problem.  I suspect that you are
> overwriting the <CICS> node, rather than having the java code executed
> before the CICS node is created.  If you print out the EXEC at the
> beginnning of your java block, then again at the end, you will
> probably see
>   // before
>   #( EXEC CICS )
>   // after
>   #( EXEC comandoCICS )
> I don't have my environment handy, so cannot verify this.  What you
> most lilely need to do is simply be more careful in building the tree
> so that you don't clip off the CICS that is already there.
>
> - Bryan Ewbank
>
> On 5/29/06, Jose Ventura <jose.ventura.roda at gmail.com> wrote:
> >
> > Hi all,
> >
> > I'm developing a multilexer to test CICS command embedded in cobol
> program.
> > I have the next parser sentence (it's reduced):
> >
> > cobolSentence:
> >    EXEC^ CICS {
> >      Main.selector.push("CicsLex");
> >      CicsParser b = new CicsParser (getInputState());
> >      b.comando();
> >      ## = #(##, b.getAST());
> >     }
> >   END_EXEC
> >  ;
> >
> > I want to build the AST
> >
> >        EXEC
> >               |---------->CICS
> >                                  |------------>
> > "comandoCICS"
> >
> > but, the result is
> >
> >        EXEC
> >               |------------> "comandoCICS"
> >
> > How the java code after token CICS is executed before of creation CICS
> node,
> > the CICS node is lost.
> > How can I resolve this problem?
> >
> > Thanks in advance,
> > José Ventura
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060530/ac5498aa/attachment.html


More information about the antlr-interest mailing list