17.01.2015 Views

S - Intranet - Department of Computer Science: Login

S - Intranet - Department of Computer Science: Login

S - Intranet - Department of Computer Science: Login

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A SableCC Grammar with transformations<br />

SableCC specification <strong>of</strong> tokens:<br />

Package expression;<br />

Helpers<br />

digit = ['0' .. '9'];<br />

tab = 9;<br />

cr = 13;<br />

lf = 10;<br />

eol = cr lf | cr | lf; // This takes care <strong>of</strong> different platforms<br />

blank = (' ' | tab | eol)+;<br />

Tokens<br />

l_par = '(';<br />

r_par = ')';<br />

plus = '+';<br />

minus = '-';<br />

mult = '*';<br />

div = '/';<br />

comma = ',';<br />

blank = blank;<br />

number = digit+;<br />

Ignored Tokens<br />

blank;<br />

73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!