Package eu.royalsloth.depbuilder.dsl
Class DslParser
- java.lang.Object
-
- eu.royalsloth.depbuilder.dsl.DslParser
-
public class DslParser extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALL_SETTINGS
static String
SCHEDULER_SETTINGS
-
Constructor Summary
Constructors Constructor Description DslParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
chompArray(DslLexer.Tokenizer tokenizer, Token token)
static Token
eatUpSemicolons(DslLexer.Tokenizer tokenizer, Token token)
static Token
expectAndParseColon(DslLexer.Tokenizer tokenizer)
static Token
expectAndParseColon(DslLexer.Tokenizer tokenizer, String settingsId, String settingsField)
static <T> List<T>
parseArray(DslLexer.Tokenizer tokenizer, Class<T> clazz)
static ParsedBuild
parseBuild(String input, SettingsVerifier settingsVerifier)
static ParsedBuild
parseBuildNoVerify(String input)
static Duration
parseDuration(DslLexer.Tokenizer tokenizer, String identifier)
static Duration
parseDuration(DslLexer.Tokenizer tokenizer, String identifier, Token alreadyParsedToken)
static List<Integer>
parseIntArray(DslLexer.Tokenizer tokenizer)
static List<String>
parseStringArray(DslLexer.Tokenizer tokenizer)
static LocalTime
parseTime(DslLexer.Tokenizer tokenizer, String identifier, Token alreadyParsedToken)
Parse time in "hh:mm" or hh:mm (without quotes) format or else throw an exceptionstatic int
safeIntParse(DslLexer.Tokenizer tokenizer, Token token)
-
-
-
Field Detail
-
ALL_SETTINGS
public static final String ALL_SETTINGS
- See Also:
- Constant Field Values
-
SCHEDULER_SETTINGS
public static final String SCHEDULER_SETTINGS
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseBuildNoVerify
public static ParsedBuild parseBuildNoVerify(String input) throws ParseException
- Throws:
ParseException
-
parseBuild
public static ParsedBuild parseBuild(String input, SettingsVerifier settingsVerifier) throws ParseException
- Throws:
ParseException
-
chompArray
public static String chompArray(DslLexer.Tokenizer tokenizer, Token token) throws ParseException
- Throws:
ParseException
-
parseTime
public static LocalTime parseTime(DslLexer.Tokenizer tokenizer, String identifier, Token alreadyParsedToken) throws ParseException
Parse time in "hh:mm" or hh:mm (without quotes) format or else throw an exception- Throws:
ParseException
-
parseDuration
public static Duration parseDuration(DslLexer.Tokenizer tokenizer, String identifier) throws ParseException
- Throws:
ParseException
-
parseDuration
public static Duration parseDuration(DslLexer.Tokenizer tokenizer, String identifier, Token alreadyParsedToken) throws ParseException
- Throws:
ParseException
-
parseStringArray
public static List<String> parseStringArray(DslLexer.Tokenizer tokenizer) throws ParseException
- Throws:
ParseException
-
parseIntArray
public static List<Integer> parseIntArray(DslLexer.Tokenizer tokenizer) throws ParseException
- Throws:
ParseException
-
parseArray
public static <T> List<T> parseArray(DslLexer.Tokenizer tokenizer, Class<T> clazz) throws ParseException
- Throws:
ParseException
-
expectAndParseColon
public static Token expectAndParseColon(DslLexer.Tokenizer tokenizer) throws ParseException
- Throws:
ParseException
-
expectAndParseColon
public static Token expectAndParseColon(DslLexer.Tokenizer tokenizer, String settingsId, String settingsField) throws ParseException
- Throws:
ParseException
-
eatUpSemicolons
public static Token eatUpSemicolons(DslLexer.Tokenizer tokenizer, Token token)
-
safeIntParse
public static int safeIntParse(DslLexer.Tokenizer tokenizer, Token token) throws ParseException
- Throws:
ParseException
-
-