======================================================== Compiler Construction - ExamplesX/ TABLE OF CONTENTS Sept. 13, 2011 ======================================================== This directory contains a collection of programs and writeups that will be of interest (and aid) to students who are learning about Compiler Construction. FILE or DIRECTORY/ DESCRIPTION ---------------------- ---------------------------------------------- 00INDEX.txt - This file AnIntroToANTLR.htm - Parr's "An Introduction To ANTLR" paper AnIntroFiles.zip A Running examples from "An Introduction to ANTLR" ANTLR-Mills-Tutorial.zip D ANTLR tutorial by Mills ANTLR-Stanchfield-Tutorial.zip D ANTLR tutorial by Stanchfield AssignExprs.zip A Assignment statements and arithmetic expressions AssignExprsTree.zip A Builds on AssignExprs: create an AST tree and walks it AssignParseGen.zip A Builds on AssignExprsTree; semantic analysis and code gen C-Syntax.doc - BNF C-Minus syntax as an MS Word .doc C-Syntax.pdf - BNF C-Minus syntax as a PDF file Expr2.zip A More advanced AST parser/walker example using Frames fact.c- S Recursive factorial C-Minus program fact.tm T Iterative factorial for the Tiny Machine Factor.zip T A Tiny program for factorial with driver for TM FSMInfo.pdf - Information on Finite State Machines gcd.c- S Recursive greatest common divisor C-Minus program HexFSM.pdf - Finite State Machine Recognizing Hex Numbers Ids.zip A Sequence of identifiers example JavaGrammars.zip A Two ANTLR grammars for Java Miniscule.zip A Miniscule example MiniTree.zip A Mini AST Tree example most.c- S Most of the syntax of C-Minus ParseEval.zip A How to include semantics directly into a parser RSAData.txt S Example data for Assignment X1 RSADataFinal.txt S Final data for Assignment X1 SimpleLexer.g A A simple lexer for alphas and numerics sort.c- S Selection sort C-Minus program TreeEval.zip A How to create an AST and then walk/evaluate it trees.html - How to build trees in ANTLR (from the ANTLR doc'n) - o - O - o - Note: "D" indicates subdirectory "S" indicates a C-Minus source file "T" indicates a TINY source file "A" indicates an ANTLR example File: http://Snow.SierraNevada.edu/~csci/ExamplesX/00INDEX.txt Last updated: 2:06 AM 9/13/2011