# Copyright © Corporation for National Research Initiatives
include ../../../Misc/make.rules
CLASSPATH = ../../..

JJTREE = /usr/local/javacc2.0/bin/jjtree
JAVACC = /usr/local/javacc2.0/bin/javacc

# files generated by javacc or jjtree
GENSOURCES= PythonGrammar.java Node.java Token.java ASCII_CharStream.java \
	PythonGrammarConstants.java \
	PythonGrammarTokenManager.java PythonGrammarTreeConstants.java \
	JJTPythonGrammarState.java

# Generated files which we've modified.
HACKEDSOURCES= TokenMgrError.java ParseException.java

SOURCES= $(wildcard *.java) $(GENSOURCES) $(HACKEDSOURCES)

CLASSES= $(SOURCES:%.java=%.class)

GENFILES= python.jj $(GENSOURCES)

all: PythonGrammar.java

PythonGrammar.java: python.jj
	$(JAVACC) python.jj

python.jj: python.jjt
	$(JJTREE) python.jjt

realclean:: clean
	-rm $(GENFILES)
