public class PoshParser extends Object implements PoshParserConstants
| Modifier and Type | Field and Description |
|---|---|
Token |
jj_nt
Next token.
|
Token |
token
Current token.
|
PoshParserTokenManager |
token_source
Generated Token Manager.
|
AD, AP, COMMA, COMMENT, COMPETENCE, DC, DEFAULT, DOCUMENTATION, DRIVES, ELEMENTS, ENUM_VALUE, EOF, EQUAL_SIGN, ERROR_CHARS, FALSE, GOAL, HOURS, HZ, JAVA_IDENTIFIER, LBRACE, MINUTES, NAME, NIL, NONE, NUMFLOAT, NUMINT, PM, PREDICATE, RBRACE, SECONDS, SINGLE_LINE_COMMENT, tokenImage, TRIGGER, TRUE, VARIABLE, VARS| Constructor and Description |
|---|
PoshParser(InputStream stream)
Constructor with InputStream.
|
PoshParser(InputStream stream,
String encoding)
Constructor with InputStream and supplied encoding
|
PoshParser(PoshParserTokenManager tm)
Constructor with generated Token Manager.
|
PoshParser(Reader stream)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ActionPattern |
actionPattern()
action-pattern ::= AP NAME ( NIL | "("
|
void |
actionPatternElements(ActionPattern ap,
FormalParameters formalParameters)
process actions of the AP and add them into the passed ap.
|
Adopt |
adapt()
adapt ::= AD NAME [
|
cz.cuni.amis.pogamut.sposh.elements.PoshParser.Packet<Arguments.Argument,Boolean> |
callParameter(int index,
boolean named)
Parameter used when calling C/AP/sense/action
callParameter ::
|
Arguments |
callParametersList(FormalParameters formalParameters)
callParametersList:: callParameter() ( "," callParameter() )* ")"
|
Competence |
competence()
competence ::= C NAME ( NIL | "("
|
CompetenceElement |
competenceElement(FormalParameters formalParameters)
competence-element ::= "(" NAME [ "("
|
List<Sense> |
competenceGoal(FormalParameters formalParameters)
( NIL | "("
|
List<CompetenceElement> |
competencePriorities(FormalParameters formalParameters)
competence-priorities ::=
|
void |
disable_tracing()
Disable tracing.
|
void |
docString(PoshPlan plan)
docstring ::= DOCUMENTATION COMMENT COMMENT COMMENT ")"
|
void |
driveCollection(DriveCollection dc)
Take passed drive collection and put the data (name, drives) into it.
|
void |
driveCollectionGoal(DriveCollection dc,
FormalParameters formalParameters)
Process goal of DC (if exists)
|
DriveElement |
driveElement(FormalParameters formalParameters)
Create a drive and return it.
|
cz.cuni.amis.pogamut.sposh.elements.PoshParser.Packet<Arguments,Freq> |
driveElementActionFreq(FormalParameters formalParameters)
Nonterminal for possible arguments of the action call of the drive action and
the frequency.
|
Freq |
driveElementFreq()
Get specified frequency.
|
List<Sense> |
driveElementTrigger(FormalParameters formalParameters)
Read trigger (list of senses) and return it.
|
void |
enable_tracing()
Enable tracing.
|
Freq |
freq()
freq ::=
|
Freq.FreqUnits |
freqUnit()
freq-unit ::= HOURS | MINUTES | SECONDS | HZ | PM | NONE
|
Sense |
fullSense(FormalParameters formalParameters)
full-sense ::= "(" NAME [
|
ParseException |
generateParseException()
Generate ParseException.
|
Token |
getNextToken()
Get the next Token.
|
Token |
getToken(int index)
Get the specific Token.
|
List<Sense> |
goal(FormalParameters formalParameters)
Process goal sense and return them.
|
String |
optComment()
Optional comment, if no comment, return blank string.
|
int |
optRetries()
Optional number of retries.
|
FormalParameters |
parameters()
Declare parameters in C or AP.
|
PoshPlan |
parsePlan()
FIXME: According to official grammar, plan can consists only from single
competence or action pattern.
|
void |
planFirstElement(PoshPlan plan)
[ "("
|
void |
planFirstHalf(PoshPlan plan)
First half of plan rule
|
void |
planSecondHalf(PoshPlan plan)
( "("
|
void |
planSecondHalfElements(PoshPlan plan)
(
|
void |
ReInit(InputStream stream)
Reinitialise.
|
void |
ReInit(InputStream stream,
String encoding)
Reinitialise.
|
void |
ReInit(PoshParserTokenManager tm)
Reinitialise.
|
void |
ReInit(Reader stream)
Reinitialise.
|
PrimitiveCall |
senseCall(FormalParameters formalParameters)
SenseCall
sense::
|
void |
sensePredicate(cz.cuni.amis.pogamut.sposh.elements.SenseComponents _senseComp)
predicate ::= PREDICATE
|
List<Sense> |
senses(FormalParameters formalParameters)
Get senses (if there are any) and return them.
|
List<Sense> |
sensesList(FormalParameters formalParameters)
( NAME |
|
Sense |
sensesListElement(FormalParameters formalParameters)
NAME |
|
void |
senseValue(cz.cuni.amis.pogamut.sposh.elements.SenseComponents _senseComp)
value ::= NUMINT | NUMFLOAT | NAME | ENUM_VALUE | NIL
Part of full-sense parsing.
|
SolTime |
time()
time ::=
|
SolTime.TimeUnits |
timeUnit()
time-unit ::= HOURS | MINUTES | SECONDS | NONE
|
List<Sense> |
trigger(FormalParameters formalParameters)
Get list of senses of a trigger.
|
Object |
value() |
FormalParameters.Parameter |
varDeclaration()
varDeclare::
|
public PoshParserTokenManager token_source
public Token token
public Token jj_nt
public PoshParser(InputStream stream)
public PoshParser(InputStream stream, String encoding)
public PoshParser(Reader stream)
public PoshParser(PoshParserTokenManager tm)
public final PoshPlan parsePlan() throws ParseException
ParseExceptionpublic final void planFirstElement(PoshPlan plan) throws ParseException
ParseExceptionpublic final void planFirstHalf(PoshPlan plan) throws ParseException
ParseExceptionpublic final void planSecondHalf(PoshPlan plan) throws ParseException
ParseExceptionpublic final void planSecondHalfElements(PoshPlan plan) throws ParseException
ParseExceptionpublic final void docString(PoshPlan plan) throws ParseException
ParseExceptionpublic final void driveCollection(DriveCollection dc) throws ParseException
driveCollection() :: "DC"XXX: It has extra braces around[ ] "(" "drives" ( "(" + ")" )+ ")" ")"
ParseExceptionpublic final void driveCollectionGoal(DriveCollection dc, FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final List<Sense> goal(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final DriveElement driveElement(FormalParameters formalParameters) throws ParseException
drive-element ::= "(" NAME ( NIL | "(" | ) NAME ( NIL | "(" | ) ")"
ParseExceptionpublic final cz.cuni.amis.pogamut.sposh.elements.PoshParser.Packet<Arguments,Freq> driveElementActionFreq(FormalParameters formalParameters) throws ParseException
driveElementActionFreq:: ( | "(" ( | ) | )
I should probably use lookahead of 2 or more, but I really need this fast
for continuous syntax highlighting.ParseExceptionpublic final List<Sense> driveElementTrigger(FormalParameters formalParameters) throws ParseException
( NIL | "(" | )
Part of driveElement ruleParseExceptionpublic final Freq driveElementFreq() throws ParseException
Freq.INFINITE.
( NIL | "(" ParseExceptionpublic final Competence competence() throws ParseException
ParseExceptionpublic final FormalParameters parameters() throws ParseException
ParseExceptionpublic final FormalParameters.Parameter varDeclaration() throws ParseException
ParseExceptionpublic final List<Sense> competenceGoal(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final List<CompetenceElement> competencePriorities(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final CompetenceElement competenceElement(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final int optRetries()
throws ParseException
CompetenceElement.INFINITE_RETRIES.ParseExceptionpublic final String optComment() throws ParseException
ParseExceptionpublic final ActionPattern actionPattern() throws ParseException
ParseExceptionpublic final Adopt adapt() throws ParseException
ParseExceptionpublic final void actionPatternElements(ActionPattern ap, FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final SolTime time() throws ParseException
ParseExceptionpublic final SolTime.TimeUnits timeUnit() throws ParseException
ParseExceptionpublic final Freq freq() throws ParseException
ParseExceptionpublic final Freq.FreqUnits freqUnit() throws ParseException
ParseExceptionpublic final List<Sense> trigger(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final List<Sense> senses(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final List<Sense> sensesList(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final Sense sensesListElement(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final Sense fullSense(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final PrimitiveCall senseCall(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final Arguments callParametersList(FormalParameters formalParameters) throws ParseException
ParseExceptionpublic final cz.cuni.amis.pogamut.sposh.elements.PoshParser.Packet<Arguments.Argument,Boolean> callParameter(int index, boolean named) throws ParseException
named - was at least one named call parameter specified in the list before this one?ParseExceptionpublic final void senseValue(cz.cuni.amis.pogamut.sposh.elements.SenseComponents _senseComp)
throws ParseException
ParseExceptionpublic final void sensePredicate(cz.cuni.amis.pogamut.sposh.elements.SenseComponents _senseComp)
throws ParseException
ParseExceptionpublic final Object value() throws ParseException
ParseExceptionpublic void ReInit(InputStream stream)
public void ReInit(InputStream stream, String encoding)
public void ReInit(Reader stream)
public void ReInit(PoshParserTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
Copyright © 2018 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.