polyglot.ext.jl.ast
Class FloatLit_c

java.lang.Object
  extended by polyglot.ext.jl.ast.Node_c
      extended by polyglot.ext.jl.ast.Term_c
          extended by polyglot.ext.jl.ast.Expr_c
              extended by polyglot.ext.jl.ast.Lit_c
                  extended by polyglot.ext.jl.ast.FloatLit_c
All Implemented Interfaces:
java.lang.Cloneable, Expr, FloatLit, JL, Lit, Node, NodeOps, Prefix, Receiver, Term, Typed, Copy

public class FloatLit_c
extends Lit_c
implements FloatLit

A FloatLit represents a literal in java of type float or double.


Nested Class Summary
 
Nested classes/interfaces inherited from interface polyglot.ast.FloatLit
FloatLit.Kind
 
Field Summary
protected  FloatLit.Kind kind
           
protected  double value
           
 
Fields inherited from class polyglot.ext.jl.ast.Expr_c
type
 
Fields inherited from class polyglot.ext.jl.ast.Term_c
exceptions, reachable
 
Fields inherited from class polyglot.ext.jl.ast.Node_c
del, ext, position
 
Fields inherited from interface polyglot.ast.FloatLit
DOUBLE, FLOAT
 
Constructor Summary
FloatLit_c(Position pos, FloatLit.Kind kind, double value)
           
 
Method Summary
 java.lang.Object constantValue()
          Returns the constant value of the expression, if any.
 FloatLit.Kind kind()
          Get the kind of the literal.
 FloatLit kind(FloatLit.Kind kind)
          Set the kind of the literal.
 Precedence precedence()
          Get the precedence of the expression.
 void prettyPrint(CodeWriter w, PrettyPrinter tr)
          Write the expression to an output file.
 java.lang.String toString()
           
 Node typeCheck(TypeChecker tc)
          Type check the expression.
 double value()
          Get the value of the expression.
 FloatLit value(double value)
          Set the value of the expression.
 
Methods inherited from class polyglot.ext.jl.ast.Lit_c
acceptCFG, entry, isConstant
 
Methods inherited from class polyglot.ext.jl.ast.Expr_c
booleanValue, buildTypes, byteValue, charValue, doubleValue, dump, floatValue, intValue, longValue, printSubExpr, printSubExpr, shortValue, stringValue, type, type
 
Methods inherited from class polyglot.ext.jl.ast.Term_c
exceptionCheck, exceptions, exceptions, listEntry, reachable, reachable
 
Methods inherited from class polyglot.ext.jl.ast.Node_c
addDecls, addMembers, addMembersEnter, addMembersOverride, buildTypesEnter, buildTypesOverride, childExpectedType, copy, del, del, disambiguate, disambiguateEnter, disambiguateOverride, enterScope, enterScope, exceptionCheckEnter, exceptionCheckOverride, ext, ext, ext, ext, init, node, position, position, print, printBlock, printSubStmt, throwTypes, translate, typeCheckEnter, typeCheckOverride, visit, visitChild, visitChildren, visitEdge, visitList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface polyglot.ast.Expr
isConstant, printSubExpr, printSubExpr, type
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
 
Methods inherited from interface polyglot.ast.JL
init, node
 
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, throwTypes, translate, typeCheckEnter, visitChildren
 
Methods inherited from interface polyglot.util.Copy
copy
 
Methods inherited from interface polyglot.ast.Typed
type
 
Methods inherited from interface polyglot.ast.Term
acceptCFG, entry, exceptions, exceptions, reachable, reachable
 

Field Detail

kind

protected FloatLit.Kind kind

value

protected double value
Constructor Detail

FloatLit_c

public FloatLit_c(Position pos,
                  FloatLit.Kind kind,
                  double value)
Method Detail

kind

public FloatLit.Kind kind()
Get the kind of the literal.

Specified by:
kind in interface FloatLit

kind

public FloatLit kind(FloatLit.Kind kind)
Set the kind of the literal.

Specified by:
kind in interface FloatLit

value

public double value()
Get the value of the expression.

Specified by:
value in interface FloatLit

value

public FloatLit value(double value)
Set the value of the expression.

Specified by:
value in interface FloatLit

typeCheck

public Node typeCheck(TypeChecker tc)
               throws SemanticException
Type check the expression.

Specified by:
typeCheck in interface NodeOps
Overrides:
typeCheck in class Node_c
Parameters:
tc - The type checking visitor.
Throws:
SemanticException

toString

public java.lang.String toString()
Overrides:
toString in class Node_c

prettyPrint

public void prettyPrint(CodeWriter w,
                        PrettyPrinter tr)
Write the expression to an output file.

Specified by:
prettyPrint in interface NodeOps
Overrides:
prettyPrint in class Node_c
Parameters:
w - The code writer to which to write.
tr - The pretty printer. This is not a visitor.

constantValue

public java.lang.Object constantValue()
Description copied from interface: Expr
Returns the constant value of the expression, if any.

Specified by:
constantValue in interface Expr
Specified by:
constantValue in class Lit_c

precedence

public Precedence precedence()
Description copied from class: Lit_c
Get the precedence of the expression.

Specified by:
precedence in interface Expr
Overrides:
precedence in class Lit_c