Recursive Decent Parser for Assignment 1
from ply import lex
from ply import yacc
# only handling integers, but this could match floats, too
NUMBER = re.compile("\d+")
# Helper Functions
CS 550 Programming Languages Instructor: Jeremy Johnson Due date: Thurs. April
18 at 9am
Parsing (100 points)
This assignment reviews the material in Lecture 1. You are to implement and test
the list parser discussed in class. You will do this
/* Lex file for Assignment 1 in CSC 550 at Drexel
* This lex file contains all of the symbol definitions for the list grammar
* defined in ParserGenerator.cup
* Matthew Maisel
JLex: A Lexical Analyzer Generator for Java(TM)
Written by Elliot Berk <firstname.lastname@example.org>. Copyright 1996.
Maintained by C. Scott Ananian <email@example.com>.
See below for copyright notice, license, and disclaimer.
New releases from
Parsing is Assignment 1 for CS 550 Programming Languages. Three parsers were
built in Python and Java using a recursive decent parser (rep) and parser
generators (gen). The generative grammars were supported via PLY for Python and