language MAPLE extension mpl module definition stmt use stmt token newline category ignore_scrap translation <> comment begin <"#"> end newline default translation <*> mathness no line begin <"#line"> end <> token pseudo_semi category terminator translation <"\\rx"> token identifier category ident token number category numbr token { category slopen translation <"\\{"> token } category slclose translation <"\\}"> token [ category slopen tangleto token ] category slclose tangleto <"\]"-space> token ( category open token ) category close #what to do with ' and ` and "?? #token ` category backquote token ' category math tangleto token . category point token ; category terminator translation <";"-break_space> token : category terminator translation <":"-break_space> token , category comma translation <","-opt-1> token \ category backslash translation <"\\backslash"> #tijdelijk: van vorige regel: tangleto <"\\"> token := category assignment translation <":="> token $ category binop translation <"\\,\\$\\,"> #token .. category binop translation <".."> token * category binop token ^ category binop token / category binop token <> category binop translation <"\\NEQ"> tangleto <"<>"> token <= category binop translation <"\\leq"> token >= category binop translation <"\\geq"> token = category binop token < category binop token > category binop token ! category unop token + category unorbinop token - category unorbinop #ilk definitions ilk forstart_like category forstart ilk forbodystart_like category forbodystart ilk forbodyend_like category forbodyend ilk ifbegin_like category ifbegin ilk ifthen_like category ifthen ilk elif_like category elif ilk ifbody_like category ifbody ilk ifend_like category ifend ilk procedure_like category procedure ilk procextra_like category procextra ilk procend_like category procend ilk return_like category return ilk ident_like category ident default translation <"\\"-space-*-"\\"-space> ilk binop_like category binop reserved proc ilk procedure_like reserved end ilk procend_like reserved local ilk procextra_like reserved option ilk procextra_like reserved minus ilk binop_like reserved for ilk forstart_like reserved while ilk forstart_like reserved to ilk forstart_like reserved in ilk forstart_like reserved from ilk forstart_like reserved do ilk forbodystart_like reserved od ilk forbodyend_like reserved if ilk ifbegin_like reserved then ilk ifthen_like reserved elif ilk elif_like reserved else ilk ifbody_like reserved fi ilk ifend_like reserved RETURN ilk return_like reserved break ilk ident_like reserved next ilk ident_like #token category #production rules #? ignore_scrap --> #1 #handling statements; <"$"> math <"$"> terminator --> stmt stmt stmt --> stmt stmt terminator --> stmt ignore_scrap --> terminator terminator --> stmt #handling comments #comment newline --> newline #comment ? --> comment #handling idents and math etc. return --> math ident --> math numbr --> math (unop|unorbinop|binop) math --> math math (unop|unorbinop|binop) --> math math math --> math math comma --> math math [ point point ] --> math binop math point --> math math assignment --> math <"$"> math <"$"> terminator --> stmt #handlig forloops forstart <"$"> math <"$"> --> forstart forstart forstart --> forstart forstart forbodystart --> forbodystart forbodystart stmt --> forbodystart forbodystart forbodyend terminator --> stmt forbodystart forbodyend --> stmt forbodystart <"$"> math <"$"> forbodyend terminator --> stmt forbodystart <"$"> math <"$"> forbodyend --> stmt #handling ifstatements ifbegin <"$"> math <"$"> ifthen --> ifbegin ifbegin stmt --> ifbegin ifbegin ifend terminator --> stmt ifbegin ifend --> stmt ifbegin <"$"> math <"$"> ifend terminator --> stmt ifbegin <"$"> math <"$"> ifend --> stmt ifbegin ifbody --> ifbegin ifbegin <"$"> math <"$"> ifbody --> ifbegin elif <"$"> math <"$"> ifthen --> elif elif stmt --> elif elif <"$"> math <"$"> elif --> elif elif elif --> elif elif ifbody --> elif elif <"$"> math <"$"> ifbody --> elif elif <"$"> math <"$"> ifend terminator --> elifend elif <"$"> math <"$"> ifend --> elifend elif ifend terminator --> elifend elif ifend --> elifend ifbegin elifend --> stmt ifbegin <"$"> math <"$"> elifend --> stmt #handling procedures <"$"> math <"$"> procedure <"$"> math <"$"> --> procedure procedure procextra stmt --> procedure procedure stmt --> procbody procbody stmt --> procbody procbody procend terminator --> stmt procbody <"$"> math <"$"> procend terminator --> stmt procbody procend --> stmt procbody <"$"> math <"$"> procend --> stmt procedure <"$"> math <"$"> procend terminator --> stmt procedure <"$"> math <"$"> procend --> stmt #handling sets and lists open <"\\,"> close --> math open <"\\,"> math <"\\,"> close --> math slopen <"\\,"> slclose --> math slopen <"\\,"> math <"\\,"> slclose --> math #handling backslash math backslash math --> math backslash newline --> newline backslash backslash --> math backslash --> math #handling backquote #changefile makes '`' reading as string! macros begin \def\commentbegin{\#} \def\commentend{} \def\NEQ{\ne} \def\LL{\ll\,} \def\RR{\,\gg} \def\PS{\joinrel{+\equiv}} \let\rx\relax macros end