How does antlr generate code?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sever_Fundatureanu
Posted On:   Friday, April 11, 2008 06:07 AM

Hello, I am writing a code generator using string templates and i came across this problem: Let's say I have the following 2 rules as an example: expr2 : e=expr1 ({condition1}? -> template1 | -> template2 ); expr1 : something ({condition2}? -> template3 | -> template4 ); I found in the class generated by antlr code that combined the 2 conditions: (condition1&&condition2). This turned out to be a big problem because i have much more such conditions and the generated code became too large for a method (64K)- I think due to all the combinations from conditions. I would like to know if    More>>

Hello,



I am writing a code generator using string templates and i came across this problem:


Let's say I have the following 2 rules as an example:

			
expr2 : e=expr1
({condition1}? -> template1
| -> template2
);

expr1 : something ({condition2}? -> template3
| -> template4
);


I found in the class generated by antlr code that combined the 2 conditions: (condition1&&condition2). This turned out to be a big problem because i have much more such conditions and the generated code became too large for a method (64K)- I think due to all the combinations from conditions.


I would like to know if it is possible to avoid this somehow and if so how? Any suggestions are welcome.



Thank you,



Sever

   <<Less
About | Sitemap | Contact