Open
Conversation
Add Tokenizer support to work properly with InputStreams. Signed-off-by: Evgeniy <minimajack@gmail.com>
Signed-off-by: Evgeniy <minimajack@gmail.com>
Signed-off-by: Evgeniy <minimajack@gmail.com>
Signed-off-by: Evgeniy <minimajack@gmail.com>
nixel2007
reviewed
Dec 22, 2019
src/main/antlr/BSLLexer.g4
Outdated
| NULL : 'NULL'; | ||
| DECIMAL: DIGIT+; | ||
| DATETIME: SQUOTE(~['\n\r])*SQUOTE?; // TODO: Честная регулярка | ||
| DATETIME: SQUOTE (DIGIT DIGIT DIGIT DIGIT DIGIT DIGIT DIGIT DIGIT )(DIGIT DIGIT DIGIT DIGIT DIGIT DIGIT)? SQUOTE?; // TODO: Честная регулярка |
Member
There was a problem hiding this comment.
Честная регулярка несколько сложнее. там допустимы сторонние символы.
https://github.com/1c-syntax/1c-syntax/blob/master/1c.YAML-tmLanguage#L696
nixel2007
reviewed
Dec 23, 2019
| import org.antlr.v4.runtime.*; | ||
| import org.antlr.v4.runtime.atn.PredictionMode; | ||
| import org.apache.commons.io.IOUtils; | ||
| import org.codehaus.plexus.util.IOUtil; |
nixel2007
reviewed
Dec 23, 2019
| import org.antlr.v4.runtime.ConsoleErrorListener; | ||
| import org.antlr.v4.runtime.Lexer; | ||
| import org.antlr.v4.runtime.Token; | ||
| import org.antlr.v4.runtime.*; |
Member
There was a problem hiding this comment.
star-import в целом не приветствуется.
ps. да, я помню про код стайл и гайдлайны
nixel2007
reviewed
Dec 23, 2019
| BSLParser parser = new BSLParser(getTokenStream()); | ||
| parser.removeErrorListener(ConsoleErrorListener.INSTANCE); | ||
| try { | ||
| parser.getInterpreter().setPredictionMode(PredictionMode.SLL); |
Member
There was a problem hiding this comment.
можешь пояснить вот этот момент? можно прям комментарием со ссылкой на какой-нибудь javaDoc или статью, если есть.
Signed-off-by: Evgeniy <minimajack@gmail.com>
Signed-off-by: Evgeniy <minimajack@gmail.com>
Signed-off-by: Evgeniy <minimajack@gmail.com>
Signed-off-by: Evgeniy <minimajack@gmail.com>
Signed-off-by: Evgeniy <minimajack@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add Tokenizer support to work properly with InputStreams.