/** Returns the text of the conditional expression. */ public String getExprText() { return exprUnion.getExprText(); }
/** Returns a new {@link IfCondNode} built from this builder's state. */ public IfCondNode build(ErrorReporter unusedForNow) { ExprUnion condition = ExprUnion.parseWithV1Fallback(commandText, sourceLocation); return new IfCondNode(id, sourceLocation, commandName, condition); }
/** * @param id The id for this node. * @param commandName The command name -- either 'if' or 'elseif'. * @param exprUnion Determines when the body is performed. */ public IfCondNode( int id, SourceLocation sourceLocation, String commandName, ExprUnion exprUnion) { super(id, sourceLocation, commandName, exprUnion.getExprText()); Preconditions.checkArgument(commandName.equals("if") || commandName.equals("elseif")); this.exprUnion = Preconditions.checkNotNull(exprUnion); }
@Override public String getCommandText() { return exprUnion.getExprText(); }