Skip to content

prakashn27/Object-Oriented-Parser-in-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object-Oriented-Parser-

####Grammar for TinyPL (using EBNF notation) is as follows:

program -> decls stmts end
decls -> int idlist ; idlist -> id { , id } stmts -> stmt [ stmts ] cmpdstmt-> '{' stmts '}' stmt -> assign | cond | loop assign -> id = expr ; cond -> if '(' rexp ')' cmpdstmt [ else cmpdstmt ] loop -> while '(' rexp ')' cmpdstmt rexp -> expr (< | > | =) expr expr -> term [ (+ | -) expr ] term -> factor [ (* | /) term ] factor -> int_lit | id | '(' expr ')'

Lexical: id is a single character; int_lit is an unsigned integer; equality operator is =, not ==

About

This repo demonstrates the Object oriented parsing for a custom programming language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages