Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
geertjan
committed
Mar 23, 2014
1 parent
c4ac1f5
commit f04bf4d
Showing
23 changed files
with
2,501 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/RNb/nbproject/private/ | ||
/RNb/build/ | ||
/RNb/Options/build/ | ||
/RNb/Execution/build/ | ||
/RNb/Completion/build/ | ||
/RNb/Palette/build/ | ||
/RNb/Navigator/build/ | ||
/RNb/Language/build/ | ||
/RNb/Project/build/ | ||
/RNb/Analyzer/nbproject/private/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- 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="org.netbeans.lexer" default="netbeans" basedir="."> | ||
<description>Builds, tests, and runs the project org.netbeans.lexer.</description> | ||
<import file="nbproject/build-impl.xml"/> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Manifest-Version: 1.0 | ||
OpenIDE-Module: org.netbeans.lexer | ||
OpenIDE-Module-Layer: org/netbeans/lexer/layer.xml | ||
OpenIDE-Module-Localizing-Bundle: org/netbeans/lexer/Bundle.properties | ||
OpenIDE-Module-Specification-Version: 1.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
*** GENERATED FROM project.xml - DO NOT EDIT *** | ||
*** EDIT ../build.xml INSTEAD *** | ||
--> | ||
<project name="org.netbeans.lexer-impl" basedir=".."> | ||
<fail message="Please build using Ant 1.7.1 or higher."> | ||
<condition> | ||
<not> | ||
<antversion atleast="1.7.1"/> | ||
</not> | ||
</condition> | ||
</fail> | ||
<property file="nbproject/private/suite-private.properties"/> | ||
<property file="nbproject/suite.properties"/> | ||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail> | ||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/> | ||
<property file="${suite.dir}/nbproject/platform.properties"/> | ||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2"> | ||
<attribute name="name"/> | ||
<attribute name="value"/> | ||
<sequential> | ||
<property name="@{name}" value="${@{value}}"/> | ||
</sequential> | ||
</macrodef> | ||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2"> | ||
<attribute name="property"/> | ||
<attribute name="value"/> | ||
<sequential> | ||
<property name="@{property}" value="@{value}"/> | ||
</sequential> | ||
</macrodef> | ||
<property file="${user.properties.file}"/> | ||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness)."> | ||
<condition> | ||
<not> | ||
<contains string="${cluster.path.evaluated}" substring="platform"/> | ||
</not> | ||
</condition> | ||
</fail> | ||
<import file="${harness.dir}/build.xml"/> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
build.xml.data.CRC32=a9c1e28d | ||
build.xml.script.CRC32=4ff1090d | ||
build.xml.stylesheet.CRC32=a56c6a5b@2.56.1 | ||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. | ||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. | ||
nbproject/build-impl.xml.data.CRC32=a9c1e28d | ||
nbproject/build-impl.xml.script.CRC32=f49e8f64 | ||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.56.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
javac.source=1.6 | ||
javac.compilerargs=-Xlint -Xlint:-serial |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://www.netbeans.org/ns/project/1"> | ||
<type>org.netbeans.modules.apisupport.project</type> | ||
<configuration> | ||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3"> | ||
<code-name-base>org.netbeans.lexer</code-name-base> | ||
<suite-component/> | ||
<module-dependencies> | ||
<dependency> | ||
<code-name-base>org.netbeans.libs.antlr3.runtime</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>1.12.1.1</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.netbeans.modules.editor</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<release-version>3</release-version> | ||
<specification-version>1.71.2.5.21.40</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.netbeans.modules.extexecution</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<release-version>2</release-version> | ||
<specification-version>1.36.1</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.netbeans.modules.lexer</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<release-version>2</release-version> | ||
<specification-version>1.49.3.1</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.netbeans.modules.parsing.api</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<release-version>1</release-version> | ||
<specification-version>1.62.2.6</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.netbeans.spi.editor.hints</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<release-version>0-1</release-version> | ||
<specification-version>1.28.3.7.40</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
<dependency> | ||
<code-name-base>org.openide.filesystems</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>8.5.1</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
</module-dependencies> | ||
<public-packages/> | ||
<class-path-extension> | ||
<runtime-relative-path>ext/antlr-4.0-complete.jar</runtime-relative-path> | ||
<binary-origin>release/modules/ext/antlr-4.0-complete.jar</binary-origin> | ||
</class-path-extension> | ||
</data> | ||
</configuration> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
suite.dir=${basedir}/.. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
package org.netbeans.lexer; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.antlr.v4.runtime.CharStream; | ||
import org.antlr.v4.runtime.misc.Interval; | ||
import org.netbeans.spi.lexer.LexerInput; | ||
|
||
public class AntlrCharStream implements CharStream { | ||
|
||
private class CharStreamState { | ||
|
||
int index; | ||
int line; | ||
int charPositionInLine; | ||
} | ||
|
||
private int line = 1; | ||
private int charPositionInLine = 0; | ||
private LexerInput input; | ||
private String name; | ||
private int index = 0; | ||
private List<CharStreamState> markers; | ||
private int markDepth = 0; | ||
private int lastMarker; | ||
private boolean ignoreCase = false; | ||
|
||
public AntlrCharStream(LexerInput input, String name) { | ||
this.input = input; | ||
this.name = name; | ||
} | ||
|
||
public AntlrCharStream(LexerInput input, String name, boolean ignoreCase) { | ||
this.input = input; | ||
this.name = name; | ||
this.ignoreCase = ignoreCase; | ||
} | ||
|
||
public String substring(int start, int stop) { | ||
return input.readText(start, stop).toString(); | ||
} | ||
|
||
@Override | ||
public String getText(Interval intrvl) { | ||
return null; | ||
} | ||
|
||
public int LT(int i) { | ||
return LA(i); | ||
} | ||
|
||
public int getLine() { | ||
return line; | ||
} | ||
|
||
public void setLine(int line) { | ||
this.line = line; | ||
} | ||
|
||
public void setCharPositionInLine(int pos) { | ||
this.charPositionInLine = pos; | ||
} | ||
|
||
public int getCharPositionInLine() { | ||
return charPositionInLine; | ||
} | ||
|
||
@Override | ||
public void consume() { | ||
int c = input.read(); | ||
index++; | ||
charPositionInLine++; | ||
|
||
if (c == '\n') { | ||
line++; | ||
charPositionInLine = 0; | ||
} | ||
} | ||
|
||
@Override | ||
public int LA(int i) { | ||
if (i == 0) { | ||
return 0; // undefined | ||
} | ||
|
||
int c = 0; | ||
for (int j = 0; j < i; j++) { | ||
c = read(); | ||
} | ||
backup(i); | ||
return c; | ||
} | ||
|
||
@Override | ||
public int mark() { | ||
if (markers == null) { | ||
markers = new ArrayList<CharStreamState>(); | ||
markers.add(null); // depth 0 means no backtracking, leave blank | ||
} | ||
markDepth++; | ||
CharStreamState state = null; | ||
if (markDepth >= markers.size()) { | ||
state = new CharStreamState(); | ||
markers.add(state); | ||
} else { | ||
state = markers.get(markDepth); | ||
} | ||
state.index = index; | ||
state.line = line; | ||
state.charPositionInLine = charPositionInLine; | ||
lastMarker = markDepth; | ||
|
||
return markDepth; | ||
} | ||
|
||
@Override | ||
public void release(int i) { | ||
markDepth = i; | ||
markDepth--; | ||
} | ||
|
||
@Override | ||
public int index() { | ||
return index; | ||
} | ||
|
||
@Override | ||
public void seek(int i) { | ||
if (index < this.index) { | ||
backup(this.index - index); | ||
this.index = index; // just jump; don't update stream state (line, ...) | ||
return; | ||
} | ||
|
||
// seek forward, consume until p hits index | ||
while (this.index < index) { | ||
consume(); | ||
} | ||
} | ||
|
||
@Override | ||
public int size() { | ||
return -1; | ||
} | ||
|
||
@Override | ||
public String getSourceName() { | ||
return name; | ||
} | ||
|
||
private int read() { | ||
int result = input.read(); | ||
if (result == LexerInput.EOF) { | ||
result = CharStream.EOF; | ||
} | ||
|
||
return result; | ||
} | ||
|
||
private void backup(int count) { | ||
input.backup(count); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
OpenIDE-Module-Name=Analyser | ||
text/x-r=R | ||
identifier=Identifier | ||
keyword=Keyword | ||
type=Type | ||
whitespace=Whitespace | ||
string=String | ||
operator=Operator | ||
number=Number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE fontscolors PUBLIC "-//NetBeans//DTD Editor Fonts and Colors settings 1.1//EN" "http://www.netbeans.org/dtds/EditorFontsColors-1_1.dtd"> | ||
|
||
<!-- | ||
To change this license header, choose License Headers in Project Properties. | ||
To change this template file, choose Tools | Templates | ||
and open the template in the editor. | ||
--> | ||
<fontscolors> | ||
<fontcolor name="identifier" default="identifier"/> | ||
<fontcolor name="keyword" default="keyword"/> | ||
<fontcolor name="whitespace" default="whitespace"/> | ||
<fontcolor name="type" default="type"/> | ||
<fontcolor name="operator" default="operator"/> | ||
<fontcolor name="string" default="string"/> | ||
<fontcolor name="number" default="number"/> | ||
</fontscolors> | ||
|
Oops, something went wrong.