# # This is a makefile for building Java components of the FMSL translator. At # present, the only such component is the parser written in SableCC. This # parser supports the Eclipse plug-in, the subproject for which is in fmsl/ # subprojects/eclipse. Additional Java translator components may be added in # future, including a parser written with CUP and JFlex instead of SableCC. # # To perform a stand-alone execution of the SableCC-generated parser, do the # following from this directory: # # java parser.Main file.fmsl # # where file.fmsl is an input file. If the input is syntactically correct, # then the parser output is an echo of the input, minus comments and whitespace. # If there are syntax errors, then they are output. # # Here is an example run, performed from this directory: # # java parser/Main ../../../testing/implementation/acceptance/new-inputs/sablecc-tests/t1.fmsl # module m obj x is y ; end ; module M obj x is y ; end ; obj X is integer ; object Y is Z ; obj Z is X and Y and Z or A and B and C * ; object A is B ; operation Op ( A , B , C ) ; module N obj x is y ; end ; module O obj X is integer ; object Y is Z ; obj Z is X ; object A is B ; operation O ( A , B , C ) ; end ; value V = a + b * c / e ; # # # # # The following absolute path definitions of ROOT and SABLECC are set to work # on Cal Poly UNIX hosts falcon and hornet. These paths must be redefined # appropriately for other hosts. # # Absolute path on which other paths are are based. ROOT = /home/gfisher # Location of the SableCC install dir. SABLECC = $(ROOT)/pkg/sablecc/sablecc-3.2 SABLECC_CMD = java -jar $(SABLECC)/lib/sablecc.jar # # Location of executables directory, containing class files. This follows the # conventions of Fisher's projects, as described in the SOP available here: # # www.csc.calpoly.edu/~gfisher/classes/309/handouts/sop.html # EXECUTABLES = ../../executables/JVM # # Build the reduced version of the parser. This has a subset of the full FMSL # grammar. # reduced_parser: rm -rf parser/*/*.java $(SABLECC_CMD) reduced-grammar.scc # cp -p ParserMain.java parser javac -g parser/*.java parser/*/*.java # rm -rf $(EXECUTABLES)/parser # mv parser $(EXECUTABLES) test_reduced_parser: java parser/Main ../../../testing/implementation/acceptance/new-inputs/sablecc-tests/t1.fmsl # # Build a micro-sized version for initial and selected-feature debugging # purposes. micro_parser: rm -rf mparser/*/*.java $(SABLECC_CMD) micro-grammar.scc javac mparser/*.java parser/*/*.java reduced_parser: rm -rf parser/*/*.java $(SABLECC_CMD) reduced-grammar.scc # cp -p ParserMain.java parser javac -g parser/*.java parser/*/*.java # rm -rf $(EXECUTABLES)/parser # mv parser $(EXECUTABLES)