RulesParserConstants
public class RulesParser extends java.lang.Object implements RulesParserConstants
Modifier and Type | Field | Description |
---|---|---|
Token |
jj_nt |
Next token.
|
Token |
token |
Current token.
|
RulesParserTokenManager |
token_source |
Generated Token Manager.
|
ACONFIRMATIONMEASURE, ALL, AT, AT_COLON, AT_COMMA, ATTRIBUTES, C1CONFIRMATIONMEASURE, CARDINAL, CLASSES, CONFIDENCE, CONSISTENCYLEVEL, COST, COVERAGE, COVERAGEFACTOR, COVEREDEXAMPLES, D, DECISION, DEFAULT, DESCRIPTION, DIGIT, DISCRETIZATION, DS, DS_COLON, DS_COMMA, DS_EQUAL, DS_ROUND_BRACKET_CLOSE, DS_ROUND_BRACKET_OPEN, DS_SHARP_BRACKET_CLOSE, DS_SHARP_BRACKET_OPEN, DS_SQUARE_BRACKET_CLOSE, DS_SQUARE_BRACKET_OPEN, EOF, EOL, EPSILONPRIMMEASURE, EQUAL, ERR, FCONFIRMATIONMEASURE, FI, FI_ALGORITHM, FI_COLON, FI_COMMENT, FI_DATAFILEDIRECTORY, FI_DATAFILENAME, FI_DECISION, FI_DURATION, FI_OBJECTS, FI_OTHER, FI_PROGRAM, FILEINFO, FLOAT, FNUMBER, FUZZY, GAIN, ID, INCONSISTENCYMEASURE, INF, INTEGER, INTERVAL, LCONFIRMATIONMEASURE, LEARNINGPOSITIVEEXAMPLES, LETTER, MEMBERSHIP, MINUS, NEGATIVECOVERAGE, NEGATIVECOVEREDEXAMPLES, NOMINAL, NONE, OMIT, OR, PAIR, PAIR_TEXT, PARAMETERS, PF, PF_COLON, PLUS, PR, PR_COLON, PR_COMMA, PREF_OR_DIFF, PREFERENCES, PROTHER, RI, RIOTHER, RU, RU_AMP, RU_BRACE_BRACKET_CLOSE, RU_BRACE_BRACKET_OPEN, RU_COLON, RU_COMMA, RU_EQUAL, RU_GET, RU_GT, RU_LET, RU_LT, RU_ROUND_BRACKET_CLOSE, RU_ROUND_BRACKET_OPEN, RU_SQUARE_BRACKET_CLOSE, RU_SQUARE_BRACKET_OPEN, RU_THEN, RU_VERT, RULE_CLASS, RULE_TYPE, RULES, RULESFORMAT, RULESFORMATVALUE, RULESINFO, RUOTHER, SIGN, SINGLE_LINE_COMMENT, SINUMBER, SQUARE_BRACKET_CLOSE, SQUARE_BRACKET_OPEN, STRENGTH, SUM_MIN_PREF_OR_VALUES, SUPPORT, SUPPORTINGEXAMPLES, tokenImage, TRAPEZOIDAL, UINUMBER, UNKNOWN, X, Y, ZCONFIRMATIONMEASURE
Constructor | Description |
---|---|
RulesParser(CharStream stream) |
Constructor with user supplied CharStream.
|
RulesParser(RulesParserTokenManager tm) |
Constructor with generated Token Manager.
|
Modifier and Type | Method | Description |
---|---|---|
void |
disable_tracing() |
Disable tracing.
|
void |
enable_tracing() |
Enable tracing.
|
void |
eol() |
Function represents any number of an end of line signs
|
ParseException |
generateParseException() |
Generate ParseException.
|
Token |
getNextToken() |
Get the next Token.
|
Token |
getPrefID() |
|
RulesContainer |
getRulesContainer(ParseLog parseLog) |
Returns RulesContainer class containing rules parsed from file
|
Token |
getRulesID() |
|
Token |
getToken(int index) |
Get the specific Token.
|
void |
parseAttribute(AttributesBuilder builder) |
|
void |
parseAttributesSection(AttributesBuilder builder) |
|
EnumDomain |
parseClassDomain() |
|
void |
parseDecision(AttributesBuilder builder) |
|
void |
parseDiscretization(AttributesBuilder builder) |
|
void |
parseDiscretizationInterval(AttributesBuilder builder) |
|
void |
parseDiscretizationSection(AttributesBuilder builder) |
|
EnumDomain |
parseDomain() |
|
void |
parseExample() |
|
Field |
parseField(Field field) |
|
int |
parseFieldToken() |
|
void |
parseFileInfoLine(FileInfo f) |
Parses the [FILEINFO] line
|
void |
parseFileinfoOther() |
|
FileInfo |
parseFileInfoSection() |
Parses the [FILEINFO] section
|
double |
parseFloat() |
|
void |
parseFuzzy(Field field) |
|
void |
parseInterval(Field field) |
|
RulesContainer |
parseMetaData() |
Main Parser's function.
|
void |
parsePair(Field field) |
|
java.util.ArrayList |
parseParametersClassesList() |
|
void |
parseParametersLine() |
|
void |
parseParametersSection() |
|
void |
parsePostfix(AttributesBuilder builder) |
|
void |
parsePreference(AttributesBuilder builder) |
|
void |
parsePreferencesSection(AttributesBuilder builder) |
|
java.lang.String |
parseRelation() |
Parses the rule's relations
|
void |
parserFileinfoID(FileInfo f) |
|
Condition |
parseRulesCondition() |
Parses the rule's condition
|
Condition |
parseRulesDecision() |
Parses the rule's decision
|
void |
parseRulesinfoLine(int index) |
Parses rulesinfo line
|
void |
parseRulesInfoOther() |
|
void |
parseRulesinfoSection() |
Parses [RULESINFO] section
|
IndexedRule |
parseRulesLine() |
Parses Rules line, which looks like this:
line-no: conditon1 & ...
|
Token |
parseRulesOther() |
|
void |
parseRulesSection(RulesContainer container) |
Parses [RULES] section
|
void |
parseSimple(Field f) |
|
void |
parseTrapez(Field field) |
|
void |
parseType(AttributesBuilder builder) |
|
void |
parseValue(Field field) |
|
static java.lang.String |
prepareMessage(java.lang.String message,
int line,
int column) |
Prepares the message to be logged
|
void |
ReInit(CharStream stream) |
Reinitialise.
|
void |
ReInit(RulesParserTokenManager tm) |
Reinitialise.
|
Token |
value() |
Deprecated.
|
int[] |
valueArray(boolean decrement) |
Parses list of values
|
int |
valueInt() |
Parses value
|
public RulesParserTokenManager token_source
public Token token
public Token jj_nt
public RulesParser(CharStream stream)
public RulesParser(RulesParserTokenManager tm)
public static java.lang.String prepareMessage(java.lang.String message, int line, int column)
message
- Message to be loggedline
- Line to include in the messagecolumn
- Column to include in the messagepublic RulesContainer getRulesContainer(ParseLog parseLog) throws ParseException
parseLog
- Class extending ParseLog class responsible for logging parser warnings, errors, and fatal errorsParseException
public final void eol() throws ParseException
ParseException
public final RulesContainer parseMetaData() throws ParseException
ParseException
public final FileInfo parseFileInfoSection() throws ParseException
ParseException
public final void parseFileInfoLine(FileInfo f) throws ParseException, java.lang.Exception
ParseException
java.lang.Exception
public final void parseFileinfoOther() throws ParseException
ParseException
public final void parserFileinfoID(FileInfo f) throws ParseException
ParseException
public final void parseParametersSection() throws ParseException
ParseException
public final void parseParametersLine() throws ParseException
ParseException
public final java.util.ArrayList parseParametersClassesList() throws ParseException
ParseException
public final void parseAttributesSection(AttributesBuilder builder) throws ParseException
ParseException
public final void parseAttribute(AttributesBuilder builder) throws ParseException
ParseException
public final void parseType(AttributesBuilder builder) throws ParseException
ParseException
public final EnumDomain parseClassDomain() throws ParseException
ParseException
public final EnumDomain parseDomain() throws ParseException
ParseException
public final void parsePostfix(AttributesBuilder builder) throws ParseException
ParseException
public final void parseDecision(AttributesBuilder builder) throws ParseException
ParseException
public final void parsePreferencesSection(AttributesBuilder builder) throws ParseException
ParseException
public final void parsePreference(AttributesBuilder builder) throws ParseException
ParseException
public final Token getPrefID() throws ParseException
ParseException
public final void parseDiscretizationSection(AttributesBuilder builder) throws ParseException
ParseException
public final void parseDiscretization(AttributesBuilder builder) throws ParseException
ParseException
public final void parseDiscretizationInterval(AttributesBuilder builder) throws ParseException
ParseException
public final void parseSimple(Field f) throws ParseException
ParseException
public final void parseRulesSection(RulesContainer container) throws ParseException, java.lang.Exception
ParseException
java.lang.Exception
public final Token parseRulesOther() throws ParseException
ParseException
public final IndexedRule parseRulesLine() throws ParseException, java.lang.Exception
java.lang.Exception
- when wrong typeParseException
public final Condition parseRulesDecision() throws ParseException, java.lang.Exception
ParseException
java.lang.Exception
public final Condition parseRulesCondition() throws ParseException, java.lang.Exception
ParseException
java.lang.Exception
public final Token getRulesID() throws ParseException
ParseException
public final Field parseField(Field field) throws ParseException, MalformedExampleException
public final int parseFieldToken() throws ParseException
ParseException
public final void parseRulesinfoSection() throws ParseException
ParseException
public final void parseRulesinfoLine(int index) throws ParseException, java.lang.Exception
ParseException
java.lang.Exception
public final int[] valueArray(boolean decrement) throws ParseException, java.lang.NumberFormatException
ParseException
java.lang.NumberFormatException
public final void parseRulesInfoOther() throws ParseException
ParseException
public final java.lang.String parseRelation() throws ParseException
ParseException
public final double parseFloat() throws ParseException
ParseException
public final void parseExample() throws ParseException, MalformedExampleException
public final void parseValue(Field field) throws ParseException, MalformedExampleException
public final void parseInterval(Field field) throws ParseException, MalformedExampleException
public final void parsePair(Field field) throws ParseException, MalformedExampleException
public final void parseTrapez(Field field) throws ParseException, MalformedExampleException
public final void parseFuzzy(Field field) throws ParseException, MalformedExampleException
public final Token value() throws ParseException
ParseException
public final int valueInt() throws ParseException, java.lang.NumberFormatException
ParseException
java.lang.NumberFormatException
public void ReInit(CharStream stream)
public void ReInit(RulesParserTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()