Forsing semantinc actions during synthactic prediction.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   valentin_tihomirov
Posted On:   Thursday, February 3, 2005 03:07 AM

The following rule was defined: identifier returns [String res=null]: {res = LT(1).getText();} ~(STR | LP | RP | NUM); However, called from synthactic predicate it always returns null; therefore the grammar view : LPAREN "view" type=identifier ({t.compareToIgnoreCase("NETLIST") == 0}? interface contents | bypass)* RPAREN; cell: LPAREN "cell" name=identifier (view | bypass)* RPAREN; has a contradiction. You see, the cell rule synthactiaclly predicates the view, which type is always null during evaluation and NullPointerException is raised on the viewtype identifier match. That is, the impossible situation occures - whenever an identifier token is matched, its rul   More>>

The following rule was defined:

			
identifier returns [String res=null]: {res = LT(1).getText();} ~(STR | LP | RP | NUM);

However, called from synthactic predicate it always returns null; therefore the grammar
			
view : LPAREN "view" type=identifier ({t.compareToIgnoreCase("NETLIST") == 0}? interface contents | bypass)* RPAREN;
cell: LPAREN "cell" name=identifier (view | bypass)* RPAREN;

has a contradiction. You see, the cell rule synthactiaclly predicates the view, which type is always null during evaluation and NullPointerException is raised on the viewtype identifier match. That is, the impossible situation occures - whenever an identifier token is matched, its rule cannot return null but it does.    <<Less
About | Sitemap | Contact