Skip to content

Commit 8270397

Browse files
Merge pull request #8997 from haidubogdan/t_jflex
Basic syntax coloring support for jflex grammar files
2 parents 5e4b87c + 947fc7d commit 8270397

30 files changed

Lines changed: 2385 additions & 0 deletions

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,9 @@ jobs:
680680
- name: ide/languages.hcl
681681
run: ant $OPTS -f ide/languages.hcl test
682682

683+
- name: ide/languages.jflex
684+
run: ant $OPTS -f ide/languages.jflex test
685+
683686
- name: ide/languages.toml
684687
run: ant $OPTS -f ide/languages.toml test
685688

ide/languages.jflex/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
JflexAntlrColoringLexer.java

ide/languages.jflex/build.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
23+
<!-- for some information on what you could do (e.g. targets to override). -->
24+
<!-- If you delete this file and reopen the project it will be recreated. -->
25+
<project name="ide/languages.jflex" default="build" basedir=".">
26+
<description>Builds, tests, and runs the project org.netbeans.modules.languages.jflex</description>
27+
<import file="../../nbbuild/templates/projectized.xml"/>
28+
<target name="build-init" description="Regenerate the ANTLRv4 parser" depends="projectized.build-init" extensionOf="-pre-compile">
29+
<property name="lexer.outdir" location="${src.dir}/org/netbeans/modules/languages/jflex/grammar/antlr4/coloring"/>
30+
<path id="antlr4.tool">
31+
<fileset dir="../../ide/libs.antlr4.runtime/external" includes="*.jar"/>
32+
<fileset dir="../../ide/libs.antlr3.runtime/external" includes="antlr-runtime-*.jar"/>
33+
</path>
34+
<!--coloring-->
35+
<java classname="org.antlr.v4.Tool" classpathref="antlr4.tool" fork="true" dir="${lexer.outdir}" failonerror="true">
36+
<arg value="-o"/>
37+
<arg value="${lexer.outdir}"/>
38+
<arg value="JflexAntlrColoringLexer.g4"/>
39+
</java>
40+
41+
<delete dir="${lexer.outdir}" includes="*.tokens"/>
42+
<delete dir="${lexer.outdir}" includes="*.interp"/>
43+
</target>
44+
</project>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<licenseinfo>
23+
<fileset>
24+
<file>src/org/netbeans/modules/languages/jflex/resources/jflexTemplate.flex</file>
25+
<file>src/org/netbeans/modules/languages/jflex/resources/coloring.flex</file>
26+
<license ref="Apache-2.0-ASF" />
27+
<comment type="GUI_USABILITY"/>
28+
</fileset>
29+
<fileset>
30+
<file>src/org/netbeans/modules/languages/jflex/resources/jflex.png</file>
31+
<license ref="Apache-2.0-ASF" />
32+
<comment type="COMMENT_UNSUPPORTED" />
33+
</fileset>
34+
</licenseinfo>

