Updated generated files.

This commit is contained in:
Ivan Kochurkin 2017-01-08 21:29:33 +03:00
parent ccb325db42
commit 8359a998b6
4 changed files with 144 additions and 96 deletions

View File

@ -1,115 +1,151 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// ANTLR Version: 4.4.1-dev
// ANTLR Version: 4.6.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// Generated from /Users/ericvergnaud/Development/antlr4/antlr/antlr4-csharp/runtime/CSharp/Antlr4.Runtime/Tree/Xpath/XPathLexer.g4 by ANTLR 4.4.1-dev
// Unreachable code detected
#pragma warning disable 0162
// The variable '...' is assigned but its value is never used
#pragma warning disable 0219
// Missing XML comment for publicly visible type or member '...'
#pragma warning disable 1591
// Ambiguous reference in cref attribute
#pragma warning disable 419
using System;
using System;
using System;
using System.Text;
using Antlr4.Runtime;
using Antlr4.Runtime.Atn;
using Antlr4.Runtime.Misc;
using DFA = Antlr4.Runtime.Dfa.DFA;
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.6.1")]
[System.CLSCompliant(false)]
public partial class XPathLexer : Lexer {
public const int
TokenRef=1, RuleRef=2, Anywhere=3, Root=4, Wildcard=5, Bang=6, ID=7, String=8;
public static string[] modeNames = {
public partial class XPathLexer : Lexer
{
protected static DFA[] decisionToDFA;
protected static PredictionContextCache sharedContextCache = new PredictionContextCache();
public const int
TokenRef = 1, RuleRef = 2, Anywhere = 3, Root = 4, Wildcard = 5, Bang = 6, ID = 7, String = 8;
public static string[] channelNames = {
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
};
public static string[] modeNames = {
"DEFAULT_MODE"
};
public static readonly string[] ruleNames = {
public static readonly string[] ruleNames = {
"Anywhere", "Root", "Wildcard", "Bang", "ID", "NameChar", "NameStartChar",
"String"
};
public XPathLexer(ICharStream input)
: base(input)
{
Interpreter = new LexerATNSimulator(this, _ATN, null, null);
}
public XPathLexer(ICharStream input)
: base(input)
{
Interpreter = new LexerATNSimulator(this, _ATN, decisionToDFA, sharedContextCache);
}
private static readonly string[] _LiteralNames = {
private static readonly string[] _LiteralNames = {
null, null, null, "'//'", "'/'", "'*'", "'!'"
};
private static readonly string[] _SymbolicNames = {
private static readonly string[] _SymbolicNames = {
null, "TokenRef", "RuleRef", "Anywhere", "Root", "Wildcard", "Bang", "ID",
"String"
};
public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);
public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);
[NotNull]
public override IVocabulary Vocabulary
{
get
{
return DefaultVocabulary;
}
}
[NotNull]
public override IVocabulary Vocabulary
{
get
{
return DefaultVocabulary;
}
}
public override string GrammarFileName { get { return "XPathLexer.g4"; } }
public override string GrammarFileName { get { return "XPathLexer.g4"; } }
public override string[] RuleNames { get { return ruleNames; } }
public override string[] RuleNames { get { return ruleNames; } }
public override string[] ModeNames { get { return modeNames; } }
public override string[] ChannelNames { get { return channelNames; } }
public override string SerializedAtn { get { return _serializedATN; } }
public override string[] ModeNames { get { return modeNames; } }
public override string SerializedAtn { get { return _serializedATN; } }
static XPathLexer()
{
decisionToDFA = new DFA[_ATN.NumberOfDecisions];
for (int i = 0; i < _ATN.NumberOfDecisions; i++)
{
decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i);
}
}
public override void Action(RuleContext _localctx, int ruleIndex, int actionIndex)
{
switch (ruleIndex)
{
case 4: ID_action(_localctx, actionIndex); break;
}
}
private void ID_action(RuleContext _localctx, int actionIndex)
{
switch (actionIndex)
{
case 0:
String text = Text;
if (Char.IsUpper(text[0]))
Type = TokenRef;
else
Type = RuleRef;
break;
}
}
private static string _serializedATN = _serializeATN();
private static string _serializeATN()
{
StringBuilder sb = new StringBuilder();
sb.Append("\x3\x430\xD6D1\x8206\xAD2D\x4417\xAEF1\x8D80\xAADD\x2\n\x34");
sb.Append("\b\x1\x4\x2\t\x2\x4\x3\t\x3\x4\x4\t\x4\x4\x5\t\x5\x4\x6\t\x6");
sb.Append("\x4\a\t\a\x4\b\t\b\x4\t\t\t\x3\x2\x3\x2\x3\x2\x3\x3\x3\x3\x3");
sb.Append("\x4\x3\x4\x3\x5\x3\x5\x3\x6\x3\x6\a\x6\x1F\n\x6\f\x6\xE\x6\"");
sb.Append("\v\x6\x3\x6\x3\x6\x3\a\x3\a\x5\a(\n\a\x3\b\x3\b\x3\t\x3\t\a");
sb.Append("\t.\n\t\f\t\xE\t\x31\v\t\x3\t\x3\t\x3/\x2\n\x3\x5\x5\x6\a\a");
sb.Append("\t\b\v\t\r\x2\xF\x2\x11\n\x3\x2\x4\a\x2\x32;\x61\x61\xB9\xB9");
sb.Append("\x302\x371\x2041\x2042\xF\x2\x43\\\x63|\xC2\xD8\xDA\xF8\xFA");
sb.Append("\x301\x372\x37F\x381\x2001\x200E\x200F\x2072\x2191\x2C02\x2FF1");
sb.Append("\x3003\xD801\xF902\xFDD1\xFDF2\xFFFF\x34\x2\x3\x3\x2\x2\x2\x2");
sb.Append("\x5\x3\x2\x2\x2\x2\a\x3\x2\x2\x2\x2\t\x3\x2\x2\x2\x2\v\x3\x2");
sb.Append("\x2\x2\x2\x11\x3\x2\x2\x2\x3\x13\x3\x2\x2\x2\x5\x16\x3\x2\x2");
sb.Append("\x2\a\x18\x3\x2\x2\x2\t\x1A\x3\x2\x2\x2\v\x1C\x3\x2\x2\x2\r");
sb.Append("\'\x3\x2\x2\x2\xF)\x3\x2\x2\x2\x11+\x3\x2\x2\x2\x13\x14\a\x31");
sb.Append("\x2\x2\x14\x15\a\x31\x2\x2\x15\x4\x3\x2\x2\x2\x16\x17\a\x31");
sb.Append("\x2\x2\x17\x6\x3\x2\x2\x2\x18\x19\a,\x2\x2\x19\b\x3\x2\x2\x2");
sb.Append("\x1A\x1B\a#\x2\x2\x1B\n\x3\x2\x2\x2\x1C \x5\xF\b\x2\x1D\x1F");
sb.Append("\x5\r\a\x2\x1E\x1D\x3\x2\x2\x2\x1F\"\x3\x2\x2\x2 \x1E\x3\x2");
sb.Append("\x2\x2 !\x3\x2\x2\x2!#\x3\x2\x2\x2\" \x3\x2\x2\x2#$\b\x6\x2");
sb.Append("\x2$\f\x3\x2\x2\x2%(\x5\xF\b\x2&(\t\x2\x2\x2\'%\x3\x2\x2\x2");
sb.Append("\'&\x3\x2\x2\x2(\xE\x3\x2\x2\x2)*\t\x3\x2\x2*\x10\x3\x2\x2\x2");
sb.Append("+/\a)\x2\x2,.\v\x2\x2\x2-,\x3\x2\x2\x2.\x31\x3\x2\x2\x2/\x30");
sb.Append("\x3\x2\x2\x2/-\x3\x2\x2\x2\x30\x32\x3\x2\x2\x2\x31/\x3\x2\x2");
sb.Append("\x2\x32\x33\a)\x2\x2\x33\x12\x3\x2\x2\x2\x6\x2 \'/\x3\x3\x6");
sb.Append("\x2");
return sb.ToString();
}
public static readonly ATN _ATN =
new ATNDeserializer().Deserialize(_serializedATN.ToCharArray());
public override void Action(RuleContext _localctx, int ruleIndex, int actionIndex) {
switch (ruleIndex) {
case 4 : ID_action(_localctx, actionIndex); break;
}
}
private void ID_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 0:
String text = Text;
if ( Char.IsUpper(text[0]) )
Type = TokenRef;
else
Type = RuleRef;
break;
}
}
public static readonly string _serializedATN =
"\x3\x430\xD6D1\x8206\xAD2D\x4417\xAEF1\x8D80\xAADD\x2\n\x34\b\x1\x4\x2"+
"\t\x2\x4\x3\t\x3\x4\x4\t\x4\x4\x5\t\x5\x4\x6\t\x6\x4\a\t\a\x4\b\t\b\x4"+
"\t\t\t\x3\x2\x3\x2\x3\x2\x3\x3\x3\x3\x3\x4\x3\x4\x3\x5\x3\x5\x3\x6\x3"+
"\x6\a\x6\x1F\n\x6\f\x6\xE\x6\"\v\x6\x3\x6\x3\x6\x3\a\x3\a\x5\a(\n\a\x3"+
"\b\x3\b\x3\t\x3\t\a\t.\n\t\f\t\xE\t\x31\v\t\x3\t\x3\t\x3/\x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3\x2\x2\x2\x32\x33\a)\x2\x2\x33"+
"\x12\x3\x2\x2\x2\x6\x2 \'/\x3\x3\x6\x2";
public static readonly ATN _ATN =
new ATNDeserializer().Deserialize(_serializedATN.ToCharArray());
}

