parsing - What is wrong with this ParseKit grammar? -


here document i'm trying parse:

tha dhi thom num thakatharikitathaka  thakatharikitathaka = ta tha chap tha ki ta tha ka 

and i've defined grammar follows:

@start = expr;  expr = singleexpr+ phrasedictionary*;  singleexpr = aksharagroup;  phrasedictionary = phrase '='! aksharagroup;  phrase = word;  aksharagroup = akshara+ ('/'! noteduration)?;  akshara = tha | dhi | thom | num | ki | ta | ka | chap | phrase;  noteduration = number;  tha = 'tha'; dhi = 'dhi'; thom = 'thom'; num = 'num'; ki = 'ki'; ta = 'ta'; ka = 'ka'; chap = 'chap'; 

the part i'm having problems phrasedictionary - second thakatharikitathaka gets parsed phrase, akshara , aksharagroup, expected, exceptions expect match phrasedictionary

expected : / line : 2 near : = ta  found : =  expected : uppercase word line : 2 near : = ta  found : =  expected : «eof» line : 2 near : = ta  found : = 

with parsekit's infinite lookahead, shouldn't proceed , match phrasedictionary grammar?

what missing?

thanks, sridhar

developer of parsekit here.

your grammar working me parsekit head of trunk on google code.

here's pkassembly output parse:

[tha, dhi, thom, num, thakatharikitathaka, thakatharikitathaka, ta, tha, chap, tha, ki, ta, tha, ka]tha/dhi/thom/num/thakatharikitathaka/thakatharikitathaka/=/ta/tha/chap/tha/ki/ta/tha/ka^ 

the stack (inside square braces) , caret @ end indicate parser generated grammar able recognize input way end.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

mysql - Pass value between different pages (form) with PHP -