dart-sdk/tools/spec_parser/Makefile
Erik Ernst 0c90e06932 Added pattern grammar rules
This CL changes $SDK/tools/spec_parser/Dart.g to include grammar rules
associated with the upcoming feature 'patterns'.

Change-Id: I3c8a5404471b0957d8e2a2b833156e02bbd3607b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266628
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-10-31 15:39:35 +00:00

33 lines
915 B
Makefile

# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
GRAMMAR=Dart.g
JAVA_PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin
JAVA=$(JAVA_PATH)/java
JAVAC=javac
ANTLR_JAR=/usr/share/java/antlr4-runtime.jar
ANTLR_FILES=DartLexer.java DartParser.java DartLexer.tokens
ANTLR_CMD=PATH=$(JAVA_PATH):$(PATH) antlr4 $<
GENERATED_JAVA_FILES=DartLexer.java DartParser.java
.PHONY: default parser clean touch parse_hello
default: $(GENERATED_JAVA_FILES) compile
compile: SpecParser.class
SpecParser.class: $(ANTLR_FILES) SpecParser.java
$(JAVAC) -cp .:$(ANTLR_JAR) SpecParser.java
%Lexer.java: %.g Makefile ; $(ANTLR_CMD)
%Parser.java: %.g Makefile ; $(ANTLR_CMD)
%.tokens: %.g Makefile ; $(ANTLR_CMD)
clean:
rm -f *.class $(ANTLR_FILES)
touch:
touch $(GRAMMAR)