1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. package Scripting.Expressions.Literals is 
  10.  
  11.     -- A Literal is a literal value (boolean, number, or string) in an 
  12.     -- expression. 
  13.     type Literal is new Expression with private; 
  14.     type A_Literal is access all Literal'Class; 
  15.  
  16.     -- Creates a new Literal from a Token representing a literal value. If the 
  17.     -- token is not a value type, null will be returned. 
  18.     function Create_Literal( token : not null A_Token ) return A_Literal; 
  19.  
  20. private 
  21.  
  22.     type Literal is new Expression with 
  23.         record 
  24.             value : Value_Ptr; 
  25.         end record; 
  26.  
  27.     procedure Construct( this  : access Literal; 
  28.                          loc   : Token_Location; 
  29.                          value : Value_Ptr'Class ); 
  30.  
  31.     function Evaluate( this    : access Literal; 
  32.                        context : not null A_Eval_Context ) return Value_Ptr; 
  33.  
  34. end Scripting.Expressions.Literals;