/// <summary> /// Initializes a new instance of the <see cref="Token"/> class. /// </summary> /// <param name="definition">The type of token and how it was defined.</param> /// <param name="value">The value stored within the token.</param> /// <param name="sourceMap">The original string and position this token was extracted from.</param> public Token(GrammerDefinition definition, string value, StringSegment sourceMap) { this.Definition = definition; this.Value = value; this.SourceMap = sourceMap; }
/// <summary> /// Initializes a new instance of the <see cref="Operator"/> class. /// </summary> /// <param name="definition">The grammer that defined this Operator.</param> /// <param name="sourceMap">The original string and position this entire operand is from.</param> /// <param name="execute">The action to run when applying this operator.</param> public Operator(GrammerDefinition definition, StringSegment sourceMap, Action execute) { this.Execute = execute; this.SourceMap = sourceMap; this.Definition = definition; }