Class SemanticsParser
java.lang.Object
com.yahoo.prelude.semantics.parser.SemanticsParser
- All Implemented Interfaces:
SemanticsParserConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface com.yahoo.prelude.semantics.parser.SemanticsParserConstants
AUTOMATADIRECTIVE, COLON, COMMA, CONDITION, CONTAINS, DASH, DECIMAL, DEFAULT, DEFAULTDIRECTIVE, DIFFERENT, DOLLAR, DOT, ELLIPSIS, EOF, EQUALS, EXCLAMATION, HEX, IDENTIFIER, INCLUDEDIRECTIVE, LANGUAGEDIRECTIVE, LARGER, LARGEREQUALS, LEFTBRACE, LEFTSQUAREBRACKET, LITERAL, NL, NUMBER, OCTAL, PLUS, PRODUCE, QUESTION, QUOTE, REPLACE, RIGHTBRACE, RIGHTSQUAREBRACKET, SEMICOLON, SINGLE_LINE_COMMENT, SLASH, SMALLER, SMALLEREQUALS, STAR, STEMMINGDIRECTIVE, SUPERDIRECTIVE, TILDE, tokenImage -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with generated Token Manager.SemanticsParser(InputStream stream, String encoding) Constructor with InputStream and supplied encodingSemanticsParser(Reader stream) Constructor with InputStream.SemanticsParser(Reader stream, com.yahoo.language.Linguistics linguistics) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidautomataDirective(RuleBase rules, RuleImporter importer) final Conditionfinal Stringfinal Stringfinal CompositeItemConditionfinal Conditionfinal ConditionReferencefinal Stringcontext()final voiddefaultDirective(RuleBase rules) final RuleBasedirective(RuleBase rules, RuleImporter importer) final voidDisable tracing.final voidEnable tracing.Generate ParseException.final Tokenfinal TokengetToken(int index) final Stringfinal Stringfinal voidincludeDirective(RuleBase rules, RuleImporter importer) final Stringlabel()final voidlanguageDirective(RuleBase rules) final Stringliteral()final LiteralConditionfinal LiteralTermProductionfinal voidnamedCondition(RuleBase rules) final Stringfinal NamespaceProductionfinal Conditionfinal TermProductionfinal EllipsisConditionfinal Conditionfinal intnumber()final LiteralPhraseProductionfinal Productionfinal ProductionListfinal voidproductionRule(RuleBase rules) final ProductionRulefinal Conditionfinal EllipsisConditionfinal Stringfinal ReferenceTermProductionvoidReinitialisevoidReInit(InputStream stream, String encoding) ReinitialisevoidReinitialisefinal RuleBasesemanticRules(RuleBase rules, RuleImporter importer) Parses a search definition and returns the resulting objectfinal Conditionfinal voidstemmingDirective(RuleBase rules) final Stringstring()final Stringfinal SuperConditionfinal TermConditionfinal Conditionfinal Conditionfinal Conditionfinal Conditionfinal TermProductionfinal TermTypetermType()final Conditionfinal boolean
-
Field Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
SemanticsParser
-
SemanticsParser
Constructor with InputStream and supplied encoding- Parameters:
stream- input streamencoding- charset to be used. May not benull.
-
SemanticsParser
Constructor with InputStream.- Parameters:
stream- char stream
-
SemanticsParser
Constructor with generated Token Manager.- Parameters:
tm- Token manager to use
-
-
Method Details
-
semanticRules
Parses a search definition and returns the resulting object- Throws:
ParseException
-
directive
- Throws:
ParseException
-
includeDirective
- Throws:
ParseException
-
automataDirective
- Throws:
ParseException
-
defaultDirective
- Throws:
ParseException
-
stemmingDirective
- Throws:
ParseException
-
languageDirective
- Throws:
ParseException
-
productionRule
- Throws:
ParseException
-
productionRuleType
- Throws:
ParseException
-
productionList
- Throws:
ParseException
-
production
- Throws:
ParseException
-
termProduction
- Throws:
ParseException
-
nonphraseTermProduction
- Throws:
ParseException
-
phraseProduction
- Throws:
ParseException
-
namespaceProduction
- Throws:
ParseException
-
referenceTermProduction
- Throws:
ParseException
-
literalTermProduction
- Throws:
ParseException
-
comparisonPrefix
- Throws:
ParseException
-
termType
- Throws:
ParseException
-
referenceIdentifier
- Throws:
ParseException
-
namedCondition
- Throws:
ParseException
-
topLevelCondition
- Throws:
ParseException
-
condition
- Throws:
ParseException
-
terminalOrSequenceCondition
- Throws:
ParseException
-
terminalCondition
- Throws:
ParseException
-
terminalOrComparisonCondition
- Throws:
ParseException
-
reallyTerminalCondition
- Throws:
ParseException
-
terminalConditionBody
- Throws:
ParseException
-
notCondition
- Throws:
ParseException
-
conditionReference
- Throws:
ParseException
-
nonReferableEllipsisCondition
- Throws:
ParseException
-
referableEllipsisCondition
- Throws:
ParseException
-
nestedCondition
- Throws:
ParseException
-
sequenceCondition
- Throws:
ParseException
-
choiceCondition
- Throws:
ParseException
-
termCondition
- Throws:
ParseException
-
superCondition
- Throws:
ParseException
-
literalCondition
- Throws:
ParseException
-
compositeItemCondition
- Throws:
ParseException
-
context
- Throws:
ParseException
-
label
- Throws:
ParseException
-
nameSpace
- Throws:
ParseException
-
identifier
- Throws:
ParseException
-
stringOrLiteral
- Throws:
ParseException
-
identifierOrLiteral
- Throws:
ParseException
-
comparison
- Throws:
ParseException
-
string
- Throws:
ParseException
-
literal
- Throws:
ParseException
-
number
- Throws:
ParseException
-
ReInit
Reinitialise- Parameters:
stream- input streamencoding- charset to be used. May not benull.
-
ReInit
Reinitialise- Parameters:
stream- char stream
-
ReInit
Reinitialise- Parameters:
tm- Token manager to use
-
getNextToken
- Returns:
- the next Token.
-
getToken
- Parameters:
index- index to be retrieved- Returns:
- the specific Token.
-
generateParseException
Generate ParseException.- Returns:
- new Exception object. Never
null
-
trace_enabled
public final boolean trace_enabled()- Returns:
- Always
false.
-
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-