ide/languages.jflex/manifest.mf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Manifest-Version: 1.0
2+
OpenIDE-Module: org.netbeans.modules.languages.jflex
3+
OpenIDE-Module-Layer: org/netbeans/modules/languages/jflex/resources/layer.xml
4+
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/jflex/resources/Bundle.properties
5+
OpenIDE-Module-Specification-Version: 0.1
6+
AutoUpdate-Show-In-Client: true
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
javac.compilerargs=-Xlint -Xlint:-serial
19+
spec.version.base.fatal.warning=false
20+
javac.release=17
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<project xmlns="http://www.netbeans.org/ns/project/1">
23+
<type>org.netbeans.modules.apisupport.project</type>
24+
<configuration>
25+
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
26+
<code-name-base>org.netbeans.modules.languages.jflex</code-name-base>
27+
<module-dependencies>
28+
<dependency>
29+
<code-name-base>org.netbeans.api.templates</code-name-base>
30+
<build-prerequisite/>
31+
<compile-dependency/>
32+
<run-dependency>
33+
<specification-version>1.39</specification-version>
34+
</run-dependency>
35+
</dependency>
36+
<dependency>
37+
<code-name-base>org.netbeans.core.multiview</code-name-base>
38+
<build-prerequisite/>
39+
<compile-dependency/>
40+
<run-dependency>
41+
<release-version>1</release-version>
42+
<specification-version>1.75</specification-version>
43+
</run-dependency>
44+
</dependency>
45+
<dependency>
46+
<code-name-base>org.netbeans.libs.antlr4.runtime</code-name-base>
47+
<build-prerequisite/>
48+
<compile-dependency/>
49+
<run-dependency>
50+
<release-version>2</release-version>
51+
<specification-version>1.32</specification-version>
52+
</run-dependency>
53+
</dependency>
54+
<dependency>
55+
<code-name-base>org.netbeans.modules.csl.api</code-name-base>
56+
<build-prerequisite/>
57+
<compile-dependency/>
58+
<run-dependency>
59+
<release-version>2</release-version>
60+
<specification-version>2.89</specification-version>
61+
</run-dependency>
62+
</dependency>
63+
<dependency>
64+
<code-name-base>org.netbeans.modules.csl.types</code-name-base>
65+
<build-prerequisite/>
66+
<compile-dependency/>
67+
<run-dependency>
68+
<release-version>1</release-version>
69+
<specification-version>1.31</specification-version>
70+
</run-dependency>
71+
</dependency>
72+
<dependency>
73+
<code-name-base>org.netbeans.modules.lexer</code-name-base>
74+
<build-prerequisite/>
75+
<compile-dependency/>
76+
<run-dependency>
77+
<release-version>2</release-version>
78+
<specification-version>1.94</specification-version>
79+
</run-dependency>
80+
</dependency>
81+
<dependency>
82+
<code-name-base>org.netbeans.modules.lexer.antlr4</code-name-base>
83+
<build-prerequisite/>
84+
<compile-dependency/>
85+
<run-dependency>
86+
<specification-version>1.13</specification-version>
87+
</run-dependency>
88+
</dependency>
89+
<dependency>
90+
<code-name-base>org.netbeans.modules.parsing.api</code-name-base>
91+
<build-prerequisite/>
92+
<compile-dependency/>
93+
<run-dependency>
94+
<release-version>1</release-version>
95+
<specification-version>9.38</specification-version>
96+
</run-dependency>
97+
</dependency>
98+
<dependency>
99+
<code-name-base>org.openide.awt</code-name-base>
100+
<build-prerequisite/>
101+
<compile-dependency/>
102+
<run-dependency>
103+
<specification-version>7.99</specification-version>
104+
</run-dependency>
105+
</dependency>
106+
<dependency>
107+
<code-name-base>org.openide.filesystems</code-name-base>
108+
<build-prerequisite/>
109+
<compile-dependency/>
110+
<run-dependency>
111+
<specification-version>9.44</specification-version>
112+
</run-dependency>
113+
</dependency>
114+
<dependency>
115+
<code-name-base>org.openide.util</code-name-base>
116+
<build-prerequisite/>
117+
<compile-dependency/>
118+
<run-dependency>
119+
<specification-version>9.39</specification-version>
120+
</run-dependency>
121+
</dependency>
122+
<dependency>
123+
<code-name-base>org.openide.util.lookup</code-name-base>
124+
<build-prerequisite/>
125+
<compile-dependency/>
126+
<run-dependency>
127+
<specification-version>8.65</specification-version>
128+
</run-dependency>
129+
</dependency>
130+
<dependency>
131+
<code-name-base>org.openide.windows</code-name-base>
132+
<build-prerequisite/>
133+
<compile-dependency/>
134+
<run-dependency>
135+
<specification-version>6.108</specification-version>
136+
</run-dependency>
137+
</dependency>
138+
</module-dependencies>
139+
<test-dependencies>
140+
<test-type>
141+
<name>unit</name>
142+
<test-dependency>
143+
<code-name-base>org.netbeans.libs.junit4</code-name-base>
144+
<compile-dependency/>
145+
</test-dependency>
146+
<test-dependency>
147+
<code-name-base>org.netbeans.modules.csl.api</code-name-base>
148+
<recursive/>
149+
<compile-dependency/>
150+
<test/>
151+
</test-dependency>
152+
<test-dependency>
153+
<code-name-base>org.netbeans.modules.csl.types</code-name-base>
154+
<recursive/>
155+
<compile-dependency/>
156+
<test/>
157+
</test-dependency>
158+
<test-dependency>
159+
<code-name-base>org.netbeans.modules.lexer</code-name-base>
160+
<recursive/>
161+
<compile-dependency/>
162+
<test/>
163+
</test-dependency>
164+
<test-dependency>
165+
<code-name-base>org.openide.util.lookup</code-name-base>
166+
<recursive/>
167+
<compile-dependency/>
168+
<test/>
169+
</test-dependency>
170+
<test-dependency>
171+
<code-name-base>org.netbeans.modules.nbjunit</code-name-base>
172+
<recursive/>
173+
<compile-dependency/>
174+
</test-dependency>
175+
</test-type>
176+
</test-dependencies>
177+
<public-packages/>
178+
</data>
179+
</configuration>
180+
</project>

0 commit comments

Comments
 (0)