gmh5225 / scanner Goto Github PK
View Code? Open in Web Editor NEWThis project forked from tfordjr/compiler
Implementing compiler scanner for a made up language with simple grammars in c++
This project forked from tfordjr/compiler
Implementing compiler scanner for a made up language with simple grammars in c++
Terry Ford Jr. - CS 4280 Compiler Project - P3 Static Semantics - 11/18/2023 git - https://github.com/tfordjr/scanner Three options for invokation: ./P3 Read from stdin (stop input with Ctrl+D) ./P3 filename(exclude extention) Read from file, .f23 file extention assumed ./P3 < filename(include extention) Put file into stdin implementation: main.cpp handles file input and stdin input parser.cpp, parser.h handle parser function and full BNF scanner.h handles scanner function and token definition testTree.cpp, testTree.h, node.h handle node definition, tree traversal, semantics testing files t1-t10 are good programs, tb1-tb10 are bad programs simple makefile and readme included Added static semantics (double declaration or use without declaration) added it to testTree.cpp and testTree.h because the semantics are just another traversal Full BNF: <program> -> <vars> xopen <stats> xclose <vars> -> empty | xdata <varList> <varList> -> identifier : integer ; | identifier : integer <varList> <exp> -> <M> / <exp> | <M> * <exp> | <M> <M> -> <N> + <M> | <N> <N> -> <R> - <N> | ~ <N> | <R> <R> -> ( <exp> ) | identifier | integer <stats> -> <stat> <mStat> <mStat> -> empty | <stat> <mStat> <stat> -> <in> | <out> | <block> | <if> | <loop> | <assign> <block> -> { <vars> <stats> } <in> -> xin >> identifier ; <out> -> xout << <exp> ; <if> -> xcond [ <exp> <RO> <exp> ] <stat> <loop> -> xloop [ <exp> <RO> <exp> ] <stat> <assign> -> xlet identifier <exp> ; <RO> -> << (one token) | >> (one token) | < | > | = | %
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.