Mercury library 1.0 Translation of CFG grammars into an object model (Bachelor's thesis).

- Main Page
- Packages
- Classes
- Files

- File List

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
36 Primitive = Integer | Real | String | Boolean,
38 ParserEntity = Symbol | Tree,
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 }
Mercury.Interpreting.Lazy
Lazy evaluation flag. Must be used with other types to have effect
Mercury.Interpreting.Integer
Integer value
Mercury.Interpreting.Real
Real value
Mercury.Interpreting.Boolean
Boolean value
Mercury.Interpreting.ArgumentType
ArgumentType
Defines argument types using in the Mercury library
Definition: Argument.cs:11
Mercury.Interpreting.Symbol
A single symbol
Mercury.Interpreting.Flags
All flags
Mercury.Interpreting.Argument
Represents an argument passed to the Mercury.Interpreting.InterpreterAction{T}, the actual parameter ...
Definition: Argument.cs:58
Mercury.Interpreting.Null
Accepts null value. Must be used with other types to have effect
Mercury.Interpreting.Primitive
Primitive data types
Mercury.Interpreting.String
String value
Mercury.Interpreting.Tree
A derivation tree
Mercury.Interpreting.Any
Any argument
Mercury.None
No failure
Mercury.Interpreting.TValue
A value of the type passed to the interpreter
Mercury.Interpreting.ParserEntity
Grammar entity