S - Intranet - Department of Computer Science: Login
S - Intranet - Department of Computer Science: Login
S - Intranet - Department of Computer Science: Login
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Java Cup Specification Structure<br />
java_cup_spec ::= package_spec<br />
import_list<br />
code_part<br />
init_code<br />
scan_code<br />
symbol_list<br />
precedence_list<br />
start_spec<br />
production_list<br />
• Great, but what does it mean<br />
– Package and import control Java naming<br />
– Code and init_code allow insertion <strong>of</strong> code in generated output<br />
– Scan code specifies how scanner (lexer) is invoked<br />
– Symbol list and precedence list specify terminal and non-terminal names and<br />
their precedence<br />
– Start and production specify grammar and its start point<br />
61