This repository contains code examples demonstrating syntax parsing ambiguities in C++. Ambiguities organized into three separate buckets: Syntactic, Lexical, and Semantic. It also contains a custom language interpreter to show the complexity of parsing the syntax of a program.
g++ -std=c++20 vex.cpp -o vex
./vexg++ -std=c++20 dangle_login.cpp -o dangle_login
./dangle_loging++ -std=c++20 hmm.cpp -o hmm
./hmm# This fails in C++98
g++ -std=c++98 nest.cpp -o nest
# This works in C++11 and later
g++ -std=c++20 nest.cpp -o nest
./nestg++ -std=c++20 temple.cpp -o temple
./templeg++ -std=c++20 less.cpp -o less
./lessThe CustomParser/ directory contains Rember Script, a toy language interpreter built with Flex and Bison, demonstrating how to create custom parsers.
Build and Run:
cd CustomParser
make
./remberscript test.rember