Follow the links below to browse sample Javadoc for MJ classes and tools, including the MJ Runtime Library.
com.arsi.mj.maprpt.lexer.ptree.cmd.iff
contains the following classes and interfaces.
Classes and Interfaces | |
ComputedGotoParseNode | Parse node that represents a IF RUN command with computed-goto
syntax (as opposed to IF-THEN-ELSE syntax). |
IfCommandParser | Parses a IF RUN command. |
IfParseNode | Base class for parse nodes that represents flavors of IF RUN command. |
IfThenElseParseNode | Parse node that represents a IF RUN command with the IF-THEN or
IF-THEN-ELSE syntax (as opposed to a computed-goto). |
IF
RUN command with computed-goto
syntax (as opposed to IF-THEN-ELSE syntax).
public class com.arsi.mj.maprpt.lexer.ptree.cmd.iff.ComputedGotoParseNode
extends com.arsi.mj.maprpt.lexer.ptree.cmd.iff.IfParseNode
implements com.arsi.mj.maprpt.lexer.ptree.cmd.ctrlflow.IJumptoCmdInfo, com.arsi.mj.maprpt.lexer.ptree.cmd.ctrlflow.IMapperSubexprCmdInfo, com.arsi.mj.maprpt.lexer.symtab.ISupportsVariableReference
Constructors |
Initializes an instance of this class.
public ComputedGotoParseNode(com.arsi.mj.maprpt.parser.line.types.AtLine aHostLine, com.arsi.mj.maprpt.lexer.ptree.expr.ICommandOptionExpr anOptionExpr, java.util.List someFirstOperandExprs, com.arsi.mj.maprpt.lexer.ptree.symbol.RelationalOperator aFirstOperandRelop, java.util.List someGotoOperands)
|
Methods |
public boolean allowFallthru()
|
Get ID that uniquely identifies MapperSubexprInfo object for ELSE parse
tree returned by this command node via IMapperSubexprCmdInfo interface.
public final int getElseSubexprCmdInfoId()
|
Get the goto operands, where an operand is one or more value expressions to match and
line or label to jump when value of expression is matched.
public final java.util.List getGotoOperands()
|
Perform recursive introspection to discover jump-to expressions in goto operands and ELSE clauses.
public java.util.List jumptoExpressions(int anId)
|
Perform recursive introspection to discover jump-to literals in goto operands and ELSE clauses.
public java.util.List jumptoLiterals(int anId)
|
public java.util.List referencedVariables()
|
Perform recursive introspection to discover Mapper sub-commands in ELSE clause.
public java.util.List subExpressions(int anId)
|
IF
RUN command.
public class com.arsi.mj.maprpt.lexer.ptree.cmd.iff.IfCommandParser
extends com.arsi.mj.maprpt.lexer.ptree.cmd.RunCommandParserBase
implements com.arsi.mj.maprpt.lexer.ptree.cmd.IRunCommandParser
Inner Class GotoOperand |
Represents an operand in a computed-goto IF statement.
public static class com.arsi.mj.maprpt.lexer.ptree.cmd.iff.IfCommandParser.GotoOperand
|
Expression that yields label or line offset, NULL if literalCallback is not NULL.public final com.arsi.mj.maprpt.lexer.ptree.expr.ConcatExpr jumpExpr
Stores literal label or line number offset, NULL if concatExpr is not NULL.public final com.arsi.mj.maprpt.lexer.ptree.cmd.litcbk.JumpExprCallback literalCallback
Value expressions to match, where each expression is an operand choice (OR'd operands). public final java.util.List valueExprs
|
Get ID that uniquely identifies either LiteralJumpInfo or ConcatExprJumpInfo
associated with this GOTO operand via IJumptoCmdInfo interface.
public final int getJumptoCmdInfoId() Set ID that associates either LiteralJumpInfo or ConcatExprJumpInfo
from the IJumptoCmdInfo interface with this GOTO operand.
public final void setJumptoCmdInfoId(int anId)
|
Inner Class RelationalOperatorAndOperand |
Bundles relational operator and right-side operand (left-side operand is implied
by context in which instance of this class is used).
public static class com.arsi.mj.maprpt.lexer.ptree.cmd.iff.IfCommandParser.RelationalOperatorAndOperand
|
public final java.util.List exprs
public final com.arsi.mj.maprpt.lexer.ptree.symbol.RelationalOperator relop
|
Constructors |
public IfCommandParser()
|
Methods |
public com.arsi.mj.maprpt.lexer.ptree.cmd.CommandParseResult parseCommand(com.arsi.mj.maprpt.lexer.tokens.IMaprptToken anInitialToken, com.arsi.mj.maprpt.lexer.MaprptLexer aLexer, org.springframework.context.ApplicationContext anAppCtx)
|
Parse computed goto operand, which may be a single concatenation expression or a list of
comma-separated concatenation expressions.
public com.arsi.mj.maprpt.lexer.ptree.cmd.iff.IfCommandParser.GotoOperandResult parseGotoOperand(com.arsi.mj.maprpt.lexer.tokens.IMaprptToken anInitialToken, com.arsi.mj.maprpt.lexer.MaprptLexer aLexer, java.lang.String aUserRID, int aLineNumber)
|
Parse IF operand, which may be a single concatenation expression or a list of
comma-separated concatenation expressions.
public com.arsi.mj.maprpt.lexer.ptree.cmd.iff.IfCommandParser.IfOperandResult parseIfOperand(com.arsi.mj.maprpt.lexer.tokens.IMaprptToken anInitialToken, com.arsi.mj.maprpt.lexer.MaprptLexer aLexer, java.lang.String aUserRID, int aLineNumber)
|
IF
RUN command.
public abstract class com.arsi.mj.maprpt.lexer.ptree.cmd.iff.IfParseNode
extends com.arsi.mj.maprpt.lexer.ptree.CommandParseNode
Fields |
Indicates if statements(s) in ptreeThen were terminated by a period,
meaning that ptreeElse is only executed when IF condition is false.
If not a proper if-then-else, ptreeElse is always executed (if not
null or empty) regardless of whether IF condition evaluates to true or false.public boolean isProperIfThenElse
|
Constructors |
Initializes an instance of this class.
public IfParseNode(com.arsi.mj.maprpt.parser.line.types.AtLine aHostLine, com.arsi.mj.maprpt.lexer.ptree.expr.ICommandOptionExpr anOptionExpr, java.util.List someFirstOperandExprs, com.arsi.mj.maprpt.lexer.ptree.symbol.RelationalOperator aFirstOperandRelop)
|
Methods |
Get parse tree of statements to execute when IF condition is false (or after THEN
statements, see isProperIfThenElse ).
public final com.arsi.mj.maprpt.lexer.ptree.MaprptParseTree getElseParseTree()
|
Get first operand in IF command, which is typically a reference to a variable
whose value is to be tested, or a literal if variable is on the right-side of the relational
operator. The Mapper interpreter supports a choice of operands (OR'd operands) instead of
a single operand, thus the list of expressions. For example, a variable on the right-side
of the relational operator may be tested against multiple values.
public final java.util.List getFirstOperandExprs()
|
Get the relational operator that applies to first operand (e.g., LESS_THAN ).
public final com.arsi.mj.maprpt.lexer.ptree.symbol.RelationalOperator getFirstOperandRelop()
|
Collect jump-to expressions from IF-THEN or ELSE parse tree.
protected void getJumptoExpressionsFromParseTree(int anId, java.util.List someJumpInfo, com.arsi.mj.maprpt.lexer.ptree.MaprptParseTree aParseTree)
|
Collect jump-to literals from IF-THEN or ELSE parse tree.
protected void getJumptoLiteralsFromParseTree(int anId, java.util.List someJumpInfo, com.arsi.mj.maprpt.lexer.ptree.MaprptParseTree aParseTree)
|
Get options applicable to command.
public final com.arsi.mj.maprpt.lexer.ptree.expr.ICommandOptionExpr getOptions()
|
Collect sub-expressions from IF-THEN or ELSE parse tree.
protected void getSubExpressionsFromParseTree(int anId, java.util.List someSubexprInfo, com.arsi.mj.maprpt.lexer.ptree.MaprptParseTree aParseTree)
|
Get parse tree of statements to execute when IF condition is true.
public final com.arsi.mj.maprpt.lexer.ptree.MaprptParseTree getThenParseTree()
|
Is a GTO command the last command node in the parse tree?
protected boolean isGotoLastCommandInParseTree(com.arsi.mj.maprpt.lexer.ptree.MaprptParseTree aParseTree)
|
Indicates if ELSE statements are only executed when IF condition is false.
If not a proper if-then-else,ELSE statements are always executed (if not
null or empty) regardless of whether IF condition evaluates to true or false.
public boolean isProperIfThenElse()
|
Set parse tree of statements to execute when IF condition is false.
public final void setElseParseTree(com.arsi.mj.maprpt.lexer.ptree.MaprptParseTree aParseTree)
|
Set whether ELSE statements are only executed when IF condition is false (i.e.,
a "proper" IF-THEN-ELSE statement).
public void setProperIfThenElse(boolean aProperFlag)
|
Set parse tree of statements to execute when IF condition is true.
public final void setThenParseTree(com.arsi.mj.maprpt.lexer.ptree.MaprptParseTree aParseTree)
|
IF
RUN command with the IF-THEN or
IF-THEN-ELSE syntax (as opposed to a computed-goto).IMapperSubexprCmdInfo
and IJumptoCmdInfo
interfaces,
it must perform recursive introspection.
public class com.arsi.mj.maprpt.lexer.ptree.cmd.iff.IfThenElseParseNode
extends com.arsi.mj.maprpt.lexer.ptree.cmd.iff.IfParseNode
implements com.arsi.mj.maprpt.lexer.ptree.cmd.ctrlflow.IJumptoCmdInfo, com.arsi.mj.maprpt.lexer.ptree.cmd.ctrlflow.IMapperSubexprCmdInfo, com.arsi.mj.maprpt.lexer.symtab.ISupportsVariableReference
Constructors |
Initializes an instance of this class.
public IfThenElseParseNode(com.arsi.mj.maprpt.parser.line.types.AtLine aHostLine, com.arsi.mj.maprpt.lexer.ptree.expr.ICommandOptionExpr anOptionExpr, java.util.List someFirstOperandExprs, com.arsi.mj.maprpt.lexer.ptree.symbol.RelationalOperator aFirstOperandRelop, java.util.List someSecondOperandExprs, java.util.List someExtraOperands)
|
Methods |
public boolean allowFallthru()
|
Get ID that uniquely identifies MapperSubexprInfo object for ELSE parse
tree returned by this command node via IMapperSubexprCmdInfo interface.
public final int getElseSubexprCmdInfoId()
|
Get additional relational operator(s) and right-side operands connected to second operand
via AND (ampersand) operator.
public final java.util.List getExtraOperands()
|
Get second operand in IF command (follows first operand and relational
operator), such as reference to a variable whose value is to be compared (or tested),
or a literal. All relational operators are binary and require two arguments.This may be a choice of operands (OR'd operands) instead of a single operand, thus the list of expressions. For example, a variable on left-side of relational operator (1st operand) may be tested against multiple values (2nd operand).
public final java.util.List getSecondOperandExprs()
|
Get ID that uniquely identifies MapperSubexprInfo object for IF-THEN parse
tree returned by this command node via IMapperSubexprCmdInfo interface.
public final int getThenSubexprCmdInfoId()
|
Perform recursive introspection to discover jump-to expressions in IF-THEN and ELSE clauses.
public java.util.List jumptoExpressions(int anId)
|
Perform recursive introspection to discover jump-to literals in IF-THEN and ELSE clauses.
public java.util.List jumptoLiterals(int anId)
|
public java.util.List referencedVariables()
|
Perform recursive introspection to discover Mapper sub-commands in IF-THEN and ELSE clauses.
public java.util.List subExpressions(int anId)
|