-
Notifications
You must be signed in to change notification settings - Fork 3.4k
use ints not chars for C# #3567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c5f0b2d
use ints not chars for C#
parrt a1fc8e1
oops. remove 'quotes'
parrt c8fb3a4
regen from XPathLexer.g4
parrt 46fab6c
simplify ATN with bypass alts mechanism in Java.
parrt f51f695
Change string to int[] for serialized ATN for C#; removed unneeded `u…
parrt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -19,9 +19,6 @@ | |
| // Ambiguous reference in cref attribute | ||
| #pragma warning disable 419 | ||
|
|
||
|
|
||
| using System; | ||
|
|
||
| using System; | ||
| using System.IO; | ||
| using System.Text; | ||
|
|
@@ -46,7 +43,7 @@ public const int | |
| }; | ||
|
|
||
| public static readonly string[] ruleNames = { | ||
| "Anywhere", "Root", "Wildcard", "Bang", "ID", "NameChar", "NameStartChar", | ||
| "Anywhere", "Root", "Wildcard", "Bang", "ID", "NameChar", "NameStartChar", | ||
| "String" | ||
| }; | ||
|
|
||
|
|
@@ -64,7 +61,7 @@ public XPathLexer(ICharStream input, TextWriter output, TextWriter errorOutput) | |
| null, null, null, "'//'", "'/'", "'*'", "'!'" | ||
| }; | ||
| private static readonly string[] _SymbolicNames = { | ||
| null, "TokenRef", "RuleRef", "Anywhere", "Root", "Wildcard", "Bang", "ID", | ||
| null, "TokenRef", "RuleRef", "Anywhere", "Root", "Wildcard", "Bang", "ID", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excess whitespace. |
||
| "String" | ||
| }; | ||
| public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); | ||
|
|
@@ -86,7 +83,7 @@ public override IVocabulary Vocabulary | |
|
|
||
| public override string[] ModeNames { get { return modeNames; } } | ||
|
|
||
| public override string SerializedAtn { get { return new string(_serializedATN); } } | ||
| public override int[] SerializedAtn { get { return _serializedATN; } } | ||
|
|
||
| static XPathLexer() { | ||
| decisionToDFA = new DFA[_ATN.NumberOfDecisions]; | ||
|
|
@@ -101,61 +98,34 @@ public override void Action(RuleContext _localctx, int ruleIndex, int actionInde | |
| } | ||
| private void ID_action(RuleContext _localctx, int actionIndex) { | ||
| switch (actionIndex) { | ||
| case 0: | ||
| case 0: | ||
parrt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| String text = Text; | ||
| if ( Char.IsUpper(text[0]) ) | ||
| if ( Char.IsUpper(text[0]) ) | ||
| Type = TokenRef; | ||
| else | ||
| else | ||
| Type = RuleRef; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| private static char[] _serializedATN = { | ||
| '\x4', '\0', '\b', '\x32', '\x6', '\xFFFF', '\x2', '\0', '\a', '\0', '\x2', | ||
| '\x1', '\a', '\x1', '\x2', '\x2', '\a', '\x2', '\x2', '\x3', '\a', '\x3', | ||
| '\x2', '\x4', '\a', '\x4', '\x2', '\x5', '\a', '\x5', '\x2', '\x6', '\a', | ||
| '\x6', '\x2', '\a', '\a', '\a', '\x1', '\0', '\x1', '\0', '\x1', '\0', | ||
| '\x1', '\x1', '\x1', '\x1', '\x1', '\x2', '\x1', '\x2', '\x1', '\x3', | ||
| '\x1', '\x3', '\x1', '\x4', '\x1', '\x4', '\x5', '\x4', '\x1D', '\b', | ||
| '\x4', '\n', '\x4', '\f', '\x4', ' ', '\t', '\x4', '\x1', '\x4', '\x1', | ||
| '\x4', '\x1', '\x5', '\x1', '\x5', '\x3', '\x5', '&', '\b', '\x5', '\x1', | ||
| '\x6', '\x1', '\x6', '\x1', '\a', '\x1', '\a', '\x5', '\a', ',', '\b', | ||
| '\a', '\n', '\a', '\f', '\a', '/', '\t', '\a', '\x1', '\a', '\x1', '\a', | ||
| '\x1', '-', '\0', '\b', '\x1', '\x3', '\x3', '\x4', '\x5', '\x5', '\a', | ||
| '\x6', '\t', '\a', '\v', '\0', '\r', '\0', '\xF', '\b', '\x1', '\0', '\x2', | ||
| '\x5', '\0', '\x30', '\x39', '_', '_', '\xB7', '\xB7', '\x300', '\x36F', | ||
| '\x203F', '\x2040', '\r', '\0', '\x41', 'Z', '\x61', 'z', '\xC0', '\xD6', | ||
| '\xD8', '\xF6', '\xF8', '\x2FF', '\x370', '\x37D', '\x37F', '\x1FFF', | ||
| '\x200C', '\x200D', '\x2070', '\x218F', '\x2C00', '\x2FEF', '\x3001', | ||
| '\xD7FF', '\xF900', '\xFDCF', '\xFDF0', '\xFFFD', '\0', '\x32', '\0', | ||
| '\x1', '\x1', '\0', '\0', '\0', '\0', '\x3', '\x1', '\0', '\0', '\0', | ||
| '\0', '\x5', '\x1', '\0', '\0', '\0', '\0', '\a', '\x1', '\0', '\0', '\0', | ||
| '\0', '\t', '\x1', '\0', '\0', '\0', '\0', '\xF', '\x1', '\0', '\0', '\0', | ||
| '\x1', '\x11', '\x1', '\0', '\0', '\0', '\x3', '\x14', '\x1', '\0', '\0', | ||
| '\0', '\x5', '\x16', '\x1', '\0', '\0', '\0', '\a', '\x18', '\x1', '\0', | ||
| '\0', '\0', '\t', '\x1A', '\x1', '\0', '\0', '\0', '\v', '%', '\x1', '\0', | ||
| '\0', '\0', '\r', '\'', '\x1', '\0', '\0', '\0', '\xF', ')', '\x1', '\0', | ||
| '\0', '\0', '\x11', '\x12', '\x5', '/', '\0', '\0', '\x12', '\x13', '\x5', | ||
| '/', '\0', '\0', '\x13', '\x2', '\x1', '\0', '\0', '\0', '\x14', '\x15', | ||
| '\x5', '/', '\0', '\0', '\x15', '\x4', '\x1', '\0', '\0', '\0', '\x16', | ||
| '\x17', '\x5', '*', '\0', '\0', '\x17', '\x6', '\x1', '\0', '\0', '\0', | ||
| '\x18', '\x19', '\x5', '!', '\0', '\0', '\x19', '\b', '\x1', '\0', '\0', | ||
| '\0', '\x1A', '\x1E', '\x3', '\r', '\x6', '\0', '\x1B', '\x1D', '\x3', | ||
| '\v', '\x5', '\0', '\x1C', '\x1B', '\x1', '\0', '\0', '\0', '\x1D', ' ', | ||
| '\x1', '\0', '\0', '\0', '\x1E', '\x1C', '\x1', '\0', '\0', '\0', '\x1E', | ||
| '\x1F', '\x1', '\0', '\0', '\0', '\x1F', '!', '\x1', '\0', '\0', '\0', | ||
| ' ', '\x1E', '\x1', '\0', '\0', '\0', '!', '\"', '\x6', '\x4', '\0', '\0', | ||
| '\"', '\n', '\x1', '\0', '\0', '\0', '#', '&', '\x3', '\r', '\x6', '\0', | ||
| '$', '&', '\a', '\0', '\0', '\0', '%', '#', '\x1', '\0', '\0', '\0', '%', | ||
| '$', '\x1', '\0', '\0', '\0', '&', '\f', '\x1', '\0', '\0', '\0', '\'', | ||
| '(', '\a', '\x1', '\0', '\0', '(', '\xE', '\x1', '\0', '\0', '\0', ')', | ||
| '-', '\x5', '\'', '\0', '\0', '*', ',', '\t', '\0', '\0', '\0', '+', '*', | ||
| '\x1', '\0', '\0', '\0', ',', '/', '\x1', '\0', '\0', '\0', '-', '.', | ||
| '\x1', '\0', '\0', '\0', '-', '+', '\x1', '\0', '\0', '\0', '.', '\x30', | ||
| '\x1', '\0', '\0', '\0', '/', '-', '\x1', '\0', '\0', '\0', '\x30', '\x31', | ||
| '\x5', '\'', '\0', '\0', '\x31', '\x10', '\x1', '\0', '\0', '\0', '\x4', | ||
| '\0', '\x1E', '%', '-', '\x1', '\x1', '\x4', '\0', | ||
| private static int[] _serializedATN = { | ||
| 4,0,8,50,6,65535,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, | ||
| 6,2,7,7,7,1,0,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,4,1,4,5,4,29,8,4,10,4, | ||
| 12,4,32,9,4,1,4,1,4,1,5,1,5,3,5,38,8,5,1,6,1,6,1,7,1,7,5,7,44,8,7,10,7, | ||
| 12,7,47,9,7,1,7,1,7,1,45,0,8,1,3,3,4,5,5,7,6,9,7,11,0,13,0,15,8,1,0,2, | ||
| 5,0,48,57,95,95,183,183,768,879,8255,8256,13,0,65,90,97,122,192,214,216, | ||
| 246,248,767,880,893,895,8191,8204,8205,8304,8591,11264,12271,12289,55295, | ||
| 63744,64975,65008,65533,0,50,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1, | ||
| 0,0,0,0,9,1,0,0,0,0,15,1,0,0,0,1,17,1,0,0,0,3,20,1,0,0,0,5,22,1,0,0,0, | ||
| 7,24,1,0,0,0,9,26,1,0,0,0,11,37,1,0,0,0,13,39,1,0,0,0,15,41,1,0,0,0,17, | ||
| 18,5,47,0,0,18,19,5,47,0,0,19,2,1,0,0,0,20,21,5,47,0,0,21,4,1,0,0,0,22, | ||
| 23,5,42,0,0,23,6,1,0,0,0,24,25,5,33,0,0,25,8,1,0,0,0,26,30,3,13,6,0,27, | ||
| 29,3,11,5,0,28,27,1,0,0,0,29,32,1,0,0,0,30,28,1,0,0,0,30,31,1,0,0,0,31, | ||
| 33,1,0,0,0,32,30,1,0,0,0,33,34,6,4,0,0,34,10,1,0,0,0,35,38,3,13,6,0,36, | ||
| 38,7,0,0,0,37,35,1,0,0,0,37,36,1,0,0,0,38,12,1,0,0,0,39,40,7,1,0,0,40, | ||
| 14,1,0,0,0,41,45,5,39,0,0,42,44,9,0,0,0,43,42,1,0,0,0,44,47,1,0,0,0,45, | ||
| 46,1,0,0,0,45,43,1,0,0,0,46,48,1,0,0,0,47,45,1,0,0,0,48,49,5,39,0,0,49, | ||
| 16,1,0,0,0,4,0,30,37,45,1,1,4,0 | ||
| }; | ||
|
|
||
| public static readonly ATN _ATN = | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| lexer grammar XPathLexer; | ||
|
|
||
| @header { | ||
| using System; | ||
| } | ||
|
|
||
| tokens { TokenRef, RuleRef } | ||
|
|
||
| /* | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.