An extended version of C: C-and-a-half
Named after Duff's device, which it can parse! (Amongst other things.)
Use make
(or make ass2
) (for 'assignment 2' of course, what else?!) to build
the parser, the Makefile might not be entirely correct, so use make -B ass2
when in doubt. By default it assumes the source code for Accent is in accent/
,
and is already built (so go to accent/accent
and run make
before trying to
build the parser).
It generates an ass2
executable which takes two optional arguments: the first
is the input file (stdin when not provided) and the second is the output
(stdout when not provided).
The parser will parse the input (-file) and produce a LaTeX-pretty printed
output (-file) without \\begin{document}
so it can be included directly
into existing TeX files.
ass2.flex
- Lexer-specification to be run through Flexass2.acc
- Parser-specification for Accentauxil.c
-main
function resides hereparser.h
- Common definitions for scanner & parsersamples.c
- Some example C-codepretty.tex
- Result of runningass2
withsamples.c
as inputreport.tex
- The report's source file (does an include onpretty.tex
)Makefile
- Builds (only) the parseraccent/*
- Contains the (modified) Accent Compiler Compiler source