SCM Repository
View of /sml/trunk/src/cm/parse/cm.grm
Parent Directory
|
Revision Log
Revision 273 -
(download)
(annotate)
Wed May 12 08:38:51 1999 UTC (21 years, 8 months ago) by blume
File size: 5539 byte(s)
Wed May 12 08:38:51 1999 UTC (21 years, 8 months ago) by blume
File size: 5539 byte(s)
checking for group cycles implemented (with nicely formatted error message)
(* -*- sml -*- * * ML-Yacc grammar for CM description files * * (C) 1999 Lucent Technologies, Bell Laboratories * * Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp) *) structure S = CMSemant %% %term EOF | FILE_STANDARD of string | FILE_NATIVE of string | CM_ID of string | ML_ID of string | NUMBER of int | ALIAS | GROUP | LIBRARY | IS | LPAREN | RPAREN | COLON | IF | THEN | ELIF | ELSE | ENDIF | ERROR of string | STRUCTURE | SIGNATURE | FUNCTOR | FUNSIG | DEFINED | PLUS | MINUS | TIMES | DIV | MOD | TILDE | ANDALSO | ORELSE | NOT | LT | LE | GT | GE | EQ | NE %nonterm description of S.group | alias of S.group | group of S.group | opt_perms of S.perms | perms of S.perms | lib_exports of S.exports | exports of S.exports | export of S.exports | guarded_exports of S.exports * S.exports | else_exports of S.exports | members of S.members | member of S.members | guarded_members of S.members * S.members | else_members of S.members | aexp of S.aexp | boolexp of S.exp | exp of S.exp | ml_symbol of S.ml_symbol | pathname of S.pathname | cmpath of S.pathname | nativepath of S.pathname | sym of S.cm_symbol %pos int %verbose %arg (context, error, recParse, doMember) : S.context * (pos * pos -> string -> unit) * (pos * pos -> S.pathname -> S.group) * (S.pathname * pos * pos * S.cm_symbol option -> S.members) %start description %eop EOF %noshift EOF %name CM %keyword ALIAS GROUP LIBRARY IS IF THEN ELIF ELSE ENDIF DEFINED STRUCTURE SIGNATURE FUNCTOR FUNSIG %prefer LPAREN %left ORELSE %left ANDALSO %nonassoc LT LE GT GE %nonassoc EQ NE %left PLUS MINUS %left TIMES DIV MOD %left NOT TILDE %% description : alias (alias) | group (group) alias : ALIAS pathname (recParse (pathnameleft, pathnameright) pathname) group : GROUP opt_perms exports IS members (S.group (opt_perms, exports, members)) | LIBRARY opt_perms lib_exports IS members (S.library (opt_perms, lib_exports, members)) opt_perms : (* empty *) (S.initialPerms) | LPAREN perms RPAREN (perms) perms : (* empty *) (S.initialPerms) | perms sym (S.require (perms, sym, error (symleft, symright))) | perms COLON sym (S.grant (perms, sym, error (symleft, symright))) lib_exports : export exports (S.exports (export, exports)) exports : (* empty *) (S.emptyExports) | export exports (S.exports (export, exports)) export : ml_symbol (S.export ml_symbol) | IF exp guarded_exports (S.guarded_exports (exp, guarded_exports)) | ERROR (S.error_export ERROR) guarded_exports : THEN exports else_exports ((exports, else_exports)) else_exports : ENDIF (S.emptyExports) | ELSE exports ENDIF (exports) | ELIF exp guarded_exports (S.guarded_exports (exp, guarded_exports)) members : (* empty *) (S.emptyMembers) | member members (S.members (member, members)) member : pathname (doMember (pathname, pathnameleft, pathnameright, NONE)) | pathname COLON sym (doMember (pathname, pathnameleft, pathnameright, SOME sym)) | IF exp guarded_members (S.guarded_members (exp, guarded_members)) | ERROR (S.error_member ERROR) guarded_members : THEN members else_members ((members, else_members)) else_members : ENDIF (S.emptyMembers) | ELSE members ENDIF (members) | ELIF exp guarded_members (S.guarded_members (exp, guarded_members)) sym : CM_ID (S.cm_symbol CM_ID) exp : boolexp (boolexp) aexp : NUMBER (S.number NUMBER) | sym (S.variable sym) | LPAREN aexp RPAREN (aexp) | aexp PLUS aexp (S.plus (aexp1, aexp2)) | aexp MINUS aexp (S.minus (aexp1, aexp2)) | aexp TIMES aexp (S.times (aexp1, aexp2)) | aexp DIV aexp (S.divide (aexp1, aexp2)) | aexp MOD aexp (S.modulus (aexp1, aexp2)) | TILDE aexp (S.negate aexp) boolexp : DEFINED LPAREN ml_symbol RPAREN (S.ml_defined ml_symbol) | DEFINED LPAREN sym RPAREN (S.cm_defined sym) | LPAREN boolexp RPAREN (boolexp) | boolexp ANDALSO boolexp (S.conj (boolexp1, boolexp2)) | boolexp ORELSE boolexp (S.disj (boolexp1, boolexp2)) | boolexp EQ boolexp (S.beq (boolexp1, boolexp2)) | boolexp NE boolexp (S.bne (boolexp1, boolexp2)) | NOT boolexp (S.not boolexp) | aexp LT aexp (S.lt (aexp1, aexp2)) | aexp LE aexp (S.le (aexp1, aexp2)) | aexp GT aexp (S.gt (aexp1, aexp2)) | aexp GE aexp (S.ge (aexp1, aexp2)) | aexp EQ aexp (S.eq (aexp1, aexp2)) | aexp NE aexp (S.ne (aexp1, aexp2)) ml_symbol : STRUCTURE ML_ID (S.ml_structure ML_ID) | SIGNATURE ML_ID (S.ml_signature ML_ID) | FUNCTOR ML_ID (S.ml_functor ML_ID) | FUNSIG ML_ID (S.ml_funsig ML_ID) pathname : FILE_STANDARD (S.file_standard (FILE_STANDARD, context)) | FILE_NATIVE (S.file_native (FILE_NATIVE, context))
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |