Copyright 2015 Sami Badra. All Rights Reserved.
Sami Badra: masc0673
CS 530, Spring 2015
Assignment #3, parser
FILE: README
##Description This program will determine if a certain input is valid for the set of grammar rules found below. The program will output “Successful parse” if the input is correct. If not, it will identify where the error was encountered and identify what kind of error it was.
##Grammer Rules
::= {}$
::= char = ;
::= {( + | - ) }
::=
{( * | / )
}
::= ^
|
::= char | ( ) | digit
NOTE: It is important to note that the operands can only consist of single numeric digits, and SINGLE alphabetic characters, separated by an operator (i.e. = + - * / ^).
This is a grammar for a simple language consisting of a sequence of assignment statements, terminated by semicolons. The whole program is terminated by the symbol ‘$’.
##Sample Input
a = 6; e = m * c^2; c = h^ (t-5+ (g^n-9) +k^4 *u); $
z= u-9 ; y = 5-t^(h-8*j+6) / k^3; u=o-l; k=5-l/8; $
##Operating Instructions
- Compile and run the program (with no arguments)
- Program will ask for user to input a sentence to parse
- Enter one or more expressions on one line, each followed by ';'
- Put a '$' sign at the end of the last expression in the sentence, and click enter
- Program outputs "Successful parse" if sentence is correct, ERROR otherwise