From 1bfd7f92393cdacac3232ef3fd112e017c75ee48 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 30 Mar 2024 13:45:12 +0100 Subject: [PATCH] Generate Java Sources from JSON grammars pre-compile --- .gitignore | 3 + .../editor/formatter/JsonFormatVisitor.java | 4 +- webcommon/javascript2.json/build.xml | 2 +- .../org-netbeans-modules-javascript2-json.sig | 18 +- .../json/parser/JsonBaseListener.java | 14 +- .../json/parser/JsonBaseVisitor.java | 13 +- .../javascript2/json/parser/JsonLexer.java | 422 ------------- .../javascript2/json/parser/JsonListener.java | 28 - .../javascript2/json/parser/JsonParser.java | 583 ------------------ .../json/parser/JsonParserBaseListener.java | 132 ---- .../json/parser/JsonParserBaseVisitor.java | 77 --- .../json/parser/JsonParserListener.java | 90 --- .../json/parser/JsonParserVisitor.java | 69 --- .../javascript2/json/parser/JsonVisitor.java | 31 - .../json/parser/ParseTreeToXml.java | 2 +- .../javascript2.json/tools/JsonParser.g4 | 2 +- .../javascript2/model/JsonModelResolver.java | 6 +- 17 files changed, 32 insertions(+), 1464 deletions(-) delete mode 100644 webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonLexer.java delete mode 100644 webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonListener.java delete mode 100644 webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParser.java delete mode 100644 webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserBaseListener.java delete mode 100644 webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserBaseVisitor.java delete mode 100644 webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserListener.java delete mode 100644 webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserVisitor.java delete mode 100644 webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonVisitor.java diff --git a/.gitignore b/.gitignore index 85bf3d7476ad..6045e2589e5a 100644 --- a/.gitignore +++ b/.gitignore @@ -113,5 +113,8 @@ derby.log /ide/go.lang/src/org/antlr/parser/golang/Go*.java /ide/languages.hcl/src/org/netbeans/modules/languages/hcl/grammar/*.java /java/languages.antlr/src/org/antlr/parser/*/ANTLR*.java + +/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/Json*.java + # idea .idea diff --git a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/formatter/JsonFormatVisitor.java b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/formatter/JsonFormatVisitor.java index 2cd3de01c324..2e4fa54902e0 100644 --- a/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/formatter/JsonFormatVisitor.java +++ b/webcommon/javascript2.editor/src/org/netbeans/modules/javascript2/editor/formatter/JsonFormatVisitor.java @@ -22,17 +22,17 @@ import java.util.List; import org.antlr.v4.runtime.ParserRuleContext; import org.netbeans.api.lexer.TokenSequence; -import org.netbeans.modules.javascript2.json.parser.JsonBaseVisitor; import org.netbeans.modules.javascript2.json.parser.JsonParser; import org.netbeans.modules.javascript2.lexer.api.JsTokenId; import static org.netbeans.modules.javascript2.editor.formatter.TokenUtils.*; +import org.netbeans.modules.javascript2.json.parser.JsonParserBaseVisitor; /** * * @author Dusan Balek */ -public class JsonFormatVisitor extends JsonBaseVisitor { +public class JsonFormatVisitor extends JsonParserBaseVisitor { private final TokenUtils tokenUtils; diff --git a/webcommon/javascript2.json/build.xml b/webcommon/javascript2.json/build.xml index 86ebe6c8ff6b..8a8f21471ea1 100644 --- a/webcommon/javascript2.json/build.xml +++ b/webcommon/javascript2.json/build.xml @@ -23,7 +23,7 @@ Builds, tests, and runs the project org.netbeans.modules.javascript2.json - + diff --git a/webcommon/javascript2.json/nbproject/org-netbeans-modules-javascript2-json.sig b/webcommon/javascript2.json/nbproject/org-netbeans-modules-javascript2-json.sig index 78a10aa02063..4aecb98bd126 100644 --- a/webcommon/javascript2.json/nbproject/org-netbeans-modules-javascript2-json.sig +++ b/webcommon/javascript2.json/nbproject/org-netbeans-modules-javascript2-json.sig @@ -1,5 +1,5 @@ #Signature file v4.1 -#Version 1.26 +#Version 1.28 CLSS public java.lang.Object cons public init() @@ -333,14 +333,6 @@ meth public void removePropertyChangeListener(java.beans.PropertyChangeListener) supr java.lang.Object hfds delegates,listeners,listens,pcl -CLSS public org.netbeans.modules.javascript2.json.parser.JsonBaseListener -cons public init() -supr org.netbeans.modules.javascript2.json.parser.JsonParserBaseListener - -CLSS public org.netbeans.modules.javascript2.json.parser.JsonBaseVisitor<%0 extends java.lang.Object> -cons public init() -supr org.netbeans.modules.javascript2.json.parser.JsonParserBaseVisitor<{org.netbeans.modules.javascript2.json.parser.JsonBaseVisitor%0}> - CLSS public org.netbeans.modules.javascript2.json.parser.JsonLexer cons public init(org.antlr.v4.runtime.CharStream) cons public init(org.antlr.v4.runtime.CharStream,boolean) @@ -402,9 +394,6 @@ meth public int hashCode() supr java.lang.Object hfds atnState -CLSS public abstract interface org.netbeans.modules.javascript2.json.parser.JsonListener -intf org.netbeans.modules.javascript2.json.parser.JsonParserListener - CLSS public org.netbeans.modules.javascript2.json.parser.JsonParser cons public init(org.antlr.v4.runtime.TokenStream) fld protected final static org.antlr.v4.runtime.atn.PredictionContextCache _sharedContextCache @@ -597,9 +586,6 @@ meth public abstract {org.netbeans.modules.javascript2.json.parser.JsonParserVis meth public abstract {org.netbeans.modules.javascript2.json.parser.JsonParserVisitor%0} visitPair(org.netbeans.modules.javascript2.json.parser.JsonParser$PairContext) meth public abstract {org.netbeans.modules.javascript2.json.parser.JsonParserVisitor%0} visitValue(org.netbeans.modules.javascript2.json.parser.JsonParser$ValueContext) -CLSS public abstract interface org.netbeans.modules.javascript2.json.parser.JsonVisitor<%0 extends java.lang.Object> -intf org.netbeans.modules.javascript2.json.parser.JsonParserVisitor<{org.netbeans.modules.javascript2.json.parser.JsonVisitor%0}> - CLSS public org.netbeans.modules.javascript2.json.parser.ParseTreeToXml cons public init(org.netbeans.modules.javascript2.json.parser.JsonLexer,org.netbeans.modules.javascript2.json.parser.JsonParser) anno 1 org.netbeans.api.annotations.common.NonNull() @@ -614,7 +600,7 @@ meth public org.w3c.dom.Document visitValue(org.netbeans.modules.javascript2.jso meth public static java.lang.String stringify(org.w3c.dom.Document) throws java.io.IOException anno 0 org.netbeans.api.annotations.common.NonNull() anno 1 org.netbeans.api.annotations.common.NonNull() -supr org.netbeans.modules.javascript2.json.parser.JsonBaseVisitor +supr org.netbeans.modules.javascript2.json.parser.JsonParserBaseVisitor hfds currentNode,doc,lexer,parser CLSS public abstract interface org.netbeans.modules.javascript2.json.spi.JsonOptionsQueryImplementation diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonBaseListener.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonBaseListener.java index 83cd35625960..c9e24be40ddd 100644 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonBaseListener.java +++ b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonBaseListener.java @@ -21,10 +21,16 @@ package org.netbeans.modules.javascript2.json.parser; /** - * This class provides an empty implementation of {@link JsonListener}, - * which can be extended to create a listener which only needs to handle a subset - * of the available methods. + * This class provides an empty implementation of {@link JsonListener}, which + * can be extended to create a listener which only needs to handle a subset of + * the available methods. + * + * @deprecated This class is deprecated since Antlr4.13.1. Use + * JsonParserBaseListener instead. + * @see JsonParserBaseListener + * */ +@Deprecated @SuppressWarnings("CheckReturnValue") public class JsonBaseListener extends JsonParserBaseListener { -} \ No newline at end of file +} diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonBaseVisitor.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonBaseVisitor.java index 749fc7fab667..9a5e37d6b173 100644 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonBaseVisitor.java +++ b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonBaseVisitor.java @@ -21,13 +21,18 @@ package org.netbeans.modules.javascript2.json.parser; /** - * This class provides an empty implementation of {@link JsonVisitor}, - * which can be extended to create a visitor which only needs to handle a subset - * of the available methods. + * This class provides an empty implementation of {@link JsonVisitor}, which can + * be extended to create a visitor which only needs to handle a subset of the + * available methods. + * * * @param The return type of the visit operation. Use {@link Void} for * operations with no return type. + * @deprecated This class is deprecated since Antlr4.13.1. Use + * JsonParserBaseVisitor instead. + * @see JsonParserBaseVisitor */ +@Deprecated @SuppressWarnings("CheckReturnValue") public class JsonBaseVisitor extends JsonParserBaseVisitor { -} \ No newline at end of file +} diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonLexer.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonLexer.java deleted file mode 100644 index b16df8e69ef5..000000000000 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonLexer.java +++ /dev/null @@ -1,422 +0,0 @@ -// Generated from java-escape by ANTLR 4.11.1 - -/* - * 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. - */ -package org.netbeans.modules.javascript2.json.parser; - -import org.antlr.v4.runtime.Lexer; -import org.antlr.v4.runtime.CharStream; -import org.antlr.v4.runtime.Token; -import org.antlr.v4.runtime.TokenStream; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.misc.*; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue"}) -public class JsonLexer extends Lexer { - static { RuntimeMetaData.checkVersion("4.11.1", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - COLON=1, COMMA=2, DOT=3, PLUS=4, MINUS=5, LBRACE=6, RBRACE=7, LBRACKET=8, - RBRACKET=9, TRUE=10, FALSE=11, NULL=12, NUMBER=13, STRING=14, LINE_COMMENT=15, - COMMENT=16, WS=17, ERROR_COMMENT=18, ERROR=19; - public static final int - WHITESPACES=2, COMMENTS=3, ERRORS=4; - public static String[] channelNames = { - "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "WHITESPACES", "COMMENTS", "ERRORS" - }; - - public static String[] modeNames = { - "DEFAULT_MODE" - }; - - private static String[] makeRuleNames() { - return new String[] { - "COLON", "COMMA", "DOT", "PLUS", "MINUS", "LBRACE", "RBRACE", "LBRACKET", - "RBRACKET", "TRUE", "FALSE", "NULL", "NUMBER", "INTEGER", "DIGIT_0", - "DIGIT_19", "DIGIT", "FRACTION", "EXPONENT", "STRING", "QUOTE", "CHAR", - "CONTROL", "UNICODE", "HEXDIGIT", "LINE_COMMENT", "COMMENT", "WS", "ERROR_COMMENT", - "ERROR" - }; - } - public static final String[] ruleNames = makeRuleNames(); - - private static String[] makeLiteralNames() { - return new String[] { - null, "':'", "','", "'.'", "'+'", "'-'", "'{'", "'}'", "'['", "']'", - "'true'", "'false'", "'null'" - }; - } - private static final String[] _LITERAL_NAMES = makeLiteralNames(); - private static String[] makeSymbolicNames() { - return new String[] { - null, "COLON", "COMMA", "DOT", "PLUS", "MINUS", "LBRACE", "RBRACE", "LBRACKET", - "RBRACKET", "TRUE", "FALSE", "NULL", "NUMBER", "STRING", "LINE_COMMENT", - "COMMENT", "WS", "ERROR_COMMENT", "ERROR" - }; - } - private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } - - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - - private static final Recovery[] RECOVERIES = { - Recovery.createLineCommentRecovery(), - Recovery.createCommentRecovery(), - Recovery.createStringRecovery() - }; - - private boolean isCommentSupported; - private boolean hasErrorToken; - - public LexerState getLexerState() { - return new LexerState(getState()); - } - - public void setLexerState(LexerState state) { - this.setState(state.atnState); - } - - public static final class LexerState { - - final int atnState; - - public LexerState(int atnState) { - this.atnState = atnState; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final LexerState other = (LexerState) obj; - if (this.atnState != other.atnState) { - return false; - } - return true; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 29 * hash + this.atnState; - return hash; - } - } - - public JsonLexer( - final CharStream input, - final boolean isCommentSupported) { - this(input, isCommentSupported, false); - } - - public JsonLexer( - final CharStream input, - final boolean isCommentSupported, - final boolean hasErrorToken) { - this(input); - this.isCommentSupported = isCommentSupported; - this.hasErrorToken = hasErrorToken; - } - - @Override - public void recover(LexerNoViableAltException e) { - final CharStream in = e.getInputStream(); - final int current = in.index(); - final int index = e.getStartIndex(); - boolean resolved = false; - in.seek(index); - for (Recovery r : RECOVERIES) { - if (r.canRecover(in)) { - getInterpreter().setCharPositionInLine(_tokenStartCharPositionInLine); - getInterpreter().setLine(_tokenStartLine); - r.recover(in, getInterpreter()); - resolved = true; - break; - } - } - if (!resolved) { - in.seek(current); - super.recover(e); - } - } - - - public JsonLexer(CharStream input) { - super(input); - _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @Override - public String getGrammarFileName() { return "JsonLexer.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public String[] getChannelNames() { return channelNames; } - - @Override - public String[] getModeNames() { return modeNames; } - - @Override - public ATN getATN() { return _ATN; } - - @Override - public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { - switch (ruleIndex) { - case 25: - return LINE_COMMENT_sempred((RuleContext)_localctx, predIndex); - case 26: - return COMMENT_sempred((RuleContext)_localctx, predIndex); - case 28: - return ERROR_COMMENT_sempred((RuleContext)_localctx, predIndex); - case 29: - return ERROR_sempred((RuleContext)_localctx, predIndex); - } - return true; - } - private boolean LINE_COMMENT_sempred(RuleContext _localctx, int predIndex) { - switch (predIndex) { - case 0: - return isCommentSupported; - } - return true; - } - private boolean COMMENT_sempred(RuleContext _localctx, int predIndex) { - switch (predIndex) { - case 1: - return isCommentSupported; - } - return true; - } - private boolean ERROR_COMMENT_sempred(RuleContext _localctx, int predIndex) { - switch (predIndex) { - case 2: - return hasErrorToken && isCommentSupported; - } - return true; - } - private boolean ERROR_sempred(RuleContext _localctx, int predIndex) { - switch (predIndex) { - case 3: - return hasErrorToken; - } - return true; - } - - public static final String _serializedATN = - "\u0004\u0000\u0013\u00e7\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002"+ - "\u0001\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002"+ - "\u0004\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002"+ - "\u0007\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002"+ - "\u000b\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e"+ - "\u0002\u000f\u0007\u000f\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011"+ - "\u0002\u0012\u0007\u0012\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014"+ - "\u0002\u0015\u0007\u0015\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017"+ - "\u0002\u0018\u0007\u0018\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a"+ - "\u0002\u001b\u0007\u001b\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d"+ - "\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0002\u0001\u0002"+ - "\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001\u0005\u0001\u0005"+ - "\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001"+ - "\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\n\u0001\n\u0001\n\u0001\n\u0001"+ - "\n\u0001\n\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b"+ - "\u0001\f\u0001\f\u0003\fb\b\f\u0001\f\u0003\fe\b\f\u0001\r\u0003\rh\b"+ - "\r\u0001\r\u0001\r\u0001\r\u0005\rm\b\r\n\r\f\rp\t\r\u0003\rr\b\r\u0001"+ - "\u000e\u0001\u000e\u0001\u000f\u0001\u000f\u0001\u0010\u0001\u0010\u0003"+ - "\u0010z\b\u0010\u0001\u0011\u0001\u0011\u0004\u0011~\b\u0011\u000b\u0011"+ - "\f\u0011\u007f\u0001\u0012\u0001\u0012\u0001\u0012\u0003\u0012\u0085\b"+ - "\u0012\u0001\u0012\u0004\u0012\u0088\b\u0012\u000b\u0012\f\u0012\u0089"+ - "\u0001\u0013\u0001\u0013\u0005\u0013\u008e\b\u0013\n\u0013\f\u0013\u0091"+ - "\t\u0013\u0001\u0013\u0001\u0013\u0001\u0014\u0001\u0014\u0001\u0015\u0001"+ - "\u0015\u0003\u0015\u0099\b\u0015\u0001\u0016\u0001\u0016\u0001\u0016\u0003"+ - "\u0016\u009e\b\u0016\u0001\u0017\u0001\u0017\u0001\u0017\u0001\u0017\u0001"+ - "\u0017\u0001\u0017\u0001\u0018\u0001\u0018\u0001\u0019\u0001\u0019\u0001"+ - "\u0019\u0001\u0019\u0005\u0019\u00ac\b\u0019\n\u0019\f\u0019\u00af\t\u0019"+ - "\u0001\u0019\u0003\u0019\u00b2\b\u0019\u0001\u0019\u0001\u0019\u0001\u0019"+ - "\u0001\u0019\u0001\u0019\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001a"+ - "\u0005\u001a\u00bd\b\u001a\n\u001a\f\u001a\u00c0\t\u001a\u0001\u001a\u0001"+ - "\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001a\u0001"+ - "\u001b\u0004\u001b\u00ca\b\u001b\u000b\u001b\f\u001b\u00cb\u0001\u001b"+ - "\u0001\u001b\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c"+ - "\u0004\u001c\u00d5\b\u001c\u000b\u001c\f\u001c\u00d6\u0001\u001c\u0005"+ - "\u001c\u00da\b\u001c\n\u001c\f\u001c\u00dd\t\u001c\u0001\u001c\u0001\u001c"+ - "\u0001\u001c\u0001\u001c\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d"+ - "\u0001\u001d\u0002\u00ad\u00be\u0000\u001e\u0001\u0001\u0003\u0002\u0005"+ - "\u0003\u0007\u0004\t\u0005\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013\n"+ - "\u0015\u000b\u0017\f\u0019\r\u001b\u0000\u001d\u0000\u001f\u0000!\u0000"+ - "#\u0000%\u0000\'\u000e)\u0000+\u0000-\u0000/\u00001\u00003\u000f5\u0010"+ - "7\u00119\u0012;\u0013\u0001\u0000\b\u0001\u000019\u0002\u0000EEee\u0003"+ - "\u0000\u0000\u001f\"\"\\\\\b\u0000\"\"//\\\\bbffnnrrtt\u0003\u000009A"+ - "Faf\u0003\u0000\t\n\r\r \u0001\u0000**\u0001\u0000//\u00ef\u0000\u0001"+ - "\u0001\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005"+ - "\u0001\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001"+ - "\u0000\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000"+ - "\u0000\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000"+ - "\u0000\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000"+ - "\u0000\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000"+ - "\u0000\u0000\u0000\'\u0001\u0000\u0000\u0000\u00003\u0001\u0000\u0000"+ - "\u0000\u00005\u0001\u0000\u0000\u0000\u00007\u0001\u0000\u0000\u0000\u0000"+ - "9\u0001\u0000\u0000\u0000\u0000;\u0001\u0000\u0000\u0000\u0001=\u0001"+ - "\u0000\u0000\u0000\u0003?\u0001\u0000\u0000\u0000\u0005A\u0001\u0000\u0000"+ - "\u0000\u0007C\u0001\u0000\u0000\u0000\tE\u0001\u0000\u0000\u0000\u000b"+ - "G\u0001\u0000\u0000\u0000\rI\u0001\u0000\u0000\u0000\u000fK\u0001\u0000"+ - "\u0000\u0000\u0011M\u0001\u0000\u0000\u0000\u0013O\u0001\u0000\u0000\u0000"+ - "\u0015T\u0001\u0000\u0000\u0000\u0017Z\u0001\u0000\u0000\u0000\u0019_"+ - "\u0001\u0000\u0000\u0000\u001bg\u0001\u0000\u0000\u0000\u001ds\u0001\u0000"+ - "\u0000\u0000\u001fu\u0001\u0000\u0000\u0000!y\u0001\u0000\u0000\u0000"+ - "#{\u0001\u0000\u0000\u0000%\u0081\u0001\u0000\u0000\u0000\'\u008b\u0001"+ - "\u0000\u0000\u0000)\u0094\u0001\u0000\u0000\u0000+\u0098\u0001\u0000\u0000"+ - "\u0000-\u009a\u0001\u0000\u0000\u0000/\u009f\u0001\u0000\u0000\u00001"+ - "\u00a5\u0001\u0000\u0000\u00003\u00a7\u0001\u0000\u0000\u00005\u00b8\u0001"+ - "\u0000\u0000\u00007\u00c9\u0001\u0000\u0000\u00009\u00cf\u0001\u0000\u0000"+ - "\u0000;\u00e2\u0001\u0000\u0000\u0000=>\u0005:\u0000\u0000>\u0002\u0001"+ - "\u0000\u0000\u0000?@\u0005,\u0000\u0000@\u0004\u0001\u0000\u0000\u0000"+ - "AB\u0005.\u0000\u0000B\u0006\u0001\u0000\u0000\u0000CD\u0005+\u0000\u0000"+ - "D\b\u0001\u0000\u0000\u0000EF\u0005-\u0000\u0000F\n\u0001\u0000\u0000"+ - "\u0000GH\u0005{\u0000\u0000H\f\u0001\u0000\u0000\u0000IJ\u0005}\u0000"+ - "\u0000J\u000e\u0001\u0000\u0000\u0000KL\u0005[\u0000\u0000L\u0010\u0001"+ - "\u0000\u0000\u0000MN\u0005]\u0000\u0000N\u0012\u0001\u0000\u0000\u0000"+ - "OP\u0005t\u0000\u0000PQ\u0005r\u0000\u0000QR\u0005u\u0000\u0000RS\u0005"+ - "e\u0000\u0000S\u0014\u0001\u0000\u0000\u0000TU\u0005f\u0000\u0000UV\u0005"+ - "a\u0000\u0000VW\u0005l\u0000\u0000WX\u0005s\u0000\u0000XY\u0005e\u0000"+ - "\u0000Y\u0016\u0001\u0000\u0000\u0000Z[\u0005n\u0000\u0000[\\\u0005u\u0000"+ - "\u0000\\]\u0005l\u0000\u0000]^\u0005l\u0000\u0000^\u0018\u0001\u0000\u0000"+ - "\u0000_a\u0003\u001b\r\u0000`b\u0003#\u0011\u0000a`\u0001\u0000\u0000"+ - "\u0000ab\u0001\u0000\u0000\u0000bd\u0001\u0000\u0000\u0000ce\u0003%\u0012"+ - "\u0000dc\u0001\u0000\u0000\u0000de\u0001\u0000\u0000\u0000e\u001a\u0001"+ - "\u0000\u0000\u0000fh\u0003\t\u0004\u0000gf\u0001\u0000\u0000\u0000gh\u0001"+ - "\u0000\u0000\u0000hq\u0001\u0000\u0000\u0000ir\u0003\u001d\u000e\u0000"+ - "jn\u0003\u001f\u000f\u0000km\u0003!\u0010\u0000lk\u0001\u0000\u0000\u0000"+ - "mp\u0001\u0000\u0000\u0000nl\u0001\u0000\u0000\u0000no\u0001\u0000\u0000"+ - "\u0000or\u0001\u0000\u0000\u0000pn\u0001\u0000\u0000\u0000qi\u0001\u0000"+ - "\u0000\u0000qj\u0001\u0000\u0000\u0000r\u001c\u0001\u0000\u0000\u0000"+ - "st\u00050\u0000\u0000t\u001e\u0001\u0000\u0000\u0000uv\u0007\u0000\u0000"+ - "\u0000v \u0001\u0000\u0000\u0000wz\u0003\u001d\u000e\u0000xz\u0003\u001f"+ - "\u000f\u0000yw\u0001\u0000\u0000\u0000yx\u0001\u0000\u0000\u0000z\"\u0001"+ - "\u0000\u0000\u0000{}\u0003\u0005\u0002\u0000|~\u0003!\u0010\u0000}|\u0001"+ - "\u0000\u0000\u0000~\u007f\u0001\u0000\u0000\u0000\u007f}\u0001\u0000\u0000"+ - "\u0000\u007f\u0080\u0001\u0000\u0000\u0000\u0080$\u0001\u0000\u0000\u0000"+ - "\u0081\u0084\u0007\u0001\u0000\u0000\u0082\u0085\u0003\u0007\u0003\u0000"+ - "\u0083\u0085\u0003\t\u0004\u0000\u0084\u0082\u0001\u0000\u0000\u0000\u0084"+ - "\u0083\u0001\u0000\u0000\u0000\u0084\u0085\u0001\u0000\u0000\u0000\u0085"+ - "\u0087\u0001\u0000\u0000\u0000\u0086\u0088\u0003!\u0010\u0000\u0087\u0086"+ - "\u0001\u0000\u0000\u0000\u0088\u0089\u0001\u0000\u0000\u0000\u0089\u0087"+ - "\u0001\u0000\u0000\u0000\u0089\u008a\u0001\u0000\u0000\u0000\u008a&\u0001"+ - "\u0000\u0000\u0000\u008b\u008f\u0003)\u0014\u0000\u008c\u008e\u0003+\u0015"+ - "\u0000\u008d\u008c\u0001\u0000\u0000\u0000\u008e\u0091\u0001\u0000\u0000"+ - "\u0000\u008f\u008d\u0001\u0000\u0000\u0000\u008f\u0090\u0001\u0000\u0000"+ - "\u0000\u0090\u0092\u0001\u0000\u0000\u0000\u0091\u008f\u0001\u0000\u0000"+ - "\u0000\u0092\u0093\u0003)\u0014\u0000\u0093(\u0001\u0000\u0000\u0000\u0094"+ - "\u0095\u0005\"\u0000\u0000\u0095*\u0001\u0000\u0000\u0000\u0096\u0099"+ - "\b\u0002\u0000\u0000\u0097\u0099\u0003-\u0016\u0000\u0098\u0096\u0001"+ - "\u0000\u0000\u0000\u0098\u0097\u0001\u0000\u0000\u0000\u0099,\u0001\u0000"+ - "\u0000\u0000\u009a\u009d\u0005\\\u0000\u0000\u009b\u009e\u0007\u0003\u0000"+ - "\u0000\u009c\u009e\u0003/\u0017\u0000\u009d\u009b\u0001\u0000\u0000\u0000"+ - "\u009d\u009c\u0001\u0000\u0000\u0000\u009e.\u0001\u0000\u0000\u0000\u009f"+ - "\u00a0\u0005u\u0000\u0000\u00a0\u00a1\u00031\u0018\u0000\u00a1\u00a2\u0003"+ - "1\u0018\u0000\u00a2\u00a3\u00031\u0018\u0000\u00a3\u00a4\u00031\u0018"+ - "\u0000\u00a40\u0001\u0000\u0000\u0000\u00a5\u00a6\u0007\u0004\u0000\u0000"+ - "\u00a62\u0001\u0000\u0000\u0000\u00a7\u00a8\u0005/\u0000\u0000\u00a8\u00a9"+ - "\u0005/\u0000\u0000\u00a9\u00ad\u0001\u0000\u0000\u0000\u00aa\u00ac\t"+ - "\u0000\u0000\u0000\u00ab\u00aa\u0001\u0000\u0000\u0000\u00ac\u00af\u0001"+ - "\u0000\u0000\u0000\u00ad\u00ae\u0001\u0000\u0000\u0000\u00ad\u00ab\u0001"+ - "\u0000\u0000\u0000\u00ae\u00b1\u0001\u0000\u0000\u0000\u00af\u00ad\u0001"+ - "\u0000\u0000\u0000\u00b0\u00b2\u0005\r\u0000\u0000\u00b1\u00b0\u0001\u0000"+ - "\u0000\u0000\u00b1\u00b2\u0001\u0000\u0000\u0000\u00b2\u00b3\u0001\u0000"+ - "\u0000\u0000\u00b3\u00b4\u0005\n\u0000\u0000\u00b4\u00b5\u0004\u0019\u0000"+ - "\u0000\u00b5\u00b6\u0001\u0000\u0000\u0000\u00b6\u00b7\u0006\u0019\u0000"+ - "\u0000\u00b74\u0001\u0000\u0000\u0000\u00b8\u00b9\u0005/\u0000\u0000\u00b9"+ - "\u00ba\u0005*\u0000\u0000\u00ba\u00be\u0001\u0000\u0000\u0000\u00bb\u00bd"+ - "\t\u0000\u0000\u0000\u00bc\u00bb\u0001\u0000\u0000\u0000\u00bd\u00c0\u0001"+ - "\u0000\u0000\u0000\u00be\u00bf\u0001\u0000\u0000\u0000\u00be\u00bc\u0001"+ - "\u0000\u0000\u0000\u00bf\u00c1\u0001\u0000\u0000\u0000\u00c0\u00be\u0001"+ - "\u0000\u0000\u0000\u00c1\u00c2\u0005*\u0000\u0000\u00c2\u00c3\u0005/\u0000"+ - "\u0000\u00c3\u00c4\u0001\u0000\u0000\u0000\u00c4\u00c5\u0004\u001a\u0001"+ - "\u0000\u00c5\u00c6\u0001\u0000\u0000\u0000\u00c6\u00c7\u0006\u001a\u0000"+ - "\u0000\u00c76\u0001\u0000\u0000\u0000\u00c8\u00ca\u0007\u0005\u0000\u0000"+ - "\u00c9\u00c8\u0001\u0000\u0000\u0000\u00ca\u00cb\u0001\u0000\u0000\u0000"+ - "\u00cb\u00c9\u0001\u0000\u0000\u0000\u00cb\u00cc\u0001\u0000\u0000\u0000"+ - "\u00cc\u00cd\u0001\u0000\u0000\u0000\u00cd\u00ce\u0006\u001b\u0001\u0000"+ - "\u00ce8\u0001\u0000\u0000\u0000\u00cf\u00d0\u0005/\u0000\u0000\u00d0\u00d1"+ - "\u0005*\u0000\u0000\u00d1\u00db\u0001\u0000\u0000\u0000\u00d2\u00da\b"+ - "\u0006\u0000\u0000\u00d3\u00d5\u0005*\u0000\u0000\u00d4\u00d3\u0001\u0000"+ - "\u0000\u0000\u00d5\u00d6\u0001\u0000\u0000\u0000\u00d6\u00d4\u0001\u0000"+ - "\u0000\u0000\u00d6\u00d7\u0001\u0000\u0000\u0000\u00d7\u00d8\u0001\u0000"+ - "\u0000\u0000\u00d8\u00da\b\u0007\u0000\u0000\u00d9\u00d2\u0001\u0000\u0000"+ - "\u0000\u00d9\u00d4\u0001\u0000\u0000\u0000\u00da\u00dd\u0001\u0000\u0000"+ - "\u0000\u00db\u00d9\u0001\u0000\u0000\u0000\u00db\u00dc\u0001\u0000\u0000"+ - "\u0000\u00dc\u00de\u0001\u0000\u0000\u0000\u00dd\u00db\u0001\u0000\u0000"+ - "\u0000\u00de\u00df\u0004\u001c\u0002\u0000\u00df\u00e0\u0001\u0000\u0000"+ - "\u0000\u00e0\u00e1\u0006\u001c\u0002\u0000\u00e1:\u0001\u0000\u0000\u0000"+ - "\u00e2\u00e3\t\u0000\u0000\u0000\u00e3\u00e4\u0004\u001d\u0003\u0000\u00e4"+ - "\u00e5\u0001\u0000\u0000\u0000\u00e5\u00e6\u0006\u001d\u0002\u0000\u00e6"+ - "<\u0001\u0000\u0000\u0000\u0014\u0000adgnqy\u007f\u0084\u0089\u008f\u0098"+ - "\u009d\u00ad\u00b1\u00be\u00cb\u00d6\u00d9\u00db\u0003\u0000\u0003\u0000"+ - "\u0000\u0002\u0000\u0000\u0004\u0000"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonListener.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonListener.java deleted file mode 100644 index 0bcbc8fd6892..000000000000 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonListener.java +++ /dev/null @@ -1,28 +0,0 @@ -// Generated from java-escape by ANTLR 4.11.1 - -/* - * 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. - */ -package org.netbeans.modules.javascript2.json.parser; - -/** - * This interface defines a complete listener for a parse tree produced by - * {@link Json}. - */ -public interface JsonListener extends JsonParserListener { -} \ No newline at end of file diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParser.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParser.java deleted file mode 100644 index 2397416ec7be..000000000000 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParser.java +++ /dev/null @@ -1,583 +0,0 @@ -// Generated from java-escape by ANTLR 4.11.1 - -/* - * 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. - */ -package org.netbeans.modules.javascript2.json.parser; - -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.misc.*; -import org.antlr.v4.runtime.tree.*; -import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue"}) -public class JsonParser extends Parser { - static { RuntimeMetaData.checkVersion("4.11.1", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - COLON=1, COMMA=2, DOT=3, PLUS=4, MINUS=5, LBRACE=6, RBRACE=7, LBRACKET=8, - RBRACKET=9, TRUE=10, FALSE=11, NULL=12, NUMBER=13, STRING=14, LINE_COMMENT=15, - COMMENT=16, WS=17, ERROR_COMMENT=18, ERROR=19; - public static final int - RULE_json = 0, RULE_value = 1, RULE_object = 2, RULE_pair = 3, RULE_key = 4, - RULE_array = 5; - private static String[] makeRuleNames() { - return new String[] { - "json", "value", "object", "pair", "key", "array" - }; - } - public static final String[] ruleNames = makeRuleNames(); - - private static String[] makeLiteralNames() { - return new String[] { - null, "':'", "','", "'.'", "'+'", "'-'", "'{'", "'}'", "'['", "']'", - "'true'", "'false'", "'null'" - }; - } - private static final String[] _LITERAL_NAMES = makeLiteralNames(); - private static String[] makeSymbolicNames() { - return new String[] { - null, "COLON", "COMMA", "DOT", "PLUS", "MINUS", "LBRACE", "RBRACE", "LBRACKET", - "RBRACKET", "TRUE", "FALSE", "NULL", "NUMBER", "STRING", "LINE_COMMENT", - "COMMENT", "WS", "ERROR_COMMENT", "ERROR" - }; - } - private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } - - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - @Override - public String getGrammarFileName() { return "java-escape"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public ATN getATN() { return _ATN; } - - public JsonParser(TokenStream input) { - super(input); - _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @SuppressWarnings("CheckReturnValue") - public static class JsonContext extends ParserRuleContext { - public TerminalNode EOF() { return getToken(JsonParser.EOF, 0); } - public ValueContext value() { - return getRuleContext(ValueContext.class,0); - } - public JsonContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_json; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).enterJson(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).exitJson(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof JsonParserVisitor ) return ((JsonParserVisitor)visitor).visitJson(this); - else return visitor.visitChildren(this); - } - } - - public final JsonContext json() throws RecognitionException { - JsonContext _localctx = new JsonContext(_ctx, getState()); - enterRule(_localctx, 0, RULE_json); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(13); - _errHandler.sync(this); - _la = _input.LA(1); - if (((_la) & ~0x3f) == 0 && ((1L << _la) & 32064L) != 0) { - { - setState(12); - value(); - } - } - - setState(15); - match(EOF); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ValueContext extends ParserRuleContext { - public TerminalNode STRING() { return getToken(JsonParser.STRING, 0); } - public TerminalNode NUMBER() { return getToken(JsonParser.NUMBER, 0); } - public TerminalNode TRUE() { return getToken(JsonParser.TRUE, 0); } - public TerminalNode FALSE() { return getToken(JsonParser.FALSE, 0); } - public TerminalNode NULL() { return getToken(JsonParser.NULL, 0); } - public ArrayContext array() { - return getRuleContext(ArrayContext.class,0); - } - public ObjectContext object() { - return getRuleContext(ObjectContext.class,0); - } - public ValueContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_value; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).enterValue(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).exitValue(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof JsonParserVisitor ) return ((JsonParserVisitor)visitor).visitValue(this); - else return visitor.visitChildren(this); - } - } - - public final ValueContext value() throws RecognitionException { - ValueContext _localctx = new ValueContext(_ctx, getState()); - enterRule(_localctx, 2, RULE_value); - try { - enterOuterAlt(_localctx, 1); - { - setState(24); - _errHandler.sync(this); - switch (_input.LA(1)) { - case STRING: - { - setState(17); - match(STRING); - } - break; - case NUMBER: - { - setState(18); - match(NUMBER); - } - break; - case TRUE: - { - setState(19); - match(TRUE); - } - break; - case FALSE: - { - setState(20); - match(FALSE); - } - break; - case NULL: - { - setState(21); - match(NULL); - } - break; - case LBRACKET: - { - setState(22); - array(); - } - break; - case LBRACE: - { - setState(23); - object(); - } - break; - default: - throw new NoViableAltException(this); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ObjectContext extends ParserRuleContext { - public TerminalNode LBRACE() { return getToken(JsonParser.LBRACE, 0); } - public TerminalNode RBRACE() { return getToken(JsonParser.RBRACE, 0); } - public List pair() { - return getRuleContexts(PairContext.class); - } - public PairContext pair(int i) { - return getRuleContext(PairContext.class,i); - } - public List COMMA() { return getTokens(JsonParser.COMMA); } - public TerminalNode COMMA(int i) { - return getToken(JsonParser.COMMA, i); - } - public ObjectContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_object; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).enterObject(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).exitObject(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof JsonParserVisitor ) return ((JsonParserVisitor)visitor).visitObject(this); - else return visitor.visitChildren(this); - } - } - - public final ObjectContext object() throws RecognitionException { - ObjectContext _localctx = new ObjectContext(_ctx, getState()); - enterRule(_localctx, 4, RULE_object); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(26); - match(LBRACE); - setState(35); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==STRING) { - { - setState(27); - pair(); - setState(32); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(28); - match(COMMA); - setState(29); - pair(); - } - } - setState(34); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - - setState(37); - match(RBRACE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class PairContext extends ParserRuleContext { - public KeyContext key() { - return getRuleContext(KeyContext.class,0); - } - public TerminalNode COLON() { return getToken(JsonParser.COLON, 0); } - public ValueContext value() { - return getRuleContext(ValueContext.class,0); - } - public PairContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_pair; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).enterPair(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).exitPair(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof JsonParserVisitor ) return ((JsonParserVisitor)visitor).visitPair(this); - else return visitor.visitChildren(this); - } - } - - public final PairContext pair() throws RecognitionException { - PairContext _localctx = new PairContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_pair); - try { - enterOuterAlt(_localctx, 1); - { - setState(39); - key(); - setState(40); - match(COLON); - setState(41); - value(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class KeyContext extends ParserRuleContext { - public TerminalNode STRING() { return getToken(JsonParser.STRING, 0); } - public KeyContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_key; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).enterKey(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).exitKey(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof JsonParserVisitor ) return ((JsonParserVisitor)visitor).visitKey(this); - else return visitor.visitChildren(this); - } - } - - public final KeyContext key() throws RecognitionException { - KeyContext _localctx = new KeyContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_key); - try { - enterOuterAlt(_localctx, 1); - { - setState(43); - match(STRING); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ArrayContext extends ParserRuleContext { - public TerminalNode LBRACKET() { return getToken(JsonParser.LBRACKET, 0); } - public TerminalNode RBRACKET() { return getToken(JsonParser.RBRACKET, 0); } - public List value() { - return getRuleContexts(ValueContext.class); - } - public ValueContext value(int i) { - return getRuleContext(ValueContext.class,i); - } - public List COMMA() { return getTokens(JsonParser.COMMA); } - public TerminalNode COMMA(int i) { - return getToken(JsonParser.COMMA, i); - } - public ArrayContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_array; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).enterArray(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof JsonParserListener ) ((JsonParserListener)listener).exitArray(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof JsonParserVisitor ) return ((JsonParserVisitor)visitor).visitArray(this); - else return visitor.visitChildren(this); - } - } - - public final ArrayContext array() throws RecognitionException { - ArrayContext _localctx = new ArrayContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_array); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(45); - match(LBRACKET); - setState(54); - _errHandler.sync(this); - _la = _input.LA(1); - if (((_la) & ~0x3f) == 0 && ((1L << _la) & 32064L) != 0) { - { - setState(46); - value(); - setState(51); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(47); - match(COMMA); - setState(48); - value(); - } - } - setState(53); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - - setState(56); - match(RBRACKET); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static final String _serializedATN = - "\u0004\u0001\u0013;\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ - "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ - "\u0005\u0007\u0005\u0001\u0000\u0003\u0000\u000e\b\u0000\u0001\u0000\u0001"+ - "\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+ - "\u0001\u0001\u0001\u0003\u0001\u0019\b\u0001\u0001\u0002\u0001\u0002\u0001"+ - "\u0002\u0001\u0002\u0005\u0002\u001f\b\u0002\n\u0002\f\u0002\"\t\u0002"+ - "\u0003\u0002$\b\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003"+ - "\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001\u0005\u0001\u0005"+ - "\u0001\u0005\u0001\u0005\u0005\u00052\b\u0005\n\u0005\f\u00055\t\u0005"+ - "\u0003\u00057\b\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0000\u0000"+ - "\u0006\u0000\u0002\u0004\u0006\b\n\u0000\u0000?\u0000\r\u0001\u0000\u0000"+ - "\u0000\u0002\u0018\u0001\u0000\u0000\u0000\u0004\u001a\u0001\u0000\u0000"+ - "\u0000\u0006\'\u0001\u0000\u0000\u0000\b+\u0001\u0000\u0000\u0000\n-\u0001"+ - "\u0000\u0000\u0000\f\u000e\u0003\u0002\u0001\u0000\r\f\u0001\u0000\u0000"+ - "\u0000\r\u000e\u0001\u0000\u0000\u0000\u000e\u000f\u0001\u0000\u0000\u0000"+ - "\u000f\u0010\u0005\u0000\u0000\u0001\u0010\u0001\u0001\u0000\u0000\u0000"+ - "\u0011\u0019\u0005\u000e\u0000\u0000\u0012\u0019\u0005\r\u0000\u0000\u0013"+ - "\u0019\u0005\n\u0000\u0000\u0014\u0019\u0005\u000b\u0000\u0000\u0015\u0019"+ - "\u0005\f\u0000\u0000\u0016\u0019\u0003\n\u0005\u0000\u0017\u0019\u0003"+ - "\u0004\u0002\u0000\u0018\u0011\u0001\u0000\u0000\u0000\u0018\u0012\u0001"+ - "\u0000\u0000\u0000\u0018\u0013\u0001\u0000\u0000\u0000\u0018\u0014\u0001"+ - "\u0000\u0000\u0000\u0018\u0015\u0001\u0000\u0000\u0000\u0018\u0016\u0001"+ - "\u0000\u0000\u0000\u0018\u0017\u0001\u0000\u0000\u0000\u0019\u0003\u0001"+ - "\u0000\u0000\u0000\u001a#\u0005\u0006\u0000\u0000\u001b \u0003\u0006\u0003"+ - "\u0000\u001c\u001d\u0005\u0002\u0000\u0000\u001d\u001f\u0003\u0006\u0003"+ - "\u0000\u001e\u001c\u0001\u0000\u0000\u0000\u001f\"\u0001\u0000\u0000\u0000"+ - " \u001e\u0001\u0000\u0000\u0000 !\u0001\u0000\u0000\u0000!$\u0001\u0000"+ - "\u0000\u0000\" \u0001\u0000\u0000\u0000#\u001b\u0001\u0000\u0000\u0000"+ - "#$\u0001\u0000\u0000\u0000$%\u0001\u0000\u0000\u0000%&\u0005\u0007\u0000"+ - "\u0000&\u0005\u0001\u0000\u0000\u0000\'(\u0003\b\u0004\u0000()\u0005\u0001"+ - "\u0000\u0000)*\u0003\u0002\u0001\u0000*\u0007\u0001\u0000\u0000\u0000"+ - "+,\u0005\u000e\u0000\u0000,\t\u0001\u0000\u0000\u0000-6\u0005\b\u0000"+ - "\u0000.3\u0003\u0002\u0001\u0000/0\u0005\u0002\u0000\u000002\u0003\u0002"+ - "\u0001\u00001/\u0001\u0000\u0000\u000025\u0001\u0000\u0000\u000031\u0001"+ - "\u0000\u0000\u000034\u0001\u0000\u0000\u000047\u0001\u0000\u0000\u0000"+ - "53\u0001\u0000\u0000\u00006.\u0001\u0000\u0000\u000067\u0001\u0000\u0000"+ - "\u000078\u0001\u0000\u0000\u000089\u0005\t\u0000\u00009\u000b\u0001\u0000"+ - "\u0000\u0000\u0006\r\u0018 #36"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserBaseListener.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserBaseListener.java deleted file mode 100644 index a69bed02ffff..000000000000 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserBaseListener.java +++ /dev/null @@ -1,132 +0,0 @@ -// Generated from java-escape by ANTLR 4.11.1 - -/* - * 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. - */ -package org.netbeans.modules.javascript2.json.parser; - - -import org.antlr.v4.runtime.ParserRuleContext; -import org.antlr.v4.runtime.tree.ErrorNode; -import org.antlr.v4.runtime.tree.TerminalNode; - -/** - * This class provides an empty implementation of {@link JsonParserListener}, - * which can be extended to create a listener which only needs to handle a subset - * of the available methods. - */ -@SuppressWarnings("CheckReturnValue") -public class JsonParserBaseListener implements JsonParserListener { - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterJson(JsonParser.JsonContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitJson(JsonParser.JsonContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterValue(JsonParser.ValueContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitValue(JsonParser.ValueContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterObject(JsonParser.ObjectContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitObject(JsonParser.ObjectContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterPair(JsonParser.PairContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitPair(JsonParser.PairContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterKey(JsonParser.KeyContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitKey(JsonParser.KeyContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterArray(JsonParser.ArrayContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitArray(JsonParser.ArrayContext ctx) { } - - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterEveryRule(ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitEveryRule(ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void visitTerminal(TerminalNode node) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void visitErrorNode(ErrorNode node) { } -} \ No newline at end of file diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserBaseVisitor.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserBaseVisitor.java deleted file mode 100644 index 8210bd8c648f..000000000000 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserBaseVisitor.java +++ /dev/null @@ -1,77 +0,0 @@ -// Generated from java-escape by ANTLR 4.11.1 - -/* - * 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. - */ -package org.netbeans.modules.javascript2.json.parser; - -import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; - -/** - * This class provides an empty implementation of {@link JsonParserVisitor}, - * which can be extended to create a visitor which only needs to handle a subset - * of the available methods. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -@SuppressWarnings("CheckReturnValue") -public class JsonParserBaseVisitor extends AbstractParseTreeVisitor implements JsonParserVisitor { - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitJson(JsonParser.JsonContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitValue(JsonParser.ValueContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitObject(JsonParser.ObjectContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitPair(JsonParser.PairContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitKey(JsonParser.KeyContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitArray(JsonParser.ArrayContext ctx) { return visitChildren(ctx); } -} \ No newline at end of file diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserListener.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserListener.java deleted file mode 100644 index c60d40c645ff..000000000000 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserListener.java +++ /dev/null @@ -1,90 +0,0 @@ -// Generated from java-escape by ANTLR 4.11.1 - -/* - * 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. - */ -package org.netbeans.modules.javascript2.json.parser; - -import org.antlr.v4.runtime.tree.ParseTreeListener; - -/** - * This interface defines a complete listener for a parse tree produced by - * {@link JsonParser}. - */ -public interface JsonParserListener extends ParseTreeListener { - /** - * Enter a parse tree produced by {@link JsonParser#json}. - * @param ctx the parse tree - */ - void enterJson(JsonParser.JsonContext ctx); - /** - * Exit a parse tree produced by {@link JsonParser#json}. - * @param ctx the parse tree - */ - void exitJson(JsonParser.JsonContext ctx); - /** - * Enter a parse tree produced by {@link JsonParser#value}. - * @param ctx the parse tree - */ - void enterValue(JsonParser.ValueContext ctx); - /** - * Exit a parse tree produced by {@link JsonParser#value}. - * @param ctx the parse tree - */ - void exitValue(JsonParser.ValueContext ctx); - /** - * Enter a parse tree produced by {@link JsonParser#object}. - * @param ctx the parse tree - */ - void enterObject(JsonParser.ObjectContext ctx); - /** - * Exit a parse tree produced by {@link JsonParser#object}. - * @param ctx the parse tree - */ - void exitObject(JsonParser.ObjectContext ctx); - /** - * Enter a parse tree produced by {@link JsonParser#pair}. - * @param ctx the parse tree - */ - void enterPair(JsonParser.PairContext ctx); - /** - * Exit a parse tree produced by {@link JsonParser#pair}. - * @param ctx the parse tree - */ - void exitPair(JsonParser.PairContext ctx); - /** - * Enter a parse tree produced by {@link JsonParser#key}. - * @param ctx the parse tree - */ - void enterKey(JsonParser.KeyContext ctx); - /** - * Exit a parse tree produced by {@link JsonParser#key}. - * @param ctx the parse tree - */ - void exitKey(JsonParser.KeyContext ctx); - /** - * Enter a parse tree produced by {@link JsonParser#array}. - * @param ctx the parse tree - */ - void enterArray(JsonParser.ArrayContext ctx); - /** - * Exit a parse tree produced by {@link JsonParser#array}. - * @param ctx the parse tree - */ - void exitArray(JsonParser.ArrayContext ctx); -} \ No newline at end of file diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserVisitor.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserVisitor.java deleted file mode 100644 index b923266285a3..000000000000 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonParserVisitor.java +++ /dev/null @@ -1,69 +0,0 @@ -// Generated from java-escape by ANTLR 4.11.1 - -/* - * 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. - */ -package org.netbeans.modules.javascript2.json.parser; - -import org.antlr.v4.runtime.tree.ParseTreeVisitor; - -/** - * This interface defines a complete generic visitor for a parse tree produced - * by {@link JsonParser}. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -public interface JsonParserVisitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by {@link JsonParser#json}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitJson(JsonParser.JsonContext ctx); - /** - * Visit a parse tree produced by {@link JsonParser#value}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitValue(JsonParser.ValueContext ctx); - /** - * Visit a parse tree produced by {@link JsonParser#object}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitObject(JsonParser.ObjectContext ctx); - /** - * Visit a parse tree produced by {@link JsonParser#pair}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitPair(JsonParser.PairContext ctx); - /** - * Visit a parse tree produced by {@link JsonParser#key}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitKey(JsonParser.KeyContext ctx); - /** - * Visit a parse tree produced by {@link JsonParser#array}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitArray(JsonParser.ArrayContext ctx); -} \ No newline at end of file diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonVisitor.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonVisitor.java deleted file mode 100644 index aa8202b4ba59..000000000000 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/JsonVisitor.java +++ /dev/null @@ -1,31 +0,0 @@ -// Generated from java-escape by ANTLR 4.11.1 - -/* - * 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. - */ -package org.netbeans.modules.javascript2.json.parser; - -/** - * This interface defines a complete generic visitor for a parse tree produced - * by {@link JsonParser}. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -public interface JsonVisitor extends JsonParserVisitor { -} \ No newline at end of file diff --git a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/ParseTreeToXml.java b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/ParseTreeToXml.java index 61ef3c9ad91a..1b2a9627fba6 100644 --- a/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/ParseTreeToXml.java +++ b/webcommon/javascript2.json/src/org/netbeans/modules/javascript2/json/parser/ParseTreeToXml.java @@ -36,7 +36,7 @@ * * @author Tomas Zezula */ -public class ParseTreeToXml extends JsonBaseVisitor { +public class ParseTreeToXml extends JsonParserBaseVisitor { private final JsonLexer lexer; private final JsonParser parser; private Document doc; diff --git a/webcommon/javascript2.json/tools/JsonParser.g4 b/webcommon/javascript2.json/tools/JsonParser.g4 index da4d89e3dcd9..707c6bd65b3c 100644 --- a/webcommon/javascript2.json/tools/JsonParser.g4 +++ b/webcommon/javascript2.json/tools/JsonParser.g4 @@ -23,7 +23,7 @@ parser grammar JsonParser; options { tokenVocab = JsonLexer; } -@parser::header { +@header { /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/JsonModelResolver.java b/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/JsonModelResolver.java index 67ff21371b67..c11c09404554 100644 --- a/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/JsonModelResolver.java +++ b/webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/JsonModelResolver.java @@ -34,9 +34,9 @@ import org.netbeans.api.annotations.common.NonNull; import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.modules.csl.api.OffsetRange; -import org.netbeans.modules.javascript2.json.parser.JsonBaseVisitor; import org.netbeans.modules.javascript2.json.parser.JsonLexer; import org.netbeans.modules.javascript2.json.parser.JsonParser; +import org.netbeans.modules.javascript2.json.parser.JsonParserBaseVisitor; import org.netbeans.modules.javascript2.json.parser.ParseTreeToXml; import org.netbeans.modules.javascript2.model.api.JsElement; import org.netbeans.modules.javascript2.model.api.JsObject; @@ -55,7 +55,7 @@ * * @author Tomas Zezula */ -public final class JsonModelResolver extends JsonBaseVisitor implements ModelResolver { +public final class JsonModelResolver extends JsonParserBaseVisitor implements ModelResolver { private static final Logger LOG = Logger.getLogger(JsonModelResolver.class.getName()); @@ -85,7 +85,7 @@ public void init() { if (parseTree != null) { try { final JsonLexer l = new JsonLexer(new ANTLRInputStream()); - JsonBaseVisitor visitor = new ParseTreeToXml( + JsonParserBaseVisitor visitor = new ParseTreeToXml( l, new JsonParser(new CommonTokenStream(l))); LOG.log(Level.FINEST,