module demo::lang::Pico::Abstract
rascal-0.40.17
Usage
import demo::lang::Pico::Abstract;
data TYPE
data TYPE (loc src=|unknown:///|)
= natural()
| string()
;
alias PicoId
str
data PROGRAM
data PROGRAM (loc src=|unknown:///|)
= program(list[DECL] decls, list[STATEMENT] stats)
;
data DECL
data DECL (loc src=|unknown:///|)
= decl(PicoId name, TYPE tp)
;
data EXP
data EXP (loc src=|unknown:///|)
= id(PicoId name)
| natCon(int iVal)
| strCon(str sVal)
| add(EXP left, EXP right)
| sub(EXP left, EXP right)
| conc(EXP left, EXP right)
;
data STATEMENT
data STATEMENT (loc src=|unknown:///|)
= asgStat(PicoId name, EXP exp)
| ifElseStat(EXP exp, list[STATEMENT] thenpart, list[STATEMENT] elsepart)
| whileStat(EXP exp, list[STATEMENT] body)
;
alias Occurrence
tuple[loc src, PicoId name, STATEMENT stat]