Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cpl-atm:laboratoare:laborator3 [2013/11/01 13:09]
laura.vasilescu [Exemplu]
cpl-atm:laboratoare:laborator3 [2013/11/01 13:13] (current)
laura.vasilescu [Exemplu]
Line 74: Line 74:
  
 </​code>​ </​code>​
 +
 +== Exercițiu ==
 +
 +Construiți un lexer pentru următoarea gramatică:
 +<​code>​
 +xml: <ID parameters>​xml</​ID>​
 +parameters: parameter parameters |;
 +parameter: ID = "​TEXT"​
 +TEXT: '​{'​ ALFANUMERIC '​}'​
 +</​code>​
 +Realizați în js un parser pentru aceasta.
 +
 +<​hidden>​
 +%%
 +
 +[a-zA-Z][a-zA-Z0-9]* ​     return '​ID';​
 +\{[a-zA-Z][a-zA-Z0-9]*\} ​    ​return '​TEXT';​
 +' '​+ ​   return '​SPACE';​
 +'<' ​  ​return '<';​
 +'/' ​  ​return '/';​
 +'>' ​  ​return '>';​
 +'​=' ​  ​return '​=';​
 +'"' ​  ​return '"';​
 +
 +%%
 +
 +text pentru input
 +<names ls="​{lalala}">​{fsdafsd}</​names>​
 +</​hidden>​
cpl-atm/laboratoare/laborator3.1383304186.txt.gz · Last modified: 2013/11/01 13:09 by laura.vasilescu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0