1 using Mercury.Nucleus.Trees;
4 using System.Collections.Concurrent;
5 using System.Collections.Generic;
6 using System.Runtime.Caching;
8 namespace Mercury.Interpreting
18 public abstract class InterpreterContext<T>
26 internal Dictionary<string, Argument> bindings;
27 internal MemoryCache cache = null;
29 internal string action;
44 internal void LogEntryEx(
string hdr,
string msg, params
object[] args)
46 if (cnode == null)
throw new InvalidOperationException();
47 cnode.Entries.Add(
new TextEntry(hdr, msg, args));
56 { bindings =
new Dictionary<string, Argument>(); }
80 public void LogEntry(
string text, params
object[] args)
81 { LogEntryEx(action, text, args); }
104 internal class InternalContext<T> : InterpreterContext<T>
108 {
return new InternalContext<T>(); }
110 public override void CopyFrom(InterpreterContext<T> other)
126 {
return new InternalContext<T>(); }
Describes a rule that has been used to interpret a tree.
Represents an entry for tree interpretation.
Stores informations logged by actions or internal Evaluator.
ArgumentType
Defines argument types using in the Mercury library
InterpreterContext()
Initializes a new instance of the InterpreterContext{T} class.
void LogEntry(string text, params object[] args)
Logs an event into the history.
Interpreter Context class. Some languages may use it to override it and remember data when parse tree...
Produces contexts with no custom data