Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdielKavash committed Jan 8, 2019
0 parents commit f9ee46e
Show file tree
Hide file tree
Showing 37 changed files with 6,098 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
gen/*
BisonReport.txt
ifpp.exe
697 changes: 697 additions & 0 deletions doc/ifpp-manual.html

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
GenDir = gen
SrcDir = src
TestDir = tests

GenClass = Lexer Parser
SrcClass = Types Logger Context ParserWrapper
#ifppDriver ifppRuleOperations ifppCompiler

TestParse = basicSyntax
TestCompile = overrideWithoutChange overrideSameAction overrideNumeric nameLists incremental
AllTests = $(TestParse) $(TestCompile)

GenObj = $(addprefix $(GenDir)/,$(addsuffix .o,$(GenClass)))
SrcObj = $(addprefix $(GenDir)/,$(addsuffix .o,$(SrcClass)))
AllObjs = $(GenObj) $(SrcObj)

Flex = flex -i
Bison = bison
Gcc = g++ -Wall -Wextra -pedantic -I src -I gen
GccStrict = g++ -Wall -Wextra -pedantic -Weffc++ -Werror -I src -I gen

.PHONY: lex parser analyze tests doc clean

ifpp: $(AllObjs) src/ifpp.cpp
$(GccStrict) -o ifpp $(AllObjs) src/ifpp.cpp

lex: $(GenDir)/Lexer.cpp $(GenDir)/Lexer.h

parser: $(GenDir)/Parser.cpp $(GenDir)/Parser.h

analyze: src/Parser.y
$(Bison) -Wall --report=all --report-file=BisonReport.txt $<

tests: $(AllTests)

doc: doc/ifpp-manual.html

clean:
-rm gen/*
-rm tests/*.parsed.ifpp
-rm tests/*.partial.ifpp
-rm tests/*.filter
-rm ifpp.exe



$(GenDir)/Lexer.cpp $(GenDir)/Lexer.h: $(SrcDir)/Lexer.l $(SrcDir)/Types.h $(GenDir)/Parser.h
$(Flex) --outfile="gen/Lexer.cpp" --header-file="gen/Lexer.h" $(SrcDir)/Lexer.l

$(GenDir)/Parser.cpp $(GenDir)/Parser.h $(GenDir)/location.hh: $(SrcDir)/Parser.y $(SrcDir)/Types.h $(SrcDir)/Context.h
$(Bison) --output="gen/Parser.cpp" --defines="gen/Parser.h" $(SrcDir)/Parser.y

$(GenObj): $(GenDir)/%.o: $(GenDir)/%.cpp $(SrcDir)/Types.h $(SrcDir)/Logger.h
$(Gcc) -c -o $@ $<

$(SrcObj): $(GenDir)/%.o: $(SrcDir)/%.cpp $(SrcDir)/%.h $(SrcDir)/Types.h
$(GccStrict) -c -o $@ $<

$(GenDir)/Context.o: $(SrcDir)/Logger.h



$(TestParse): %: $(TestDir)/%.parsed.ifpp

$(TestCompile): %: $(TestDir)/%.filter

$(TestDir)/%.parsed.ifpp: $(TestDir)/%.ifpp ifpp
./ifpp -c -Dpartial -DparseOnly $<

$(TestDir)/%.filter: $(TestDir)/%.ifpp ifpp
./ifpp -c -Dpartial $<

doc/ifpp-manual.html: src/ifpp-manual.texinfo
makeinfo --html --no-split --css-include="src/ifpp-manual.css" -o "doc/ifpp-manual.html" "src/ifpp-manual.texinfo"


Loading

0 comments on commit f9ee46e

Please sign in to comment.