View File

@ -1,12 +1,9 @@
// Generated from XPathLexer.g4 by ANTLR 4.5.3
#include "XPathLexer.h"
using namespace antlr4;
XPathLexer::XPathLexer(CharStream *input) : Lexer(input) {
_interpreter = new atn::LexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache);
}
@ -23,6 +20,10 @@ const std::vector<std::string>& XPathLexer::getRuleNames() const {
return _ruleNames;
}
const std::vector<std::string>& XPathLexer::getChannelNames() const {
return _channelNames;
}
const std::vector<std::string>& XPathLexer::getModeNames() const {
return _modeNames;
}
@ -31,7 +32,7 @@ const std::vector<std::string>& XPathLexer::getTokenNames() const {
return _tokenNames;
}
const dfa::Vocabulary& XPathLexer::getVocabulary() const {
dfa::Vocabulary& XPathLexer::getVocabulary() const {
return _vocabulary;
}
@ -46,14 +47,14 @@ const atn::ATN& XPathLexer::getATN() const {
void XPathLexer::action(RuleContext *context, size_t ruleIndex, size_t actionIndex) {
switch (ruleIndex) {
case 4: IDAction(dynamic_cast<RuleContext *>(context), actionIndex); break;
case 4: IDAction(dynamic_cast<antlr4::RuleContext *>(context), actionIndex); break;
default:
break;
}
}
void XPathLexer::IDAction(RuleContext * /*context*/, size_t actionIndex) {
void XPathLexer::IDAction(antlr4::RuleContext *context, size_t actionIndex) {
switch (actionIndex) {
case 0:
if (isupper(getText()[0]))
@ -82,6 +83,10 @@ std::vector<std::string> XPathLexer::_ruleNames = {
"STRING"
};
std::vector<std::string> XPathLexer::_channelNames = {
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
};
std::vector<std::string> XPathLexer::_modeNames = {
"DEFAULT_MODE"
};
@ -100,7 +105,7 @@ dfa::Vocabulary XPathLexer::_vocabulary(_literalNames, _symbolicNames);
std::vector<std::string> XPathLexer::_tokenNames;
XPathLexer::Initializer::Initializer() {
// This code could be in a static initializer lambda, but VS doesn't allow access to private class members from there.
// This code could be in a static initializer lambda, but VS doesn't allow access to private class members from there.
for (size_t i = 0; i < _symbolicNames.size(); ++i) {
std::string name = _vocabulary.getLiteralName(i);
if (name.empty()) {
@ -158,7 +163,9 @@ XPathLexer::Initializer::Initializer() {
atn::ATNDeserializer deserializer;
_atn = deserializer.deserialize(_serializedATN);
for (size_t i = 0; i < _atn.getNumberOfDecisions(); i++) {
size_t count = _atn.getNumberOfDecisions();
_decisionToDFA.reserve(count);
for (size_t i = 0; i < count; i++) {
_decisionToDFA.emplace_back(_atn.getDecisionState(i), i);
}
}

View File

@ -1,51 +1,50 @@
// Generated from XPathLexer.g4 by ANTLR 4.5.3
#pragma once
#include "antlr4-runtime.h"
#include "Vocabulary.h"
namespace antlr4 {
class XPathLexer : public Lexer {
class XPathLexer : public antlr4::Lexer {
public:
enum {
TOKEN_REF = 1, RULE_REF = 2, ANYWHERE = 3, ROOT = 4, WILDCARD = 5, BANG = 6,
ID = 7, STRING = 8
};
XPathLexer(CharStream *input);
XPathLexer(antlr4::CharStream *input);
~XPathLexer();
virtual std::string getGrammarFileName() const override;
virtual const std::vector<std::string>& getRuleNames() const override;
virtual const std::vector<std::string>& getChannelNames() const override;
virtual const std::vector<std::string>& getModeNames() const override;
virtual const std::vector<std::string>& getTokenNames() const override; // deprecated, use vocabulary instead
virtual const dfa::Vocabulary& getVocabulary() const override;
virtual antlr4::dfa::Vocabulary& getVocabulary() const override;
virtual const std::vector<uint16_t> getSerializedATN() const override;
virtual const atn::ATN& getATN() const override;
virtual void action(RuleContext *context, size_t ruleIndex, size_t actionIndex) override;
virtual const antlr4::atn::ATN& getATN() const override;
virtual void action(antlr4::RuleContext *context, size_t ruleIndex, size_t actionIndex) override;
private:
static std::vector<dfa::DFA> _decisionToDFA;
static atn::PredictionContextCache _sharedContextCache;
static std::vector<antlr4::dfa::DFA> _decisionToDFA;
static antlr4::atn::PredictionContextCache _sharedContextCache;
static std::vector<std::string> _ruleNames;
static std::vector<std::string> _tokenNames;
static std::vector<std::string> _channelNames;
static std::vector<std::string> _modeNames;
static std::vector<std::string> _literalNames;
static std::vector<std::string> _symbolicNames;
static dfa::Vocabulary _vocabulary;
static atn::ATN _atn;
static antlr4::dfa::Vocabulary _vocabulary;
static antlr4::atn::ATN _atn;
static std::vector<uint16_t> _serializedATN;
// Individual action functions triggered by action() above.
void IDAction(RuleContext *context, size_t actionIndex);
void IDAction(antlr4::RuleContext *context, size_t actionIndex);
// Individual semantic predicate functions triggered by sempred() above.
@ -55,4 +54,3 @@ private:
static Initializer _init;
};
} // namespace antlr4

View File

@ -13,6 +13,10 @@ open class SwiftTestLexer: Lexer {
internal static let _sharedContextCache:PredictionContextCache = PredictionContextCache()
public static let T__0=1
public static let channelNames: [String] = [
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
]
public static let modeNames: [String] = [
"DEFAULT_MODE"
]
@ -58,7 +62,7 @@ open class SwiftTestLexer: Lexer {
}
public override init(_ input: CharStream) {
RuntimeMetaData.checkVersion("4.6", RuntimeMetaData.VERSION)
RuntimeMetaData.checkVersion("4.6.1", RuntimeMetaData.VERSION)
super.init(input)
_interp = LexerATNSimulator(self, SwiftTestLexer._ATN, SwiftTestLexer._decisionToDFA, SwiftTestLexer._sharedContextCache)
}
@ -72,6 +76,9 @@ open class SwiftTestLexer: Lexer {
override
open func getSerializedATN() -> String { return SwiftTestLexer._serializedATN }
override
open func getChannelNames() -> [String] { return HelloLexer.channelNames }
override
open func getModeNames() -> [String] { return SwiftTestLexer.modeNames }