next up previous
Next: Class literal Up: Expressions Previous: Expressions

Lexical literals

A literal denotes a fixed, unchanging value. Its type is defined by the language for each kind of literal. All literals are primary contexts:

Lexical literals[46]:
RULE: Expression ::= CharacterLiteral COMPUTE
  PrimaryContext(Expression,charType);
END;

RULE: Expression ::= IntLiteral COMPUTE
  PrimaryContext(Expression,intType);
END;

RULE: Expression ::= LongLiteral COMPUTE
  PrimaryContext(Expression,longType);
END;

RULE: Expression ::= FloatLiteral COMPUTE
  PrimaryContext(Expression,floatType);
END;

RULE: Expression ::= DoubleLiteral COMPUTE
  PrimaryContext(Expression,doubleType);
END;

RULE: Expression ::= 'false' COMPUTE
  PrimaryContext(Expression,boolType);
END;

RULE: Expression ::= 'true' COMPUTE
  PrimaryContext(Expression,boolType);
END;

RULE: Expression ::= 'null' COMPUTE
  PrimaryContext(Expression,nullType);
END;

RULE: Expression ::= StringLiteral COMPUTE
  PrimaryContext(Expression,stringType);
END;
This macro is invoked in definition 45.



2008-09-11