# Yacc Form of grammar OsfV0.grm

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

This yacc grammar was generated on Mon Jan 21 11:06:42 CET 2013 from the annotated Jacc grammar file `OsfV0.grm`.

    OsfV0Program
    	: 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
    	: Sort
    	| '{' SortList '}'
    	| NOT SortExpression
    	| SortExpression AND SortExpression
    	| SortExpression OR SortExpression
    	| SortExpression BUTNOT SortExpression
    	| '(' SortExpression ')'
    	;

    Sort
    	: TOP
    	| BOTTOM
    	| IDENTIFIER
    	;

    SortList
    	: Sort
    	| Sort ';' SortList
    	;

    Pragma
    	: PRAGMA
    	;

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

    FileList
    	: STRING
    	| STRING FileList
    	;

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