Package nl.rrd.wool.model.command
Class WoolExpressionCommand
- java.lang.Object
-
- nl.rrd.wool.model.command.WoolCommand
-
- nl.rrd.wool.model.command.WoolExpressionCommand
-
- Direct Known Subclasses:
WoolIfCommand,WoolSetCommand
public abstract class WoolExpressionCommand extends WoolCommand
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classWoolExpressionCommand.ParseContentResultprotected static classWoolExpressionCommand.ReadContentResult
-
Constructor Summary
Constructors Constructor Description WoolExpressionCommand()
-
Method Summary
Modifier and Type Method Description protected static WoolExpressionCommand.ParseContentResultparseCommandContent(WoolBodyToken cmdStartToken, WoolExpressionCommand.ReadContentResult content)Parses the specified command content.protected static WoolExpressionCommand.ParseContentResultparseCommandContentExpression(WoolBodyToken cmdStartToken, WoolExpressionCommand.ReadContentResult content, String name)Parses the specified command content.protected static WoolExpressionCommand.ParseContentResultparseCommandContentName(WoolBodyToken cmdStartToken, WoolExpressionCommand.ReadContentResult content, String name)Parses the specified command content.protected static WoolExpressionCommand.ReadContentResultreadCommandContent(WoolBodyToken cmdStartToken, CurrentIterator<WoolBodyToken> tokens)Reads the content of a command as a code string.-
Methods inherited from class nl.rrd.wool.model.command.WoolCommand
executeBodyCommand, findReplyById, getNodePointers, getReadVariableNames, getWriteVariableNames
-
-
-
-
Method Detail
-
readCommandContent
protected static WoolExpressionCommand.ReadContentResult readCommandContent(WoolBodyToken cmdStartToken, CurrentIterator<WoolBodyToken> tokens) throws LineNumberParseException
Reads the content of a command as a code string. When this method returns, the iterator will be positioned after the command end token.- Parameters:
cmdStartToken- the command start tokentokens- the token iterator positioned after the command start token- Returns:
- the content
- Throws:
LineNumberParseException- if a parsing error occurs
-
parseCommandContentName
protected static WoolExpressionCommand.ParseContentResult parseCommandContentName(WoolBodyToken cmdStartToken, WoolExpressionCommand.ReadContentResult content, String name) throws LineNumberParseException
Parses the specified command content. This method checks whether the command name is the specified name, and there is no expression.- Parameters:
cmdStartToken- the command start tokencontent- the command contentname- the command name- Returns:
- the parsed content
- Throws:
LineNumberParseException- if a parsing error occurs
-
parseCommandContentExpression
protected static WoolExpressionCommand.ParseContentResult parseCommandContentExpression(WoolBodyToken cmdStartToken, WoolExpressionCommand.ReadContentResult content, String name) throws LineNumberParseException
Parses the specified command content. This method checks whether the command name is the specified name, and there is an expression.- Parameters:
cmdStartToken- the command start tokencontent- the command contentname- the command name- Returns:
- the parsed content
- Throws:
LineNumberParseException- if a parsing error occurs
-
parseCommandContent
protected static WoolExpressionCommand.ParseContentResult parseCommandContent(WoolBodyToken cmdStartToken, WoolExpressionCommand.ReadContentResult content) throws LineNumberParseException
Parses the specified command content. It tries to read a command name and an expression. If there is no expression, then the expression in the result will be null.- Parameters:
cmdStartToken- the command start tokencontent- the command content- Returns:
- the parsed content
- Throws:
LineNumberParseException- if a parsing error occurs
-
-