Lombok.ast - v0.2

lombok.ast
Interface Expression

All Superinterfaces:
AnnotationValue, Node
All Known Implementing Classes:
ArrayAccess, ArrayCreation, ArrayInitializer, BinaryExpression, BooleanLiteral, Cast, CharLiteral, ClassLiteral, ConstructorInvocation, FloatingPointLiteral, InlineIfExpression, InstanceOf, IntegralLiteral, MethodInvocation, NullLiteral, Select, StringLiteral, Super, This, UnaryExpression, VariableReference

public interface Expression
extends Node, AnnotationValue


Method Summary
 List<Position> astParensPositions()
          Returns the start/end position of each paren pair around this node.
 int getIntendedParens()
          Returns the same value as getParens(), unless that method returns 0, and needsParentheses() is true, then this method returns 1.
 int getParens()
          Returns the actual amount of parentheses physically around this expression.
 boolean isStatementExpression()
          Returns true if the given expression is a valid statement expression.
 boolean needsParentheses()
          Returns true if the expression would need parentheses because without them the interpretation of this node would be different, due to operator precedence rules.
 
Methods inherited from interface lombok.ast.Node
accept, addMessage, copy, detach, getChildren, getGeneratedBy, getMessages, getParent, getPosition, hasMessage, hasParent, isGenerated, replace, replaceChild, setPosition, toString, unparent
 

Method Detail

getParens

int getParens()
Returns the actual amount of parentheses physically around this expression.

See Also:
astParensPositions(), getIntendedParens()

getIntendedParens

int getIntendedParens()
Returns the same value as getParens(), unless that method returns 0, and needsParentheses() is true, then this method returns 1.


astParensPositions

List<Position> astParensPositions()
Returns the start/end position of each paren pair around this node. The only canonical aspect of this list is the size of it. The positions are set to appropriate files after parsing, from the innermost parens at index 0 to the outermost at the final index.

See Also:
getParens()

needsParentheses

boolean needsParentheses()
Returns true if the expression would need parentheses because without them the interpretation of this node would be different, due to operator precedence rules.

See Also:
getIntendedParens()

isStatementExpression

boolean isStatementExpression()
Returns true if the given expression is a valid statement expression. Statement expressions can be executed as statements simply by appending a semicolon to them.


Lombok.ast - v0.2

Copyright © 2010-2011 The Project Lombok Authors, licensed under the MIT licence.