Created
February 12, 2023 20:39
-
-
Save Tomcat-42/9b3a085c2ce4afde05fc5a157246e6f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Program> ::= <Exps> | <Decs> | |
<Exps> ::= <Exp> | <Exp> <Exps> | '' | |
<Exp> ::= <Nil> | <Integer> | <String> | <ListExp> | <Struct> | <LValue> | <FnCall> | <Operation> | <Group> | <IfExp> | <WhileExp> | <ForExp> | <Break> | <LetExp> | |
<ListExp> ::= <Id> <LSquareBracket> <Exp> <RSquareBracket> <Of> <Exp> | |
<Struct> ::= <Id> <LCurlyBracket> <StructFields> <RCurlyBracket> | |
<StructFields> ::= <Id> <Equal> <Exp> | <Id> <Equal> <Exp> <Comma> <StructFields> | '' | |
<FnCall> ::= <Id> <LRoundBracket> <FnCallArgs> <RRoundBracket> | |
<FnCallArgs> ::= <Exp> | <Exp> <Comma> <FnCallArgs> |'' | |
<Operation> ::= <ArithmeticOperation> | <RelationalOperation> | <LogicalOperation> | |
<ArithmeticOperation> ::= <Exp> <Plus> <Exp> | <Exp> <Minus> <Exp> | <ArithmeticMultiplicationOperation> | |
<ArithmeticMultiplicationOperation> ::= <Exp> <Times> <Exp> | <Exp> <Slash> <Exp> | |
<RelationalOperation> ::= <Exp> <Equal> <Exp> | <Exp> <NotEqual> <Exp> | <Exp> <GreaterThan> <Exp> | <Exp> <LessThan> <Exp> | <Exp> <GreaterThanEqual> <Exp> | <Exp> <LessThanEqual> <Exp> | |
<LogicalOperation> ::= <Exp> <And> <Exp> | <Exp> <Or> <Exp> | <Not> <RelationalOperation> | <Not> <LogicalOperation> | |
<Group> ::= <LRoundBracket> <Exps> <RRoundBracket> | |
<IfExp> ::= <If> <Exp> <Then> <Exp> <ElseExp> | |
<ElseExp> ::= <Else> <Exp> | '' | |
<WhileExp> ::= <While> <Exp> <Do> <Exp> | |
<ForExp> ::= <For> <Id> <Atrib> <Exp> <To> <Exp> <Do> <Exp> | |
<LetExp> ::= <Let> <Decs> <In> <Exps> <End> | |
<LValue> ::= <Id> | <LValue> <Dot> <Id> | <LValue> <LSquareBracket> <Exp> <RSquareBracket> | |
<Decs> ::= <Dec> | <Dec> <Decs> | '' | |
<Dec> ::= <TyDec> | <VarDec> | <FnDec> | |
<TyDec> ::= <Type> <Id> <Equal> <Ty> | |
<VarDec> ::= <Var> <Id> <TyAnnotation> <Atrib> <Exp> | |
<FnDec> ::= <Fn> <Id> <LRoundBracket> <TyFields> <RRoundBracket> <TyAnnotation> <Equal> <Exps> | |
<Ty> ::= <Id> | <LCurlyBracket> <TyFields> <RCurlyBracket> | <List> <Of> <Id> | |
<TyFields> ::= <Id> <Colon> <Id> | <Id> <Colon> <Id> <Comma> <TyFields> | '' | |
<TyAnnotation> ::= <Colon> <Id> | '' | |
<Semicolon> ::= ';' | |
<Nil> ::= 'nil' | |
<LSquareBracket> ::= '\[' | |
<RSquareBracket> ::= '\]' | |
<Of> ::= 'of' | |
<LCurlyBracket> ::= '\{' | |
<RCurlyBracket> ::= '\}' | |
<LRoundBracket> ::= '\(' | |
<RRoundBracket> ::= '\)' | |
<Integer> ::= '(-)?[0-9]+' | |
<Plus> ::= '\+' | |
<Minus> ::= '-' | |
<Times> ::= '\*' | |
<Slash> ::= '/' | |
<Atrib> ::= ':=' | |
<NotEqual> ::= '<>' | |
<GreaterThanEqual> ::= '>=' | |
<LessThanEqual> ::= '<=' | |
<GreaterThan> ::= '>' | |
<LessThan> ::= '<' | |
<Equal> ::= '=' | |
<And> ::= '&' | |
<Or> ::= '\|' | |
<Not> ::= '!' | |
<If> ::= 'if' | |
<Then> ::= 'then' | |
<Else> ::= 'else' | |
<While> ::= 'while' | |
<Do> ::= 'do' | |
<For> ::= 'for' | |
<To> ::= 'to' | |
<Break> ::= 'break' | |
<Let> ::= 'let' | |
<In> ::= 'in' | |
<Fn> ::= 'fn' | |
<Colon> ::= ':' | |
<Comma> ::= ',' | |
<Dot> ::= '\.' | |
<Type> ::= 'type' | |
<Var> ::= 'var' | |
<End> ::= 'end' | |
<List> ::= 'list' | |
<String> ::= '".*"' | |
<Id> ::= '[a-z][a-za-z0-9]*' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment