Skip to content

romildo/picnic-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

picnic-java

Picnic is a toy programming language, implemented in Java. It is an easy understanding programming language based on the book Introduction to Compiler Design, by Torben Ægidius Mogensen.

Grammar

  • The syntax of the language is given by a context free grammar.
  • Only the production rules are explicitly given.
  • The sets of terminals and non-terminals are obtained from the rules.
  • The initial symbol is the non-terminal on the left side of the first production rule.
Production rule Internal representation
ProgramFuns Program
FunsFun Sequence of Function definitions
FunsFun Funs
FunTypeId ( TypeIds ) = Exp Function definition
TypeIdbool id Type and identififier
TypeIdint id
TypeIdsTypeId Sequence of types and identifiers
TypeIdsTypeId TypeIds
Expnum Expressions
Expid
ExpExp + Exp
ExpExp < Exp
Expid ( Exps )
Expif Exp then Exp else Exp
Explet id = Exp in Exp
ExpsExp Sequence of expressions
ExpsExp , Exps

About

Toy programming language, implemented in Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published