| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| --> |
| <!-- You may freely edit this file. See harness/README in the NetBeans platform --> |
| <!-- for some information on what you could do (e.g. targets to override). --> |
| <!-- If you delete this file and reopen the project it will be recreated. --> |
| <project name="java/languages.antlr" default="build" basedir="."> |
| <description>Builds, tests, and runs the project org.netbeans.modules.languages.antlr</description> |
| <import file="../../nbbuild/templates/projectized.xml"/> |
| |
| <target name="download-antlr-grammar" depends="init"> |
| <property name="antlr.additionalheader"> |
| |
| @header{ |
| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| |
| // DO NOT EDIT THIS FILE MANUALLY! |
| // SEE build.xml FOR INSTRUCTIONS |
| |
| package org.antlr.parser.antlr4; |
| |
| } |
| |
| </property> |
| <property name="antlr.outdir" location="${src.dir}/org/antlr/parser/antlr4"/> |
| <mkdir dir="${antlr.outdir}"/> |
| |
| <get src="https://raw.githubusercontent.com/antlr/grammars-v4/${antlr4.grammar.version}/antlr/antlr4/ANTLRv4Lexer.g4" dest="${antlr.outdir}"/> |
| <get src="https://raw.githubusercontent.com/antlr/grammars-v4/${antlr4.grammar.version}/antlr/antlr4/ANTLRv4Parser.g4" dest="${antlr.outdir}"/> |
| <get src="https://raw.githubusercontent.com/antlr/grammars-v4/${antlr4.grammar.version}/antlr/antlr4/LexBasic.g4" dest="${antlr.outdir}"/> |
| <get src="https://raw.githubusercontent.com/antlr/grammars-v4/${antlr4.grammar.version}/antlr/antlr4/Java/LexerAdaptor.java" dest="${antlr.outdir}"/> |
| <replace file="${antlr.outdir}/LexerAdaptor.java" token="//package" value="package"/> |
| <replaceregexp match="(parser|lexer) grammar ([^;]+);([\n\r]*)" |
| replace="\1 grammar \2;${antlr.additionalheader}" |
| flags="g" |
| > |
| <fileset dir="${antlr.outdir}" includes="ANTLRv4Parser.g4 LexBasic.g4" /> |
| </replaceregexp> |
| </target> |
| |
| <target name="generate-antlr-parser" description="Regenerate the ANTLRv4 parser" depends="init"> |
| <property name="antlr.outdir" location="${src.dir}/org/antlr/parser/antlr4"/> |
| <path id="antlr4.tool"> |
| <fileset dir="../../ide/libs.antlr4.runtime/external" includes="*.jar"/> |
| <fileset dir="../../ide/libs.antlr3.runtime/external" includes="antlr-runtime-*.jar"/> |
| </path> |
| |
| <java classname="org.antlr.v4.Tool" classpathref="antlr4.tool" fork="true" dir="${antlr.outdir}"> |
| <arg value="-o"/> |
| <arg value="${antlr.outdir}"/> |
| <!--arg value="-package"/> |
| <arg value="org.antlr.parser.antlr4"/--> |
| <arg value="ANTLRv4Lexer.g4"/> |
| <arg value="ANTLRv4Parser.g4"/> |
| </java> |
| |
| <delete dir="${antlr.outdir}" includes="*.tokens"/> |
| <delete dir="${antlr.outdir}" includes="*.interp"/> |
| <!--delete dir="${antlr.outdir}" includes="*.g4"/--> |
| |
| </target> |
| </project> |