Multiple lexer and sharing an AST tree
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Marc_Fiammante
Posted On:   Thursday, December 6, 2001 09:58 AM

I have built 2 lexers and parsers the main parser calling a nested child lexer/parser several times. Lexing and parsing is OK but the AST tree of the child parsing is lost. The first parser finds some tags and then use a selector to switch to a nested secondary parser. tag1 : some_tag_data_handled_by_nested_parser tag2 : some_tag_data_handled_by_nested_parser .... tagn : some_tag_data_handled_by_nested_parser Each time that the selector switches it creates a new secondary parser just as in the javadoc example. How could I get the secondary parser to add its nodes to the main    More>>

I have built 2 lexers and parsers the main parser calling a nested
child lexer/parser several times.


Lexing and parsing is OK but the AST tree of the child parsing
is lost.


The first parser finds some tags and then use a selector to switch
to a nested secondary parser.


tag1 : some_tag_data_handled_by_nested_parser


tag2 : some_tag_data_handled_by_nested_parser


....


tagn : some_tag_data_handled_by_nested_parser


Each time that the selector switches it creates a new secondary
parser just as in the javadoc example.


How could I get the secondary parser to add its nodes to the main
parser ?


With the examples how would one add the javadocparser nodes to
the javaparse ?


Thank you very much in advance
Marc

   <<Less

Re: Multiple lexer and sharing an AST tree

Posted By:   Marc_Fiammante  
Posted On:   Friday, December 7, 2001 05:07 AM

I found the solution,easy enough.


Just need to add an addChild after the call to the nested parser.



from_AST->addChild(static_cast(parser.getAST()));



Cheers


MF

About | Sitemap | Contact