Skip to content

Commit

Permalink
Fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
boxbeam committed Apr 14, 2022
1 parent 3e5d9a1 commit ae7f2a9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/redempt/redlex/bnf/BNFParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ public class BNFParser {
private static Lexer lexer;

static {
lexer = BNFLexer.getLexer();
lexer.setUnnamedRule(CullStrategy.DELETE_ALL);
lexer.setRetainEmpty(false);
lexer.setRuleByName(CullStrategy.DELETE_ALL, "whitespace", "::=", "comment", "validChar");
lexer.setRuleByName(CullStrategy.LIFT_CHILDREN, "modifiers", "statementList", "tokenOrNested",
"tokenOrStatement", "tokenBase", "sentencesRep", "separator", "modifierChoice");
lexer = BNFLexer.getLexer();
lexer.setUnnamedRule(CullStrategy.DELETE_ALL);
lexer.setRetainEmpty(false);
lexer.setRuleByName(CullStrategy.DELETE_ALL, "whitespace", "::=", "comment", "validChar");
lexer.setRuleByName(CullStrategy.LIFT_CHILDREN, "modifiers", "statementList", "tokenOrNested",
"tokenOrStatement", "tokenBase", "sentencesRep", "separator", "modifierChoice");
}

/**
* Parses the input String and returns a Lexer
*
* @param input The input String defining the format for the Lexer
* @return A Lexer for the given format
*/
Expand All @@ -51,6 +52,7 @@ public static Lexer createLexer(String input) {

/**
* Parses the input String and returns a Lexer
*
* @param path The path to a file containing the format for the Lexer
* @return A Lexer for the given format
*/
Expand All @@ -66,6 +68,7 @@ public static Lexer createLexer(Path path) {

/**
* Parses the input String and returns a Lexer
*
* @param stream The InputStream the bnf contents can be read from
* @return A Lexer for the given format
*/
Expand Down

0 comments on commit ae7f2a9

Please sign in to comment.