# Yacc Form of grammar OsfV1.grm

Copyright © 2013 by Hassan Aït-Kaci; All Rights Reserved.

This yacc grammar was generated on Thu Oct 03 16:39:06 CEST 2013 from the annotated Jacc grammar file `OsfV1.grm`.

    OsfV1Program
    	: Statements_opt
    	;

    Statements_opt
    	: /* empty */
    	| Statements_opt Statement
    	;

    Statement
    	: StatementType EndOfStatement
    	;

    EndOfStatement
    	: EOS
    	;

    StatementType
    	: /* empty */
    	| Pragma PragmaArguments_opt
    	| SortDeclarationStatement
    	| OsfExpression
    	| error
    	;

    SortDeclarationStatement
    	: IsaDeclarationStatement
    	;

    IsaDeclarationStatement
    	: SortSymbols ISA SortSymbols
    	;

    SortSymbol
    	: IDENTIFIER
    	;

    SortSymbols
    	: SortSymbol
    	| SortSymbol ',' SortSymbols
    	;

    OsfExpression
    	: PsiTerm
    	;

    PsiTerm
    	: TAG
    	| UntaggedPsiTerm
    	| TAG ':' UntaggedPsiTerm
    	;

    UntaggedPsiTerm
    	: SortExpression Body_opt
    	;

    Body_opt
    	: /* empty */
    	| '(' SubTerms ')'
    	;

    SubTerms
    	: SubTerm
    	| SubTerm ',' SubTerms
    	;

    SubTerm
    	: PsiTerm
    	| Feature ARROW PsiTerm
    	;

    Feature
    	: INTEGER
    	| IDENTIFIER
    	;

    SortExpression
    	: Constant
    	| Sort
    	| '{' SortList '}'
    	| NOT SortExpression
    	| SortExpression AND SortExpression
    	| SortExpression OR SortExpression
    	| SortExpression BUTNOT SortExpression
    	| '(' SortExpression ')'
    	;

    Constant
    	: INTEGER
    	| CHAR
    	| FLOAT
    	| STRING
    	| BOOLEAN
    	;

    Sort
    	: TOP
    	| BOTTOM
    	| IDENTIFIER
    	;

    SortList
    	: Sort
    	| Sort ';' SortList
    	;

    Pragma
    	: PRAGMA
    	;

    PragmaArguments_opt
    	: /* empty */
    	| INTEGER
    	| FileList
    	;

    FileList
    	: STRING
    	| STRING FileList
    	;

Copyright © 2013 by Hassan Aït-Kaci; All Rights Reserved.