[antlr-interest] more newbie help required

karl wettin kalle at snigel.net
Wed Feb 8 03:19:26 PST 2006


8 feb 2006 kl. 01.49 skrev karl wettin:

> 1. I can't figure out why I can't get the matched value of  
> expressions within one expression. It's all null. It obviously match.
>

So it seems as I must call other grammar in order to get a value?  
E.g. foo:BAR and not foo:(BAR | SHAKE) ? At least that gives me some  
data.

Howver, I can't figure out who to extract the show grammar. Is it  
possible to break in grammar? E.g. if new expression SHOW contains a  
SEASON_AND_EPISODE, then it should break. That is the only way I can  
think of.


New output:
null
["s1e9-10",<7>,line=1,col=1]
["xvid",<6>,line=1,col=1]
["ac3.5.1",<6>,line=1,col=1]
["hdtv",<6>,line=1,col=1]
["evilpirates",<19>,line=1,col=1]


WELL_FORMATTED : 	
	show:(		
		options { greedy=false; } :
		ALPHANUMWORD ('.' | ('-' ALPHANUMWORD '.'))
	)+
	{System.out.println(show);}
	
	sae:SEASON_AND_EPISODE
	{System.out.println(sae);}
	
	((
		options { greedy=false; } :		
		'.'
		meta:META_TAG
		{System.out.println(meta);}
	)+)?
	
	'-'
	group:RELEASE_GROUP
	{System.out.println(group);}
	
	;

META_TAG :
	ALPHANUMWORD (('.' (DIGIT)+)+)?
	;




More information about the antlr-interest mailing list