[antlr-interest] Problem with '.' character

Daniels, Troy (US SSA) troy.daniels at baesystems.com
Wed Jan 23 07:55:49 PST 2008


Why is var2.var3 not a field expression?  Is it because they are on
different lines?  If so, you need to exclude newlines from your ignored
whitespace, and write the line-based rules as something like:
 
assignment: expr EQ expr NL;
 
rather than what I assume your current rule is:
 
assignment: expr EQ expr;
 
where NL matches whatever is allowed for newlines. 
 
Troy
 


  _____  

	From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Dev Team
	Sent: Wednesday, January 23, 2008 10:30 AM
	To: antlr-interest at antlr.org
	Subject: [antlr-interest] Problem with '.' character
	
	
	Hi there,
	I am currently trying to write a grammar with antlr.
	But the '.' character is used for both table/field separator and
statement ending.
	here is an example :
	
	method public void myMethod() :
	//...
	var1 = var2.
	var3 = myTable.myField.
	//...
	end method.
	
	So, the problem is that the grammar considers 'var2.var3' as a
table/field expression.
	Does someone know how to resolve this problem ?
	thanks in advance
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080123/1494b7a1/attachment.html 


More information about the antlr-interest mailing list