Mercury library  1.0
Translation of CFG grammars into an object model (Bachelor's thesis).
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Argument.cs
Go to the documentation of this file.
1 using System;
2 
3 namespace Mercury.Interpreting
4 {
5 //=============================================================================
6 // Argument
7 //=============================================================================
8 
10  [Flags]
11  public enum ArgumentType
12  {
14  None = 0,
15 
16  //--[ Basic types ]--------------------------------------------------
17 
19  Integer = 1,
21  Real = 2,
23  Boolean = 4,
25  String = 8,
27  Symbol = 16,
29  Tree = 32,
31  TValue = 64,
32 
33  //--[ Type masks ]---------------------------------------------------
34 
40  Any = Primitive | ParserEntity | TValue,
41 
42  //--[ Special flags ]------------------------------------------------
43 
45  Null = 128,
47  Lazy = 256 | Null,
49  Flags = Null | Lazy,
50 
51  }
52 
58  public class Argument
59  {
60  //--[ Internal ]-----------------------------------------------------
61 
62  internal virtual object Data { get; set; }
63 
64  internal Argument(ArgumentType type, object value)
65  {
66  Type = type;
67  Data = value;
68  }
69 
70  //--[ Properties ]---------------------------------------------------
71 
73  public virtual ArgumentType Type { get; internal set; }
74 
76  public dynamic Value { get { return Data; } }
77  }
78 }
Lazy evaluation flag. Must be used with other types to have effect
ArgumentType
Defines argument types using in the Mercury library
Definition: Argument.cs:11
Represents an argument passed to the Mercury.Interpreting.InterpreterAction{T}, the actual parameter ...
Definition: Argument.cs:58
Accepts null value. Must be used with other types to have effect
Primitive data types
A derivation tree
No failure
A value of the type passed to the interpreter