| using Nemerle.Builtins;
using Nemerle.Collections;
using Nemerle.Core;
using Nemerle.Parser;
using Nemerle.Parser.Internal;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
public abstract class CalcParser
{
public sealed class GrammarImpl : CalcParser, IGrammar
{
public sealed class GrammarDescriptorImpl : GrammarDescriptor
{
public class _#postfix#_add_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"+"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_add_ _staticDescriptor;
public override string Name
{
get
{
return "add";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_add_._staticDescriptor;
}
}
static _#postfix#_add_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_add_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_add_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_add_._token_literal_"+"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_add_._staticDescriptor, "+", true);
}
public CalcParser.Add ResultType()
{
return null;
}
private _#postfix#_add_()
{
}
}
public class _#regular#_any_ : RuleDescriptor
{
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#regular#_any_ _staticDescriptor;
public override string Name
{
get
{
return "any";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#regular#_any_._staticDescriptor;
}
}
static _#regular#_any_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#regular#_any_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#regular#_any_();
}
private _#regular#_any_()
{
}
}
public class _#postfix#_cond_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"?"_;
public static readonly TokenDescriptor _token_literal_":"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_ _staticDescriptor;
public override string Name
{
get
{
return "cond";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_._staticDescriptor;
}
}
static _#postfix#_cond_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_._token_literal_":"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_._staticDescriptor, ":", true);
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_._token_literal_"?"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_._staticDescriptor, "?", true);
}
public CalcParser.Cond ResultType()
{
return null;
}
private _#postfix#_cond_()
{
}
}
public class _#postfix#_div_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"/"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_div_ _staticDescriptor;
public override string Name
{
get
{
return "div";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_div_._staticDescriptor;
}
}
static _#postfix#_div_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_div_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_div_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_div_._token_literal_"/"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_div_._staticDescriptor, "/", true);
}
public CalcParser.Div ResultType()
{
return null;
}
private _#postfix#_div_()
{
}
}
public class _#point#___expr_ : RuleDescriptor
{
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#point#___expr_ _staticDescriptor;
public override string Name
{
get
{
return "expr";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#point#___expr_._staticDescriptor;
}
}
static _#point#___expr_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#point#___expr_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#point#___expr_();
}
public CalcParser.Expr ResultType()
{
return null;
}
private _#point#___expr_()
{
}
}
public class _#postfix#_mod_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"%"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mod_ _staticDescriptor;
public override string Name
{
get
{
return "mod";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mod_._staticDescriptor;
}
}
static _#postfix#_mod_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mod_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mod_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mod_._token_literal_"%"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mod_._staticDescriptor, "%", true);
}
public CalcParser.Mod ResultType()
{
return null;
}
private _#postfix#_mod_()
{
}
}
public class _#postfix#_mul_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"*"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mul_ _staticDescriptor;
public override string Name
{
get
{
return "mul";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mul_._staticDescriptor;
}
}
static _#postfix#_mul_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mul_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mul_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mul_._token_literal_"*"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mul_._staticDescriptor, "*", true);
}
public CalcParser.Mul ResultType()
{
return null;
}
private _#postfix#_mul_()
{
}
}
public class _#prefix#__neg_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"-"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__neg_ _staticDescriptor;
public override string Name
{
get
{
return "neg";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__neg_._staticDescriptor;
}
}
static _#prefix#__neg_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__neg_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__neg_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__neg_._token_literal_"-"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__neg_._staticDescriptor, "-", true);
}
public CalcParser.Neg ResultType()
{
return null;
}
private _#prefix#__neg_()
{
}
}
public class _#prefix#__num_ : RuleDescriptor
{
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__num_ _staticDescriptor;
public override string Name
{
get
{
return "num";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__num_._staticDescriptor;
}
}
static _#prefix#__num_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__num_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__num_();
}
public CalcParser.Num ResultType()
{
return null;
}
private _#prefix#__num_()
{
}
}
public class _#postfix#_postfixDec_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"--"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_postfixDec_ _staticDescriptor;
public override string Name
{
get
{
return "postfixDec";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_postfixDec_._staticDescriptor;
}
}
static _#postfix#_postfixDec_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_postfixDec_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_postfixDec_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_postfixDec_._token_literal_"--"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_postfixDec_._staticDescriptor, "--", true);
}
public CalcParser.PostfixDec ResultType()
{
return null;
}
private _#postfix#_postfixDec_()
{
}
}
public class _#postfix#_pow_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"^"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_pow_ _staticDescriptor;
public override string Name
{
get
{
return "pow";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_pow_._staticDescriptor;
}
}
static _#postfix#_pow_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_pow_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_pow_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_pow_._token_literal_"^"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_pow_._staticDescriptor, "^", true);
}
public CalcParser.Pow ResultType()
{
return null;
}
private _#postfix#_pow_()
{
}
}
public class _#prefix#__prefixDec_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"--"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__prefixDec_ _staticDescriptor;
public override string Name
{
get
{
return "prefixDec";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__prefixDec_._staticDescriptor;
}
}
static _#prefix#__prefixDec_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__prefixDec_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__prefixDec_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__prefixDec_._token_literal_"--"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__prefixDec_._staticDescriptor, "--", true);
}
public CalcParser.PrefixDec ResultType()
{
return null;
}
private _#prefix#__prefixDec_()
{
}
}
public class _#prefix#__rounds_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"("_;
public static readonly TokenDescriptor _token_literal_")"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_ _staticDescriptor;
public override string Name
{
get
{
return "rounds";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_._staticDescriptor;
}
}
static _#prefix#__rounds_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_._token_literal_")"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_._staticDescriptor, ")", true);
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_._token_literal_"("_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_._staticDescriptor, "(", true);
}
public CalcParser.Rounds ResultType()
{
return null;
}
private _#prefix#__rounds_()
{
}
}
public class _#simple#__s_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_" "_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__s_ _staticDescriptor;
public override string Name
{
get
{
return "s";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__s_._staticDescriptor;
}
}
static _#simple#__s_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__s_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__s_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__s_._token_literal_" "_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__s_._staticDescriptor, " ", true);
}
public void ResultType()
{
}
private _#simple#__s_()
{
}
}
public class _#prefix#__seq_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"{"_;
public static readonly TokenDescriptor _token_literal_"}"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_ _staticDescriptor;
public override string Name
{
get
{
return "seq";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_._staticDescriptor;
}
}
static _#prefix#__seq_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_._token_literal_"}"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_._staticDescriptor, "}", true);
CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_._token_literal_"{"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_._staticDescriptor, "{", true);
}
public CalcParser.Seq ResultType()
{
return null;
}
private _#prefix#__seq_()
{
}
}
public class _#simple#__start_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_rule_"any"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__start_ _staticDescriptor;
public override string Name
{
get
{
return "start";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__start_._staticDescriptor;
}
}
static _#simple#__start_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__start_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__start_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__start_._token_rule_"any"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__start_._staticDescriptor, "any", false);
}
public CalcParser.Start ResultType()
{
return null;
}
private _#simple#__start_()
{
}
}
public class _#postfix#_sub_ : RuleDescriptor
{
public static readonly TokenDescriptor _token_literal_"-"_;
private static readonly CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_sub_ _staticDescriptor;
public override string Name
{
get
{
return "sub";
}
}
public override GrammarDescriptor Grammar
{
get
{
return CalcParser.GrammarImpl.StaticDescriptor;
}
}
public static RuleDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_sub_._staticDescriptor;
}
}
static _#postfix#_sub_()
{
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_sub_._staticDescriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_sub_();
CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_sub_._token_literal_"-"_ = new TokenDescriptor(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_sub_._staticDescriptor, "-", true);
}
public CalcParser.Sub ResultType()
{
return null;
}
private _#postfix#_sub_()
{
}
}
public override GrammarDescriptor[] Dependencies
{
get
{
return new GrammarDescriptor[]
{
NumParser.GrammarImpl.get_StaticDescriptor(),
IncParser.GrammarImpl.StaticDescriptor
};
}
}
public override string Name
{
get
{
return "CalcParser";
}
}
public override string FullName
{
get
{
return "CalcParser";
}
}
public override IGrammar NewGrammar(Parser parser)
{
return new CalcParser.GrammarImpl(parser);
}
public override ParsingErrors NewParsingErrors()
{
return new CalcParser.GrammarImpl.ParsingErrorsImpl();
}
}
private sealed class ParsingErrorsImpl : ParsingErrors
{
public int _token_sub_literal_"-"_;
public int _token_start_rule_"any"_;
public int _token_seq_literal_"{"_;
public int _token_seq_literal_"}"_;
public int _token_s_literal_" "_;
public int _token_rounds_literal_"("_;
public int _token_rounds_literal_")"_;
public int _token_prefixDec_literal_"--"_;
public int _token_pow_literal_"^"_;
public int _token_postfixDec_literal_"--"_;
public int _token_neg_literal_"-"_;
public int _token_mul_literal_"*"_;
public int _token_mod_literal_"%"_;
public int _token_div_literal_"/"_;
public int _token_cond_literal_"?"_;
public int _token_cond_literal_":"_;
public int _token_add_literal_"+"_;
public override void Clear()
{
this._token_add_literal_"+"_ = -2;
this._token_cond_literal_":"_ = -2;
this._token_cond_literal_"?"_ = -2;
this._token_div_literal_"/"_ = -2;
this._token_mod_literal_"%"_ = -2;
this._token_mul_literal_"*"_ = -2;
this._token_neg_literal_"-"_ = -2;
this._token_postfixDec_literal_"--"_ = -2;
this._token_pow_literal_"^"_ = -2;
this._token_prefixDec_literal_"--"_ = -2;
this._token_rounds_literal_")"_ = -2;
this._token_rounds_literal_"("_ = -2;
this._token_s_literal_" "_ = -2;
this._token_seq_literal_"}"_ = -2;
this._token_seq_literal_"{"_ = -2;
this._token_start_rule_"any"_ = -2;
this._token_sub_literal_"-"_ = -2;
}
public override void GetErrors(ref int pos, List<TokenDescriptor> descriptors)
{
int arg_04_0 = pos;
if (pos < this._token_add_literal_"+"_)
{
pos = this._token_add_literal_"+"_;
descriptors.Clear();
}
if (pos == this._token_add_literal_"+"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_add_._token_literal_"+"_);
}
if (pos < this._token_cond_literal_":"_)
{
pos = this._token_cond_literal_":"_;
descriptors.Clear();
}
if (pos == this._token_cond_literal_":"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_._token_literal_":"_);
}
if (pos < this._token_cond_literal_"?"_)
{
pos = this._token_cond_literal_"?"_;
descriptors.Clear();
}
if (pos == this._token_cond_literal_"?"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_._token_literal_"?"_);
}
if (pos < this._token_div_literal_"/"_)
{
pos = this._token_div_literal_"/"_;
descriptors.Clear();
}
if (pos == this._token_div_literal_"/"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_div_._token_literal_"/"_);
}
if (pos < this._token_mod_literal_"%"_)
{
pos = this._token_mod_literal_"%"_;
descriptors.Clear();
}
if (pos == this._token_mod_literal_"%"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mod_._token_literal_"%"_);
}
if (pos < this._token_mul_literal_"*"_)
{
pos = this._token_mul_literal_"*"_;
descriptors.Clear();
}
if (pos == this._token_mul_literal_"*"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mul_._token_literal_"*"_);
}
if (pos < this._token_neg_literal_"-"_)
{
pos = this._token_neg_literal_"-"_;
descriptors.Clear();
}
if (pos == this._token_neg_literal_"-"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__neg_._token_literal_"-"_);
}
if (pos < this._token_postfixDec_literal_"--"_)
{
pos = this._token_postfixDec_literal_"--"_;
descriptors.Clear();
}
if (pos == this._token_postfixDec_literal_"--"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_postfixDec_._token_literal_"--"_);
}
if (pos < this._token_pow_literal_"^"_)
{
pos = this._token_pow_literal_"^"_;
descriptors.Clear();
}
if (pos == this._token_pow_literal_"^"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_pow_._token_literal_"^"_);
}
if (pos < this._token_prefixDec_literal_"--"_)
{
pos = this._token_prefixDec_literal_"--"_;
descriptors.Clear();
}
if (pos == this._token_prefixDec_literal_"--"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__prefixDec_._token_literal_"--"_);
}
if (pos < this._token_rounds_literal_")"_)
{
pos = this._token_rounds_literal_")"_;
descriptors.Clear();
}
if (pos == this._token_rounds_literal_")"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_._token_literal_")"_);
}
if (pos < this._token_rounds_literal_"("_)
{
pos = this._token_rounds_literal_"("_;
descriptors.Clear();
}
if (pos == this._token_rounds_literal_"("_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_._token_literal_"("_);
}
if (pos < this._token_s_literal_" "_)
{
pos = this._token_s_literal_" "_;
descriptors.Clear();
}
if (pos == this._token_s_literal_" "_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__s_._token_literal_" "_);
}
if (pos < this._token_seq_literal_"}"_)
{
pos = this._token_seq_literal_"}"_;
descriptors.Clear();
}
if (pos == this._token_seq_literal_"}"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_._token_literal_"}"_);
}
if (pos < this._token_seq_literal_"{"_)
{
pos = this._token_seq_literal_"{"_;
descriptors.Clear();
}
if (pos == this._token_seq_literal_"{"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_._token_literal_"{"_);
}
if (pos < this._token_start_rule_"any"_)
{
pos = this._token_start_rule_"any"_;
descriptors.Clear();
}
if (pos == this._token_start_rule_"any"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#simple#__start_._token_rule_"any"_);
}
if (pos < this._token_sub_literal_"-"_)
{
pos = this._token_sub_literal_"-"_;
descriptors.Clear();
}
if (pos == this._token_sub_literal_"-"_)
{
descriptors.Add(CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_sub_._token_literal_"-"_);
}
}
public ParsingErrorsImpl()
{
this.Clear();
}
}
private sealed class GrammarStateImpl : IGrammarState
{
private readonly ExtensionPostfixBase<CalcParser.Expr>[] _#_expr_PostfixRules_;
private readonly ExtensionPrefixBase<CalcParser.Expr>[] _#_expr_PrefixRules__;
[DebuggerBrowsable(DebuggerBrowsableState.Never), CompilerGenerated]
private readonly CalcParser.GrammarImpl _N_Grammar_4228;
public CalcParser.GrammarImpl Grammar
{
[CompilerGenerated]
get
{
return this._N_Grammar_4228;
}
}
public void LoadThisState()
{
this.Grammar._#_expr_PrefixRules__ = this._#_expr_PrefixRules__;
this.Grammar._#_expr_PostfixRules_ = this._#_expr_PostfixRules_;
}
public GrammarStateImpl(CalcParser.GrammarImpl grammar)
{
this._N_Grammar_4228 = grammar;
this._#_expr_PrefixRules__ = this._N_Grammar_4228._#_expr_PrefixRules__;
this._#_expr_PostfixRules_ = this._N_Grammar_4228._#_expr_PostfixRules_;
}
public GrammarStateImpl()
{
}
IGrammar IGrammarState.get_Grammar()
{
return this.Grammar;
}
}
public class _#postfix#_add_ : ExtensionPostfixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_add_.StaticDescriptor;
}
}
public override int Parse(int startPos, int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_2 = default(NToken);
CalcParser.Expr token_3 = null;
CalcParser.Expr prefixResult = result;
int seqResult = 0;
CalcParser.Expr token_4 = prefixResult;
bool _N_cache_12268 = pos >= 0;
bool arg_AE_0;
if (_N_cache_12268)
{
if (true)
{
if (isBest)
{
arg_AE_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos);
arg_AE_0 = (isBest || bestOffsets[0] == pos);
}
goto IL_A3;
}
}
arg_AE_0 = false;
IL_A3:
bool flag = arg_AE_0;
if (!flag)
{
seqResult = -1;
}
else
{
int arg_146_0;
if (pos < text.Length && text[pos] == '+')
{
arg_146_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_add_literal_"+"_ < pos)
{
this._grammar._parsingErrors._token_add_literal_"+"_ = pos;
}
arg_146_0 = -1;
}
int newPos = arg_146_0;
if (newPos >= 0)
{
token_2 = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_12269 = pos2 >= 0;
bool arg_1D5_0;
if (_N_cache_12269)
{
if (true)
{
if (isBest)
{
arg_1D5_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos2);
arg_1D5_0 = (isBest || bestOffsets[1] == pos2);
}
goto IL_1CA;
}
}
arg_1D5_0 = false;
IL_1CA:
bool flag2 = arg_1D5_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_12270 = pos3 >= 0;
bool arg_26E_0;
if (_N_cache_12270)
{
if (true)
{
if (isBest)
{
arg_26E_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos3);
arg_26E_0 = (isBest || bestOffsets[2] == pos3);
}
goto IL_263;
}
}
arg_26E_0 = false;
IL_263:
bool flag3 = arg_26E_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 10, ref token_3);
bool _N_cache_12271 = pos4 >= 0;
bool arg_30B_0;
if (_N_cache_12271)
{
if (true)
{
if (isBest)
{
arg_30B_0 = true;
}
else
{
isBest = (bestOffsets[3] < pos4);
arg_30B_0 = (isBest || bestOffsets[3] == pos4);
}
goto IL_300;
}
}
arg_30B_0 = false;
IL_300:
bool flag4 = arg_30B_0;
if (!flag4)
{
seqResult = -1;
}
else
{
int ofs3 = pos4;
int arg_3A2_0;
if (isBest)
{
bestOffsets[0] = pos;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
bestOffsets[3] = ofs3;
int i = 4;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_3A2_0 = pos4;
}
else
{
arg_3A2_0 = -1;
}
seqResult = arg_3A2_0;
}
}
}
}
int newPos2 = seqResult;
if (newPos2 >= 0)
{
result = new CalcParser.Add.Ast(new Location(this._grammar._parsingSource, token_4.get_Location().get_StartPos(), token_3.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_4, token_2, token_3);
}
return newPos2;
}
public _#postfix#_add_(IGrammar grammar) : base(10, '\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#postfix#_cond_ : ExtensionPostfixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_cond_.StaticDescriptor;
}
}
public override int Parse(int startPos, int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_2 = default(NToken);
CalcParser.Expr token_3 = null;
NToken token_4 = default(NToken);
CalcParser.Expr token_5 = null;
CalcParser.Expr prefixResult = result;
int seqResult = 0;
CalcParser.Expr token_6 = prefixResult;
bool _N_cache_12561 = pos >= 0;
bool arg_BF_0;
if (_N_cache_12561)
{
if (true)
{
if (isBest)
{
arg_BF_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos);
arg_BF_0 = (isBest || bestOffsets[0] == pos);
}
goto IL_B4;
}
}
arg_BF_0 = false;
IL_B4:
bool flag = arg_BF_0;
if (!flag)
{
seqResult = -1;
}
else
{
int arg_157_0;
if (pos < text.Length && text[pos] == '?')
{
arg_157_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_cond_literal_"?"_ < pos)
{
this._grammar._parsingErrors._token_cond_literal_"?"_ = pos;
}
arg_157_0 = -1;
}
int newPos = arg_157_0;
if (newPos >= 0)
{
token_2 = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_12562 = pos2 >= 0;
bool arg_1E6_0;
if (_N_cache_12562)
{
if (true)
{
if (isBest)
{
arg_1E6_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos2);
arg_1E6_0 = (isBest || bestOffsets[1] == pos2);
}
goto IL_1DB;
}
}
arg_1E6_0 = false;
IL_1DB:
bool flag2 = arg_1E6_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_12563 = pos3 >= 0;
bool arg_27F_0;
if (_N_cache_12563)
{
if (true)
{
if (isBest)
{
arg_27F_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos3);
arg_27F_0 = (isBest || bestOffsets[2] == pos3);
}
goto IL_274;
}
}
arg_27F_0 = false;
IL_274:
bool flag3 = arg_27F_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 0, ref token_3);
bool _N_cache_12564 = pos4 >= 0;
bool arg_31B_0;
if (_N_cache_12564)
{
if (true)
{
if (isBest)
{
arg_31B_0 = true;
}
else
{
isBest = (bestOffsets[3] < pos4);
arg_31B_0 = (isBest || bestOffsets[3] == pos4);
}
goto IL_310;
}
}
arg_31B_0 = false;
IL_310:
bool flag4 = arg_31B_0;
if (!flag4)
{
seqResult = -1;
}
else
{
int ofs3 = pos4;
int arg_3B3_0;
if (pos4 < text.Length && text[pos4] == ':')
{
arg_3B3_0 = pos4 + 1;
}
else
{
if (this._grammar._parsingErrors._token_cond_literal_":"_ < pos4)
{
this._grammar._parsingErrors._token_cond_literal_":"_ = pos4;
}
arg_3B3_0 = -1;
}
int newPos2 = arg_3B3_0;
if (newPos2 >= 0)
{
token_4 = new NToken(pos4, newPos2);
}
int pos5 = newPos2;
bool _N_cache_12565 = pos5 >= 0;
bool arg_442_0;
if (_N_cache_12565)
{
if (true)
{
if (isBest)
{
arg_442_0 = true;
}
else
{
isBest = (bestOffsets[4] < pos5);
arg_442_0 = (isBest || bestOffsets[4] == pos5);
}
goto IL_437;
}
}
arg_442_0 = false;
IL_437:
bool flag5 = arg_442_0;
if (!flag5)
{
seqResult = -1;
}
else
{
int ofs4 = pos5;
int pos6 = this._grammar._#_s_(pos5, text);
bool _N_cache_12566 = pos6 >= 0;
bool arg_4DB_0;
if (_N_cache_12566)
{
if (true)
{
if (isBest)
{
arg_4DB_0 = true;
}
else
{
isBest = (bestOffsets[5] < pos6);
arg_4DB_0 = (isBest || bestOffsets[5] == pos6);
}
goto IL_4D0;
}
}
arg_4DB_0 = false;
IL_4D0:
bool flag6 = arg_4DB_0;
if (!flag6)
{
seqResult = -1;
}
else
{
int ofs5 = pos6;
int pos7 = this._grammar._#_expr_(pos6, text, 0, ref token_5);
bool _N_cache_12567 = pos7 >= 0;
bool arg_577_0;
if (_N_cache_12567)
{
if (true)
{
if (isBest)
{
arg_577_0 = true;
}
else
{
isBest = (bestOffsets[6] < pos7);
arg_577_0 = (isBest || bestOffsets[6] == pos7);
}
goto IL_56C;
}
}
arg_577_0 = false;
IL_56C:
bool flag7 = arg_577_0;
if (!flag7)
{
seqResult = -1;
}
else
{
int ofs6 = pos7;
int arg_623_0;
if (isBest)
{
bestOffsets[0] = pos;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
bestOffsets[3] = ofs3;
bestOffsets[4] = ofs4;
bestOffsets[5] = ofs5;
bestOffsets[6] = ofs6;
int i = 7;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_623_0 = pos7;
}
else
{
arg_623_0 = -1;
}
seqResult = arg_623_0;
}
}
}
}
}
}
}
int newPos3 = seqResult;
if (newPos3 >= 0)
{
result = new CalcParser.Cond.Ast(new Location(this._grammar._parsingSource, token_6.get_Location().get_StartPos(), token_5.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_6, token_2, token_3, token_4, token_5);
}
return newPos3;
}
public _#postfix#_cond_(IGrammar grammar) : base(301, '\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#postfix#_div_ : ExtensionPostfixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_div_.StaticDescriptor;
}
}
public override int Parse(int startPos, int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_2 = default(NToken);
CalcParser.Expr token_3 = null;
CalcParser.Expr prefixResult = result;
int seqResult = 0;
CalcParser.Expr token_4 = prefixResult;
bool _N_cache_12741 = pos >= 0;
bool arg_AE_0;
if (_N_cache_12741)
{
if (true)
{
if (isBest)
{
arg_AE_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos);
arg_AE_0 = (isBest || bestOffsets[0] == pos);
}
goto IL_A3;
}
}
arg_AE_0 = false;
IL_A3:
bool flag = arg_AE_0;
if (!flag)
{
seqResult = -1;
}
else
{
int arg_146_0;
if (pos < text.Length && text[pos] == '/')
{
arg_146_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_div_literal_"/"_ < pos)
{
this._grammar._parsingErrors._token_div_literal_"/"_ = pos;
}
arg_146_0 = -1;
}
int newPos = arg_146_0;
if (newPos >= 0)
{
token_2 = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_12742 = pos2 >= 0;
bool arg_1D5_0;
if (_N_cache_12742)
{
if (true)
{
if (isBest)
{
arg_1D5_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos2);
arg_1D5_0 = (isBest || bestOffsets[1] == pos2);
}
goto IL_1CA;
}
}
arg_1D5_0 = false;
IL_1CA:
bool flag2 = arg_1D5_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_12743 = pos3 >= 0;
bool arg_26E_0;
if (_N_cache_12743)
{
if (true)
{
if (isBest)
{
arg_26E_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos3);
arg_26E_0 = (isBest || bestOffsets[2] == pos3);
}
goto IL_263;
}
}
arg_26E_0 = false;
IL_263:
bool flag3 = arg_26E_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 20, ref token_3);
bool _N_cache_12744 = pos4 >= 0;
bool arg_30B_0;
if (_N_cache_12744)
{
if (true)
{
if (isBest)
{
arg_30B_0 = true;
}
else
{
isBest = (bestOffsets[3] < pos4);
arg_30B_0 = (isBest || bestOffsets[3] == pos4);
}
goto IL_300;
}
}
arg_30B_0 = false;
IL_300:
bool flag4 = arg_30B_0;
if (!flag4)
{
seqResult = -1;
}
else
{
int ofs3 = pos4;
int arg_3A2_0;
if (isBest)
{
bestOffsets[0] = pos;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
bestOffsets[3] = ofs3;
int i = 4;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_3A2_0 = pos4;
}
else
{
arg_3A2_0 = -1;
}
seqResult = arg_3A2_0;
}
}
}
}
int newPos2 = seqResult;
if (newPos2 >= 0)
{
result = new CalcParser.Div.Ast(new Location(this._grammar._parsingSource, token_4.get_Location().get_StartPos(), token_3.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_4, token_2, token_3);
}
return newPos2;
}
public _#postfix#_div_(IGrammar grammar) : base(20, '\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#postfix#_mod_ : ExtensionPostfixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mod_.StaticDescriptor;
}
}
public override int Parse(int startPos, int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_2 = default(NToken);
CalcParser.Expr token_3 = null;
CalcParser.Expr prefixResult = result;
int seqResult = 0;
CalcParser.Expr token_4 = prefixResult;
bool _N_cache_12867 = pos >= 0;
bool arg_AE_0;
if (_N_cache_12867)
{
if (true)
{
if (isBest)
{
arg_AE_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos);
arg_AE_0 = (isBest || bestOffsets[0] == pos);
}
goto IL_A3;
}
}
arg_AE_0 = false;
IL_A3:
bool flag = arg_AE_0;
if (!flag)
{
seqResult = -1;
}
else
{
int arg_146_0;
if (pos < text.Length && text[pos] == '%')
{
arg_146_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_mod_literal_"%"_ < pos)
{
this._grammar._parsingErrors._token_mod_literal_"%"_ = pos;
}
arg_146_0 = -1;
}
int newPos = arg_146_0;
if (newPos >= 0)
{
token_2 = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_12868 = pos2 >= 0;
bool arg_1D5_0;
if (_N_cache_12868)
{
if (true)
{
if (isBest)
{
arg_1D5_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos2);
arg_1D5_0 = (isBest || bestOffsets[1] == pos2);
}
goto IL_1CA;
}
}
arg_1D5_0 = false;
IL_1CA:
bool flag2 = arg_1D5_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_12869 = pos3 >= 0;
bool arg_26E_0;
if (_N_cache_12869)
{
if (true)
{
if (isBest)
{
arg_26E_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos3);
arg_26E_0 = (isBest || bestOffsets[2] == pos3);
}
goto IL_263;
}
}
arg_26E_0 = false;
IL_263:
bool flag3 = arg_26E_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 20, ref token_3);
bool _N_cache_12870 = pos4 >= 0;
bool arg_30B_0;
if (_N_cache_12870)
{
if (true)
{
if (isBest)
{
arg_30B_0 = true;
}
else
{
isBest = (bestOffsets[3] < pos4);
arg_30B_0 = (isBest || bestOffsets[3] == pos4);
}
goto IL_300;
}
}
arg_30B_0 = false;
IL_300:
bool flag4 = arg_30B_0;
if (!flag4)
{
seqResult = -1;
}
else
{
int ofs3 = pos4;
int arg_3A2_0;
if (isBest)
{
bestOffsets[0] = pos;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
bestOffsets[3] = ofs3;
int i = 4;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_3A2_0 = pos4;
}
else
{
arg_3A2_0 = -1;
}
seqResult = arg_3A2_0;
}
}
}
}
int newPos2 = seqResult;
if (newPos2 >= 0)
{
result = new CalcParser.Mod.Ast(new Location(this._grammar._parsingSource, token_4.get_Location().get_StartPos(), token_3.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_4, token_2, token_3);
}
return newPos2;
}
public _#postfix#_mod_(IGrammar grammar) : base(20, '\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#postfix#_mul_ : ExtensionPostfixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_mul_.StaticDescriptor;
}
}
public override int Parse(int startPos, int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_2 = default(NToken);
CalcParser.Expr token_3 = null;
CalcParser.Expr prefixResult = result;
int seqResult = 0;
CalcParser.Expr token_4 = prefixResult;
bool _N_cache_12993 = pos >= 0;
bool arg_AE_0;
if (_N_cache_12993)
{
if (true)
{
if (isBest)
{
arg_AE_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos);
arg_AE_0 = (isBest || bestOffsets[0] == pos);
}
goto IL_A3;
}
}
arg_AE_0 = false;
IL_A3:
bool flag = arg_AE_0;
if (!flag)
{
seqResult = -1;
}
else
{
int arg_146_0;
if (pos < text.Length && text[pos] == '*')
{
arg_146_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_mul_literal_"*"_ < pos)
{
this._grammar._parsingErrors._token_mul_literal_"*"_ = pos;
}
arg_146_0 = -1;
}
int newPos = arg_146_0;
if (newPos >= 0)
{
token_2 = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_12994 = pos2 >= 0;
bool arg_1D5_0;
if (_N_cache_12994)
{
if (true)
{
if (isBest)
{
arg_1D5_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos2);
arg_1D5_0 = (isBest || bestOffsets[1] == pos2);
}
goto IL_1CA;
}
}
arg_1D5_0 = false;
IL_1CA:
bool flag2 = arg_1D5_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_12995 = pos3 >= 0;
bool arg_26E_0;
if (_N_cache_12995)
{
if (true)
{
if (isBest)
{
arg_26E_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos3);
arg_26E_0 = (isBest || bestOffsets[2] == pos3);
}
goto IL_263;
}
}
arg_26E_0 = false;
IL_263:
bool flag3 = arg_26E_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 20, ref token_3);
bool _N_cache_12996 = pos4 >= 0;
bool arg_30B_0;
if (_N_cache_12996)
{
if (true)
{
if (isBest)
{
arg_30B_0 = true;
}
else
{
isBest = (bestOffsets[3] < pos4);
arg_30B_0 = (isBest || bestOffsets[3] == pos4);
}
goto IL_300;
}
}
arg_30B_0 = false;
IL_300:
bool flag4 = arg_30B_0;
if (!flag4)
{
seqResult = -1;
}
else
{
int ofs3 = pos4;
int arg_3A2_0;
if (isBest)
{
bestOffsets[0] = pos;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
bestOffsets[3] = ofs3;
int i = 4;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_3A2_0 = pos4;
}
else
{
arg_3A2_0 = -1;
}
seqResult = arg_3A2_0;
}
}
}
}
int newPos2 = seqResult;
if (newPos2 >= 0)
{
result = new CalcParser.Mul.Ast(new Location(this._grammar._parsingSource, token_4.get_Location().get_StartPos(), token_3.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_4, token_2, token_3);
}
return newPos2;
}
public _#postfix#_mul_(IGrammar grammar) : base(20, '\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#prefix#__neg_ : ExtensionPrefixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__neg_.StaticDescriptor;
}
}
public override int Parse(int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_ = default(NToken);
CalcParser.Expr token_2 = null;
int seqResult = 0;
int arg_A1_0;
if (pos < text.Length && text[pos] == '-')
{
arg_A1_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_neg_literal_"-"_ < pos)
{
this._grammar._parsingErrors._token_neg_literal_"-"_ = pos;
}
arg_A1_0 = -1;
}
int newPos = arg_A1_0;
if (newPos >= 0)
{
token_ = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_13124 = pos2 >= 0;
bool arg_12C_0;
if (_N_cache_13124)
{
if (true)
{
if (isBest)
{
arg_12C_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos2);
arg_12C_0 = (isBest || bestOffsets[0] == pos2);
}
goto IL_121;
}
}
arg_12C_0 = false;
IL_121:
bool flag = arg_12C_0;
if (!flag)
{
seqResult = -1;
}
else
{
int ofs0 = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_13125 = pos3 >= 0;
bool arg_1C3_0;
if (_N_cache_13125)
{
if (true)
{
if (isBest)
{
arg_1C3_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos3);
arg_1C3_0 = (isBest || bestOffsets[1] == pos3);
}
goto IL_1B8;
}
}
arg_1C3_0 = false;
IL_1B8:
bool flag2 = arg_1C3_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 100, ref token_2);
bool _N_cache_13126 = pos4 >= 0;
bool arg_25E_0;
if (_N_cache_13126)
{
if (true)
{
if (isBest)
{
arg_25E_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos4);
arg_25E_0 = (isBest || bestOffsets[2] == pos4);
}
goto IL_253;
}
}
arg_25E_0 = false;
IL_253:
bool flag3 = arg_25E_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos4;
int arg_2E8_0;
if (isBest)
{
bestOffsets[0] = ofs0;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
int i = 3;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_2E8_0 = pos4;
}
else
{
arg_2E8_0 = -1;
}
seqResult = arg_2E8_0;
}
}
}
int newPos2 = seqResult;
if (newPos2 >= 0)
{
result = new CalcParser.Neg.Ast(new Location(this._grammar._parsingSource, token_.get_StartPos(), token_2.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_, token_2);
}
return newPos2;
}
public _#prefix#__neg_(IGrammar grammar) : base('\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#prefix#__num_ : ExtensionPrefixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__num_.StaticDescriptor;
}
}
public override int Parse(int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NumParser.Number token_ = null;
int seqResult = 0;
int pos2 = this._grammar._#grammar#1._#_number_(pos, text, ref token_);
bool _N_cache_13212 = pos2 >= 0;
bool arg_9E_0;
if (_N_cache_13212)
{
if (true)
{
if (isBest)
{
arg_9E_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos2);
arg_9E_0 = (isBest || bestOffsets[0] == pos2);
}
goto IL_93;
}
}
arg_9E_0 = false;
IL_93:
bool flag = arg_9E_0;
if (!flag)
{
seqResult = -1;
}
else
{
int ofs0 = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_13213 = pos3 >= 0;
bool arg_134_0;
if (_N_cache_13213)
{
if (true)
{
if (isBest)
{
arg_134_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos3);
arg_134_0 = (isBest || bestOffsets[1] == pos3);
}
goto IL_129;
}
}
arg_134_0 = false;
IL_129:
bool flag2 = arg_134_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos3;
int arg_1B7_0;
if (isBest)
{
bestOffsets[0] = ofs0;
bestOffsets[1] = ofs;
int i = 2;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_1B7_0 = pos3;
}
else
{
arg_1B7_0 = -1;
}
seqResult = arg_1B7_0;
}
}
int newPos = seqResult;
if (newPos >= 0)
{
result = new CalcParser.Num.Ast(new Location(this._grammar._parsingSource, token_.get_Location().get_StartPos(), token_.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_);
}
return newPos;
}
public _#prefix#__num_(IGrammar grammar) : base('\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#postfix#_postfixDec_ : ExtensionPostfixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_postfixDec_.StaticDescriptor;
}
}
public override int Parse(int startPos, int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_2 = default(NToken);
CalcParser.Expr prefixResult = result;
int seqResult = 0;
CalcParser.Expr token_3 = prefixResult;
bool _N_cache_13294 = pos >= 0;
bool arg_AA_0;
if (_N_cache_13294)
{
if (true)
{
if (isBest)
{
arg_AA_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos);
arg_AA_0 = (isBest || bestOffsets[0] == pos);
}
goto IL_9F;
}
}
arg_AA_0 = false;
IL_9F:
bool flag = arg_AA_0;
if (!flag)
{
seqResult = -1;
}
else
{
int arg_15F_0;
if (pos + 1 < text.Length && text[pos] == '-' && text[pos + 1] == '-')
{
arg_15F_0 = pos + 2;
}
else
{
if (this._grammar._parsingErrors._token_postfixDec_literal_"--"_ < pos)
{
this._grammar._parsingErrors._token_postfixDec_literal_"--"_ = pos;
}
arg_15F_0 = -1;
}
int newPos = arg_15F_0;
if (newPos >= 0)
{
token_2 = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_13295 = pos2 >= 0;
bool arg_1EE_0;
if (_N_cache_13295)
{
if (true)
{
if (isBest)
{
arg_1EE_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos2);
arg_1EE_0 = (isBest || bestOffsets[1] == pos2);
}
goto IL_1E3;
}
}
arg_1EE_0 = false;
IL_1E3:
bool flag2 = arg_1EE_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_13296 = pos3 >= 0;
bool arg_287_0;
if (_N_cache_13296)
{
if (true)
{
if (isBest)
{
arg_287_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos3);
arg_287_0 = (isBest || bestOffsets[2] == pos3);
}
goto IL_27C;
}
}
arg_287_0 = false;
IL_27C:
bool flag3 = arg_287_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos3;
int arg_317_0;
if (isBest)
{
bestOffsets[0] = pos;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
int i = 3;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_317_0 = pos3;
}
else
{
arg_317_0 = -1;
}
seqResult = arg_317_0;
}
}
}
int newPos2 = seqResult;
if (newPos2 >= 0)
{
result = new CalcParser.PostfixDec.Ast(new Location(this._grammar._parsingSource, token_3.get_Location().get_StartPos(), token_2.get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_3, token_2);
}
return newPos2;
}
public _#postfix#_postfixDec_(IGrammar grammar) : base(200, '\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#postfix#_pow_ : ExtensionPostfixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_pow_.StaticDescriptor;
}
}
public override int Parse(int startPos, int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_2 = default(NToken);
CalcParser.Expr token_3 = null;
CalcParser.Expr prefixResult = result;
int seqResult = 0;
CalcParser.Expr token_4 = prefixResult;
bool _N_cache_13409 = pos >= 0;
bool arg_AE_0;
if (_N_cache_13409)
{
if (true)
{
if (isBest)
{
arg_AE_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos);
arg_AE_0 = (isBest || bestOffsets[0] == pos);
}
goto IL_A3;
}
}
arg_AE_0 = false;
IL_A3:
bool flag = arg_AE_0;
if (!flag)
{
seqResult = -1;
}
else
{
int arg_146_0;
if (pos < text.Length && text[pos] == '^')
{
arg_146_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_pow_literal_"^"_ < pos)
{
this._grammar._parsingErrors._token_pow_literal_"^"_ = pos;
}
arg_146_0 = -1;
}
int newPos = arg_146_0;
if (newPos >= 0)
{
token_2 = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_13410 = pos2 >= 0;
bool arg_1D5_0;
if (_N_cache_13410)
{
if (true)
{
if (isBest)
{
arg_1D5_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos2);
arg_1D5_0 = (isBest || bestOffsets[1] == pos2);
}
goto IL_1CA;
}
}
arg_1D5_0 = false;
IL_1CA:
bool flag2 = arg_1D5_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_13411 = pos3 >= 0;
bool arg_26E_0;
if (_N_cache_13411)
{
if (true)
{
if (isBest)
{
arg_26E_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos3);
arg_26E_0 = (isBest || bestOffsets[2] == pos3);
}
goto IL_263;
}
}
arg_26E_0 = false;
IL_263:
bool flag3 = arg_26E_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 30, ref token_3);
bool _N_cache_13412 = pos4 >= 0;
bool arg_30B_0;
if (_N_cache_13412)
{
if (true)
{
if (isBest)
{
arg_30B_0 = true;
}
else
{
isBest = (bestOffsets[3] < pos4);
arg_30B_0 = (isBest || bestOffsets[3] == pos4);
}
goto IL_300;
}
}
arg_30B_0 = false;
IL_300:
bool flag4 = arg_30B_0;
if (!flag4)
{
seqResult = -1;
}
else
{
int ofs3 = pos4;
int arg_3A2_0;
if (isBest)
{
bestOffsets[0] = pos;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
bestOffsets[3] = ofs3;
int i = 4;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_3A2_0 = pos4;
}
else
{
arg_3A2_0 = -1;
}
seqResult = arg_3A2_0;
}
}
}
}
int newPos2 = seqResult;
if (newPos2 >= 0)
{
result = new CalcParser.Pow.Ast(new Location(this._grammar._parsingSource, token_4.get_Location().get_StartPos(), token_3.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_4, token_2, token_3);
}
return newPos2;
}
public _#postfix#_pow_(IGrammar grammar) : base(31, '\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#prefix#__prefixDec_ : ExtensionPrefixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__prefixDec_.StaticDescriptor;
}
}
public override int Parse(int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_ = default(NToken);
CalcParser.Expr token_2 = null;
int seqResult = 0;
int arg_BD_0;
if (pos + 1 < text.Length && text[pos] == '-' && text[pos + 1] == '-')
{
arg_BD_0 = pos + 2;
}
else
{
if (this._grammar._parsingErrors._token_prefixDec_literal_"--"_ < pos)
{
this._grammar._parsingErrors._token_prefixDec_literal_"--"_ = pos;
}
arg_BD_0 = -1;
}
int newPos = arg_BD_0;
if (newPos >= 0)
{
token_ = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_13543 = pos2 >= 0;
bool arg_148_0;
if (_N_cache_13543)
{
if (true)
{
if (isBest)
{
arg_148_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos2);
arg_148_0 = (isBest || bestOffsets[0] == pos2);
}
goto IL_13D;
}
}
arg_148_0 = false;
IL_13D:
bool flag = arg_148_0;
if (!flag)
{
seqResult = -1;
}
else
{
int ofs0 = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_13544 = pos3 >= 0;
bool arg_1DF_0;
if (_N_cache_13544)
{
if (true)
{
if (isBest)
{
arg_1DF_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos3);
arg_1DF_0 = (isBest || bestOffsets[1] == pos3);
}
goto IL_1D4;
}
}
arg_1DF_0 = false;
IL_1D4:
bool flag2 = arg_1DF_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 200, ref token_2);
bool _N_cache_13545 = pos4 >= 0;
bool arg_27D_0;
if (_N_cache_13545)
{
if (true)
{
if (isBest)
{
arg_27D_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos4);
arg_27D_0 = (isBest || bestOffsets[2] == pos4);
}
goto IL_272;
}
}
arg_27D_0 = false;
IL_272:
bool flag3 = arg_27D_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos4;
int arg_307_0;
if (isBest)
{
bestOffsets[0] = ofs0;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
int i = 3;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_307_0 = pos4;
}
else
{
arg_307_0 = -1;
}
seqResult = arg_307_0;
}
}
}
int newPos2 = seqResult;
if (newPos2 >= 0)
{
result = new CalcParser.PrefixDec.Ast(new Location(this._grammar._parsingSource, token_.get_StartPos(), token_2.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_, token_2);
}
return newPos2;
}
public _#prefix#__prefixDec_(IGrammar grammar) : base('\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#prefix#__rounds_ : ExtensionPrefixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__rounds_.StaticDescriptor;
}
}
public override int Parse(int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_ = default(NToken);
CalcParser.Expr token_2 = null;
NToken token_3 = default(NToken);
int seqResult = 0;
int arg_AE_0;
if (pos < text.Length && text[pos] == '(')
{
arg_AE_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_rounds_literal_"("_ < pos)
{
this._grammar._parsingErrors._token_rounds_literal_"("_ = pos;
}
arg_AE_0 = -1;
}
int newPos = arg_AE_0;
if (newPos >= 0)
{
token_ = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_13656 = pos2 >= 0;
bool arg_139_0;
if (_N_cache_13656)
{
if (true)
{
if (isBest)
{
arg_139_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos2);
arg_139_0 = (isBest || bestOffsets[0] == pos2);
}
goto IL_12E;
}
}
arg_139_0 = false;
IL_12E:
bool flag = arg_139_0;
if (!flag)
{
seqResult = -1;
}
else
{
int ofs0 = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_13657 = pos3 >= 0;
bool arg_1D0_0;
if (_N_cache_13657)
{
if (true)
{
if (isBest)
{
arg_1D0_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos3);
arg_1D0_0 = (isBest || bestOffsets[1] == pos3);
}
goto IL_1C5;
}
}
arg_1D0_0 = false;
IL_1C5:
bool flag2 = arg_1D0_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 0, ref token_2);
bool _N_cache_13658 = pos4 >= 0;
bool arg_26A_0;
if (_N_cache_13658)
{
if (true)
{
if (isBest)
{
arg_26A_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos4);
arg_26A_0 = (isBest || bestOffsets[2] == pos4);
}
goto IL_25F;
}
}
arg_26A_0 = false;
IL_25F:
bool flag3 = arg_26A_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos4;
int arg_302_0;
if (pos4 < text.Length && text[pos4] == ')')
{
arg_302_0 = pos4 + 1;
}
else
{
if (this._grammar._parsingErrors._token_rounds_literal_")"_ < pos4)
{
this._grammar._parsingErrors._token_rounds_literal_")"_ = pos4;
}
arg_302_0 = -1;
}
int newPos2 = arg_302_0;
if (newPos2 >= 0)
{
token_3 = new NToken(pos4, newPos2);
}
int pos5 = newPos2;
bool _N_cache_13659 = pos5 >= 0;
bool arg_38F_0;
if (_N_cache_13659)
{
if (true)
{
if (isBest)
{
arg_38F_0 = true;
}
else
{
isBest = (bestOffsets[3] < pos5);
arg_38F_0 = (isBest || bestOffsets[3] == pos5);
}
goto IL_384;
}
}
arg_38F_0 = false;
IL_384:
bool flag4 = arg_38F_0;
if (!flag4)
{
seqResult = -1;
}
else
{
int ofs3 = pos5;
int pos6 = this._grammar._#_s_(pos5, text);
bool _N_cache_13660 = pos6 >= 0;
bool arg_426_0;
if (_N_cache_13660)
{
if (true)
{
if (isBest)
{
arg_426_0 = true;
}
else
{
isBest = (bestOffsets[4] < pos6);
arg_426_0 = (isBest || bestOffsets[4] == pos6);
}
goto IL_41B;
}
}
arg_426_0 = false;
IL_41B:
bool flag5 = arg_426_0;
if (!flag5)
{
seqResult = -1;
}
else
{
int ofs4 = pos6;
int arg_4BC_0;
if (isBest)
{
bestOffsets[0] = ofs0;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
bestOffsets[3] = ofs3;
bestOffsets[4] = ofs4;
int i = 5;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_4BC_0 = pos6;
}
else
{
arg_4BC_0 = -1;
}
seqResult = arg_4BC_0;
}
}
}
}
}
int newPos3 = seqResult;
if (newPos3 >= 0)
{
result = new CalcParser.Rounds.Ast(new Location(this._grammar._parsingSource, token_.get_StartPos(), token_3.get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_, token_2, token_3);
}
return newPos3;
}
public _#prefix#__rounds_(IGrammar grammar) : base('\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#prefix#__seq_ : ExtensionPrefixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#prefix#__seq_.StaticDescriptor;
}
}
public override int Parse(int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_ = default(NToken);
list<CalcParser.Expr> token_2 = null;
NToken token_3 = default(NToken);
int seqResult = 0;
int arg_AE_0;
if (pos < text.Length && text[pos] == '{')
{
arg_AE_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_seq_literal_"{"_ < pos)
{
this._grammar._parsingErrors._token_seq_literal_"{"_ = pos;
}
arg_AE_0 = -1;
}
int newPos = arg_AE_0;
if (newPos >= 0)
{
token_ = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_13819 = pos2 >= 0;
bool arg_139_0;
if (_N_cache_13819)
{
if (true)
{
if (isBest)
{
arg_139_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos2);
arg_139_0 = (isBest || bestOffsets[0] == pos2);
}
goto IL_12E;
}
}
arg_139_0 = false;
IL_12E:
bool flag = arg_139_0;
if (!flag)
{
seqResult = -1;
}
else
{
int ofs0 = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_13820 = pos3 >= 0;
bool arg_1D0_0;
if (_N_cache_13820)
{
if (true)
{
if (isBest)
{
arg_1D0_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos3);
arg_1D0_0 = (isBest || bestOffsets[1] == pos3);
}
goto IL_1C5;
}
}
arg_1D0_0 = false;
IL_1C5:
bool flag2 = arg_1D0_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos3;
List<CalcParser.Expr> tmpList = new List<CalcParser.Expr>();
CalcParser.Expr token_4 = null;
int num = pos3;
while (true)
{
int newPos2 = this._grammar._#_expr_(num, text, 0, ref token_4);
if (newPos2 < 0)
{
break;
}
tmpList.Add(token_4);
num = newPos2;
}
int newPos3 = num;
token_2 = NCollectionsExtensions.NToList<CalcParser.Expr>(tmpList);
int pos4 = newPos3;
bool _N_cache_13821 = pos4 >= 0;
bool arg_2C8_0;
if (_N_cache_13821)
{
if (true)
{
if (isBest)
{
arg_2C8_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos4);
arg_2C8_0 = (isBest || bestOffsets[2] == pos4);
}
goto IL_2BD;
}
}
arg_2C8_0 = false;
IL_2BD:
bool flag3 = arg_2C8_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos4;
int arg_360_0;
if (pos4 < text.Length && text[pos4] == '}')
{
arg_360_0 = pos4 + 1;
}
else
{
if (this._grammar._parsingErrors._token_seq_literal_"}"_ < pos4)
{
this._grammar._parsingErrors._token_seq_literal_"}"_ = pos4;
}
arg_360_0 = -1;
}
int newPos4 = arg_360_0;
if (newPos4 >= 0)
{
token_3 = new NToken(pos4, newPos4);
}
int pos5 = newPos4;
bool _N_cache_13822 = pos5 >= 0;
bool arg_3ED_0;
if (_N_cache_13822)
{
if (true)
{
if (isBest)
{
arg_3ED_0 = true;
}
else
{
isBest = (bestOffsets[3] < pos5);
arg_3ED_0 = (isBest || bestOffsets[3] == pos5);
}
goto IL_3E2;
}
}
arg_3ED_0 = false;
IL_3E2:
bool flag4 = arg_3ED_0;
if (!flag4)
{
seqResult = -1;
}
else
{
int ofs3 = pos5;
int pos6 = this._grammar._#_s_(pos5, text);
bool _N_cache_13823 = pos6 >= 0;
bool arg_484_0;
if (_N_cache_13823)
{
if (true)
{
if (isBest)
{
arg_484_0 = true;
}
else
{
isBest = (bestOffsets[4] < pos6);
arg_484_0 = (isBest || bestOffsets[4] == pos6);
}
goto IL_479;
}
}
arg_484_0 = false;
IL_479:
bool flag5 = arg_484_0;
if (!flag5)
{
seqResult = -1;
}
else
{
int ofs4 = pos6;
int arg_51A_0;
if (isBest)
{
bestOffsets[0] = ofs0;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
bestOffsets[3] = ofs3;
bestOffsets[4] = ofs4;
int i = 5;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_51A_0 = pos6;
}
else
{
arg_51A_0 = -1;
}
seqResult = arg_51A_0;
}
}
}
}
}
int newPos5 = seqResult;
if (newPos5 >= 0)
{
result = new CalcParser.Seq.Ast(new Location(this._grammar._parsingSource, token_.get_StartPos(), token_3.get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_, token_2, token_3);
}
return newPos5;
}
public _#prefix#__seq_(IGrammar grammar) : base('\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
public class _#postfix#_sub_ : ExtensionPostfixBase<CalcParser.Expr>
{
private readonly CalcParser.GrammarImpl _grammar;
public override RuleDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl.GrammarDescriptorImpl._#postfix#_sub_.StaticDescriptor;
}
}
public override int Parse(int startPos, int pos, string text, int[] bestOffsets, ref CalcParser.Expr result)
{
bool isBest = false;
NToken token_2 = default(NToken);
CalcParser.Expr token_3 = null;
CalcParser.Expr prefixResult = result;
int seqResult = 0;
CalcParser.Expr token_4 = prefixResult;
bool _N_cache_13963 = pos >= 0;
bool arg_AE_0;
if (_N_cache_13963)
{
if (true)
{
if (isBest)
{
arg_AE_0 = true;
}
else
{
isBest = (bestOffsets[0] < pos);
arg_AE_0 = (isBest || bestOffsets[0] == pos);
}
goto IL_A3;
}
}
arg_AE_0 = false;
IL_A3:
bool flag = arg_AE_0;
if (!flag)
{
seqResult = -1;
}
else
{
int arg_146_0;
if (pos < text.Length && text[pos] == '-')
{
arg_146_0 = pos + 1;
}
else
{
if (this._grammar._parsingErrors._token_sub_literal_"-"_ < pos)
{
this._grammar._parsingErrors._token_sub_literal_"-"_ = pos;
}
arg_146_0 = -1;
}
int newPos = arg_146_0;
if (newPos >= 0)
{
token_2 = new NToken(pos, newPos);
}
int pos2 = newPos;
bool _N_cache_13964 = pos2 >= 0;
bool arg_1D5_0;
if (_N_cache_13964)
{
if (true)
{
if (isBest)
{
arg_1D5_0 = true;
}
else
{
isBest = (bestOffsets[1] < pos2);
arg_1D5_0 = (isBest || bestOffsets[1] == pos2);
}
goto IL_1CA;
}
}
arg_1D5_0 = false;
IL_1CA:
bool flag2 = arg_1D5_0;
if (!flag2)
{
seqResult = -1;
}
else
{
int ofs = pos2;
int pos3 = this._grammar._#_s_(pos2, text);
bool _N_cache_13965 = pos3 >= 0;
bool arg_26E_0;
if (_N_cache_13965)
{
if (true)
{
if (isBest)
{
arg_26E_0 = true;
}
else
{
isBest = (bestOffsets[2] < pos3);
arg_26E_0 = (isBest || bestOffsets[2] == pos3);
}
goto IL_263;
}
}
arg_26E_0 = false;
IL_263:
bool flag3 = arg_26E_0;
if (!flag3)
{
seqResult = -1;
}
else
{
int ofs2 = pos3;
int pos4 = this._grammar._#_expr_(pos3, text, 10, ref token_3);
bool _N_cache_13966 = pos4 >= 0;
bool arg_30B_0;
if (_N_cache_13966)
{
if (true)
{
if (isBest)
{
arg_30B_0 = true;
}
else
{
isBest = (bestOffsets[3] < pos4);
arg_30B_0 = (isBest || bestOffsets[3] == pos4);
}
goto IL_300;
}
}
arg_30B_0 = false;
IL_300:
bool flag4 = arg_30B_0;
if (!flag4)
{
seqResult = -1;
}
else
{
int ofs3 = pos4;
int arg_3A2_0;
if (isBest)
{
bestOffsets[0] = pos;
bestOffsets[1] = ofs;
bestOffsets[2] = ofs2;
bestOffsets[3] = ofs3;
int i = 4;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
arg_3A2_0 = pos4;
}
else
{
arg_3A2_0 = -1;
}
seqResult = arg_3A2_0;
}
}
}
}
int newPos2 = seqResult;
if (newPos2 >= 0)
{
result = new CalcParser.Sub.Ast(new Location(this._grammar._parsingSource, token_4.get_Location().get_StartPos(), token_3.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_4, token_2, token_3);
}
return newPos2;
}
public _#postfix#_sub_(IGrammar grammar) : base(10, '\0', '?')
{
this._grammar = (CalcParser.GrammarImpl)grammar;
}
}
private IncParser.GrammarImpl _#grammar#0;
private NumParser.GrammarImpl _#grammar#1;
private int _#_start_EndPos______ = -1;
private CalcParser.Start _#_start_Result______;
private int _#_start_StartPos____ = -1;
public ExtensionPostfixBase<CalcParser.Expr>[] _#_expr_PostfixRules_ = new ExtensionPostfixBase<CalcParser.Expr>[0];
public ExtensionPrefixBase<CalcParser.Expr>[] _#_expr_PrefixRules__ = new ExtensionPrefixBase<CalcParser.Expr>[0];
private int _#_expr_PrefixEndPos_ = -1;
private CalcParser.Expr _#_expr_PrefixResult_;
private int _#_expr_EndPos_______ = -1;
private CalcParser.Expr _#_expr_Result_______;
private int _#_expr_BindingPower_ = -1;
private int _#_expr_StartPos_____ = -1;
[CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never)]
private Parser _N_Parser_4162;
private CalcParser.GrammarImpl.ParsingErrorsImpl _parsingErrors;
private static readonly GrammarDescriptor _descriptor;
public override Parser Parser
{
get;
private set;
}
public static GrammarDescriptor StaticDescriptor
{
get
{
return CalcParser.GrammarImpl._descriptor;
}
}
public GrammarDescriptor Descriptor
{
get
{
return CalcParser.GrammarImpl._descriptor;
}
}
public new SourceSnapshot get_ParsingSource()
{
return base.ParsingSource;
}
public void Init()
{
this._parsingSource = this.Parser.get_ParsingSource();
this._parsingErrors = (CalcParser.GrammarImpl.ParsingErrorsImpl)this.Parser.GetParsingErrorsForGrammar(CalcParser.GrammarImpl.StaticDescriptor);
this._#grammar#1 = (NumParser.GrammarImpl)this.Parser.GetGrammar(NumParser.GrammarImpl.get_StaticDescriptor()).get_Value();
this._#grammar#0 = (IncParser.GrammarImpl)this.Parser.GetGrammar(IncParser.GrammarImpl.StaticDescriptor).get_Value();
this.LoadExtensionRules();
}
public IGrammarState SaveState()
{
return new CalcParser.GrammarImpl.GrammarStateImpl(this);
}
private void LoadExtensionRules()
{
checked
{
ExtensionPrefixBase<CalcParser.Expr>[] e = this._#_expr_PrefixRules__;
int result = 0;
if (e != null)
{
result = e.Length;
}
int prevLength = result;
Array.Resize<ExtensionPrefixBase<CalcParser.Expr>>(ref this._#_expr_PrefixRules__, prevLength + 5);
this._#_expr_PrefixRules__[prevLength + 0] = new CalcParser.GrammarImpl._#prefix#__neg_(this);
this._#_expr_PrefixRules__[prevLength + 1] = new CalcParser.GrammarImpl._#prefix#__num_(this);
this._#_expr_PrefixRules__[prevLength + 2] = new CalcParser.GrammarImpl._#prefix#__prefixDec_(this);
this._#_expr_PrefixRules__[prevLength + 3] = new CalcParser.GrammarImpl._#prefix#__rounds_(this);
this._#_expr_PrefixRules__[prevLength + 4] = new CalcParser.GrammarImpl._#prefix#__seq_(this);
ExtensionPostfixBase<CalcParser.Expr>[] e2 = this._#_expr_PostfixRules_;
int result2 = 0;
if (e2 != null)
{
result2 = e2.Length;
}
prevLength = result2;
Array.Resize<ExtensionPostfixBase<CalcParser.Expr>>(ref this._#_expr_PostfixRules_, prevLength + 8);
this._#_expr_PostfixRules_[prevLength + 0] = new CalcParser.GrammarImpl._#postfix#_add_(this);
this._#_expr_PostfixRules_[prevLength + 1] = new CalcParser.GrammarImpl._#postfix#_cond_(this);
this._#_expr_PostfixRules_[prevLength + 2] = new CalcParser.GrammarImpl._#postfix#_div_(this);
this._#_expr_PostfixRules_[prevLength + 3] = new CalcParser.GrammarImpl._#postfix#_mod_(this);
this._#_expr_PostfixRules_[prevLength + 4] = new CalcParser.GrammarImpl._#postfix#_mul_(this);
this._#_expr_PostfixRules_[prevLength + 5] = new CalcParser.GrammarImpl._#postfix#_postfixDec_(this);
this._#_expr_PostfixRules_[prevLength + 6] = new CalcParser.GrammarImpl._#postfix#_pow_(this);
this._#_expr_PostfixRules_[prevLength + 7] = new CalcParser.GrammarImpl._#postfix#_sub_(this);
}
}
private void ResetMemoization()
{
this._#_start_StartPos____ = -1;
this._#_start_Result______ = null;
this._#_start_EndPos______ = -1;
this._#_expr_StartPos_____ = -1;
this._#_expr_BindingPower_ = -1;
this._#_expr_Result_______ = null;
this._#_expr_EndPos_______ = -1;
this._#_expr_PrefixResult_ = null;
this._#_expr_PrefixEndPos_ = -1;
}
public int _#_start_(int pos, string text, ref CalcParser.Start result)
{
CalcParser.Expr token_ = null;
int arg_1D5_0;
if (this._#_start_StartPos____ == pos)
{
if (this._#_start_EndPos______ >= 0)
{
result = this._#_start_Result______;
}
arg_1D5_0 = this._#_start_EndPos______;
}
else
{
int seqResult = 0;
int pos2 = this._#_s_(pos, text);
if (pos2 < 0)
{
seqResult = -1;
}
else
{
int pos3 = this._#_expr_(pos2, text, 0, ref token_);
if (pos3 < 0)
{
seqResult = -1;
}
else
{
int newPos = this._#_any_(pos3, text);
if (newPos < 0)
{
if (this._parsingErrors._token_start_rule_"any"_ < pos3)
{
this._parsingErrors._token_start_rule_"any"_ = pos3;
}
}
int newPos2 = newPos;
int pos4 = (newPos2 >= 0) ? -1 : pos3;
if (pos4 < 0)
{
seqResult = -1;
}
else
{
seqResult = pos4;
}
}
}
int newPos3 = seqResult;
this._#_start_StartPos____ = pos;
this._#_start_EndPos______ = newPos3;
if (newPos3 >= 0)
{
result = new CalcParser.Start.Ast(new Location(this._parsingSource, token_.get_Location().get_StartPos(), token_.get_Location().get_EndPos()), list<ErrorInfo>.Nil._N_constant_object, token_);
this._#_start_Result______ = result;
}
arg_1D5_0 = newPos3;
}
return arg_1D5_0;
}
public int _#_start_(int pos, string text)
{
int seqResult = 0;
int pos2 = this._#_s_(pos, text);
if (pos2 < 0)
{
seqResult = -1;
}
else
{
int pos3 = this._#_expr_(pos2, text, 0);
if (pos3 < 0)
{
seqResult = -1;
}
else
{
int newPos = this._#_any_(pos3, text);
if (newPos < 0)
{
if (this._parsingErrors._token_start_rule_"any"_ < pos3)
{
this._parsingErrors._token_start_rule_"any"_ = pos3;
}
}
int newPos2 = newPos;
int pos4 = (newPos2 >= 0) ? -1 : pos3;
if (pos4 < 0)
{
seqResult = -1;
}
else
{
seqResult = pos4;
}
}
}
return seqResult;
}
public int _#_s_(int pos, string text)
{
int seqResult = 0;
int num = pos;
while (true)
{
int arg_8E_0;
if (num < text.Length && text[num] == ' ')
{
arg_8E_0 = num + 1;
}
else
{
if (this._parsingErrors._token_s_literal_" "_ < num)
{
this._parsingErrors._token_s_literal_" "_ = num;
}
arg_8E_0 = -1;
}
int newPos = arg_8E_0;
if (newPos < 0)
{
break;
}
num = newPos;
}
int pos2 = num;
if (pos2 < 0)
{
seqResult = -1;
}
else
{
seqResult = pos2;
}
return seqResult;
}
public int _#_expr_(int pos, string text, int bindingPower)
{
CalcParser.Expr result = null;
return this._#_expr_(pos, text, bindingPower, ref result);
}
public int _#_expr_(int pos, string text, int bindingPower, ref CalcParser.Expr curResult)
{
int _N_return = 0;
int[] bestOffsets = new int[32];
int curEndPos = -1;
CalcParser.Expr newResult = null;
if (this._#_expr_StartPos_____ == pos)
{
if (this._#_expr_EndPos_______ < 0)
{
_N_return = -1;
return _N_return;
}
if (this._#_expr_BindingPower_ == bindingPower)
{
curResult = this._#_expr_Result_______;
_N_return = this._#_expr_EndPos_______;
return _N_return;
}
this._#_expr_BindingPower_ = bindingPower;
this._#_expr_EndPos_______ = -1;
curResult = this._#_expr_PrefixResult_;
curEndPos = this._#_expr_PrefixEndPos_;
}
else
{
this._#_expr_BindingPower_ = bindingPower;
this._#_expr_StartPos_____ = pos;
this._#_expr_PrefixEndPos_ = -1;
this._#_expr_EndPos_______ = -1;
int i = 0;
while (i < bestOffsets.Length && bestOffsets[i] >= 0)
{
bestOffsets[i] = -1;
i++;
}
if (pos < text.Length)
{
char c = text[pos];
ExtensionPrefixBase<CalcParser.Expr>[] #_expr_PrefixRules__ = this._#_expr_PrefixRules__;
for (int k = 0; k < #_expr_PrefixRules__.Length; k++)
{
ExtensionPrefixBase<CalcParser.Expr> extensionPrefixBase = #_expr_PrefixRules__[k];
ExtensionPrefixBase<CalcParser.Expr> prefixRule = (ExtensionPrefixBase<CalcParser.Expr>)extensionPrefixBase;
if (prefixRule.get_LowerBound() <= c && c <= prefixRule.get_UpperBound())
{
int newEndPos = prefixRule.Parse(pos, text, bestOffsets, ref newResult);
if (newEndPos > 0)
{
curResult = newResult;
curEndPos = newEndPos;
}
}
}
}
else
{
ExtensionPrefixBase<CalcParser.Expr>[] #_expr_PrefixRules__2 = this._#_expr_PrefixRules__;
for (int l = 0; l < #_expr_PrefixRules__2.Length; l++)
{
ExtensionPrefixBase<CalcParser.Expr> extensionPrefixBase2 = #_expr_PrefixRules__2[l];
ExtensionPrefixBase<CalcParser.Expr> prefixRule2 = (ExtensionPrefixBase<CalcParser.Expr>)extensionPrefixBase2;
int newEndPos = prefixRule2.Parse(pos, text, bestOffsets, ref newResult);
if (newEndPos > 0)
{
curResult = newResult;
curEndPos = newEndPos;
}
}
}
}
if (curEndPos >= 0)
{
CalcParser.Expr prefixResult = curResult;
int prefixEndPos = curEndPos;
CalcParser.Expr bestResult = curResult;
int bestEndPos = curEndPos;
while (curEndPos < text.Length)
{
int j = 0;
while (j < bestOffsets.Length && bestOffsets[j] >= 0)
{
bestOffsets[j] = -1;
j++;
}
char c = text[curEndPos];
ExtensionPostfixBase<CalcParser.Expr>[] #_expr_PostfixRules_ = this._#_expr_PostfixRules_;
for (int m = 0; m < #_expr_PostfixRules_.Length; m++)
{
ExtensionPostfixBase<CalcParser.Expr> extensionPostfixBase = #_expr_PostfixRules_[m];
ExtensionPostfixBase<CalcParser.Expr> postfixRule = (ExtensionPostfixBase<CalcParser.Expr>)extensionPostfixBase;
if (postfixRule.get_LowerBound() <= c && c <= postfixRule.get_UpperBound() && bindingPower < postfixRule.get_BindingPower())
{
newResult = curResult;
int newEndPos = postfixRule.Parse(pos, curEndPos, text, bestOffsets, ref newResult);
if (newEndPos > 0)
{
bestEndPos = newEndPos;
bestResult = newResult;
}
}
}
if (bestEndPos == curEndPos)
{
IL_3A6:
this._#_expr_BindingPower_ = bindingPower;
this._#_expr_StartPos_____ = pos;
this._#_expr_PrefixResult_ = prefixResult;
this._#_expr_PrefixEndPos_ = prefixEndPos;
this._#_expr_Result_______ = curResult;
this._#_expr_EndPos_______ = curEndPos;
_N_return = curEndPos;
return _N_return;
}
curResult = bestResult;
curEndPos = bestEndPos;
}
goto IL_3A6;
}
_N_return = -1;
return _N_return;
}
public int _#_any_(int pos, string text)
{
int okPos = -1;
if (pos < text.Length)
{
int curPos = pos + 1;
okPos = curPos;
}
return okPos;
}
static GrammarImpl()
{
CalcParser.GrammarImpl._descriptor = new CalcParser.GrammarImpl.GrammarDescriptorImpl();
}
public GrammarImpl()
{
}
public GrammarImpl(Parser parser)
{
if (parser == null)
{
throw new ArgumentNullException("parser", "The ``NotNull'' contract of parameter ``parser'' has been violated. See Main.n:13:2:47:2: .");
}
this.Parser = parser;
}
public override Tuple<int, CalcParser.Expr> TryParseExpr(SourceSnapshot source)
{
checked
{
if (source == null)
{
throw new ArgumentNullException("source", "The ``NotNull'' contract of parameter ``source'' has been violated. See Main.n:13:2:47:2: .");
}
this.ResetMemoization();
this.Parser = new Parser(this, source);
GrammarDescriptor[] dependencies = this.Descriptor.get_Dependencies();
for (int i = 0; i < dependencies.Length; i++)
{
GrammarDescriptor grammarDescriptor = dependencies[i];
GrammarDescriptor descriptor = grammarDescriptor;
this.Parser.AddGrammar(descriptor);
}
this.Init();
CalcParser.Expr result = null;
int pos = this._#_expr_(0, this._parsingSource.get_Text(), 0, ref result);
return new Tuple<int, CalcParser.Expr>(pos, result);
}
}
public override Tuple<int, CalcParser.Start> TryParseStart(SourceSnapshot source)
{
checked
{
if (source == null)
{
throw new ArgumentNullException("source", "The ``NotNull'' contract of parameter ``source'' has been violated. See Main.n:13:2:47:2: .");
}
this.ResetMemoization();
this.Parser = new Parser(this, source);
GrammarDescriptor[] dependencies = this.Descriptor.get_Dependencies();
for (int i = 0; i < dependencies.Length; i++)
{
GrammarDescriptor grammarDescriptor = dependencies[i];
GrammarDescriptor descriptor = grammarDescriptor;
this.Parser.AddGrammar(descriptor);
}
this.Init();
CalcParser.Start result = null;
int pos = this._#_start_(0, this._parsingSource.get_Text(), ref result);
return new Tuple<int, CalcParser.Start>(pos, result);
}
}
}
public class Expr : Ast
{
public class Error : CalcParser.Expr
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Splice : CalcParser.Expr
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public Expr(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Add : CalcParser.Expr
{
public new class Error : CalcParser.Add
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Add
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Add
{
public readonly CalcParser.Expr l;
public readonly NToken op;
public readonly CalcParser.Expr r;
public Ast(Location location, list<ErrorInfo> error, CalcParser.Expr l, NToken op, CalcParser.Expr r) : base(location, error)
{
this.l = l;
this.op = op;
this.r = r;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.l.GetErrors(errors);
this.r.GetErrors(errors);
}
}
public Add(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Cond : CalcParser.Expr
{
public new class Error : CalcParser.Cond
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Cond
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Cond
{
public readonly CalcParser.Expr cond;
public readonly NToken q;
public readonly CalcParser.Expr l;
public readonly NToken colon;
public readonly CalcParser.Expr r;
public Ast(Location location, list<ErrorInfo> error, CalcParser.Expr cond, NToken q, CalcParser.Expr l, NToken colon, CalcParser.Expr r) : base(location, error)
{
this.cond = cond;
this.q = q;
this.l = l;
this.colon = colon;
this.r = r;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.cond.GetErrors(errors);
this.l.GetErrors(errors);
this.r.GetErrors(errors);
}
}
public Cond(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Div : CalcParser.Expr
{
public new class Error : CalcParser.Div
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Div
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Div
{
public readonly CalcParser.Expr l;
public readonly NToken op;
public readonly CalcParser.Expr r;
public Ast(Location location, list<ErrorInfo> error, CalcParser.Expr l, NToken op, CalcParser.Expr r) : base(location, error)
{
this.l = l;
this.op = op;
this.r = r;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.l.GetErrors(errors);
this.r.GetErrors(errors);
}
}
public Div(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Mod : CalcParser.Expr
{
public new class Error : CalcParser.Mod
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Mod
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Mod
{
public readonly CalcParser.Expr l;
public readonly NToken op;
public readonly CalcParser.Expr r;
public Ast(Location location, list<ErrorInfo> error, CalcParser.Expr l, NToken op, CalcParser.Expr r) : base(location, error)
{
this.l = l;
this.op = op;
this.r = r;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.l.GetErrors(errors);
this.r.GetErrors(errors);
}
}
public Mod(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Mul : CalcParser.Expr
{
public new class Error : CalcParser.Mul
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Mul
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Mul
{
public readonly CalcParser.Expr l;
public readonly NToken op;
public readonly CalcParser.Expr r;
public Ast(Location location, list<ErrorInfo> error, CalcParser.Expr l, NToken op, CalcParser.Expr r) : base(location, error)
{
this.l = l;
this.op = op;
this.r = r;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.l.GetErrors(errors);
this.r.GetErrors(errors);
}
}
public Mul(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Neg : CalcParser.Expr
{
public new class Error : CalcParser.Neg
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Neg
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Neg
{
public readonly NToken op;
public readonly CalcParser.Expr expr;
public Ast(Location location, list<ErrorInfo> error, NToken op, CalcParser.Expr expr) : base(location, error)
{
this.op = op;
this.expr = expr;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.expr.GetErrors(errors);
}
}
public Neg(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Num : CalcParser.Expr
{
public new class Error : CalcParser.Num
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Num
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Num
{
public readonly NumParser.Number num;
public Ast(Location location, list<ErrorInfo> error, NumParser.Number num) : base(location, error)
{
this.num = num;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.num.GetErrors(errors);
}
}
public Num(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class PostfixDec : CalcParser.Expr
{
public new class Error : CalcParser.PostfixDec
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.PostfixDec
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.PostfixDec
{
public readonly CalcParser.Expr expr;
public readonly NToken op;
public Ast(Location location, list<ErrorInfo> error, CalcParser.Expr expr, NToken op) : base(location, error)
{
this.expr = expr;
this.op = op;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.expr.GetErrors(errors);
}
}
public PostfixDec(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Pow : CalcParser.Expr
{
public new class Error : CalcParser.Pow
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Pow
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Pow
{
public readonly CalcParser.Expr l;
public readonly NToken op;
public readonly CalcParser.Expr r;
public Ast(Location location, list<ErrorInfo> error, CalcParser.Expr l, NToken op, CalcParser.Expr r) : base(location, error)
{
this.l = l;
this.op = op;
this.r = r;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.l.GetErrors(errors);
this.r.GetErrors(errors);
}
}
public Pow(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class PrefixDec : CalcParser.Expr
{
public new class Error : CalcParser.PrefixDec
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.PrefixDec
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.PrefixDec
{
public readonly NToken op;
public readonly CalcParser.Expr expr;
public Ast(Location location, list<ErrorInfo> error, NToken op, CalcParser.Expr expr) : base(location, error)
{
this.op = op;
this.expr = expr;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.expr.GetErrors(errors);
}
}
public PrefixDec(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Rounds : CalcParser.Expr
{
public new class Error : CalcParser.Rounds
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Rounds
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Rounds
{
public readonly NToken l;
public readonly CalcParser.Expr expr;
public readonly NToken r;
public Ast(Location location, list<ErrorInfo> error, NToken l, CalcParser.Expr expr, NToken r) : base(location, error)
{
this.l = l;
this.expr = expr;
this.r = r;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.expr.GetErrors(errors);
}
}
public Rounds(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Seq : CalcParser.Expr
{
public new class Error : CalcParser.Seq
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Seq
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Seq
{
public readonly NToken l;
public readonly list<CalcParser.Expr> expr;
public readonly NToken r;
public Ast(Location location, list<ErrorInfo> error, NToken l, list<CalcParser.Expr> expr, NToken r) : base(location, error)
{
this.l = l;
this.expr = expr;
this.r = r;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
list<CalcParser.Expr> list = this.expr;
while (list is list<CalcParser.Expr>.Cons)
{
CalcParser.Expr hd = ((list<CalcParser.Expr>.Cons)list).hd;
list<CalcParser.Expr> list2 = (list<CalcParser.Expr>)((list<CalcParser.Expr>.Cons)list).tl;
CalcParser.Expr _item = hd;
_item.GetErrors(errors);
list = (list<CalcParser.Expr>)list2;
}
}
}
public Seq(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Start : Nemerle.Parser.Ast
{
public class Error : CalcParser.Start
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Splice : CalcParser.Start
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Start
{
public readonly CalcParser.Expr expr;
public Ast(Location location, list<ErrorInfo> error, CalcParser.Expr expr) : base(location, error)
{
this.expr = expr;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.expr.GetErrors(errors);
}
}
public Start(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Sub : CalcParser.Expr
{
public new class Error : CalcParser.Sub
{
public Error(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public new class Splice : CalcParser.Sub
{
public Splice(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
public class Ast : CalcParser.Sub
{
public readonly CalcParser.Expr l;
public readonly NToken op;
public readonly CalcParser.Expr r;
public Ast(Location location, list<ErrorInfo> error, CalcParser.Expr l, NToken op, CalcParser.Expr r) : base(location, error)
{
this.l = l;
this.op = op;
this.r = r;
}
public override void GetErrors(List<ErrorInfo> errors)
{
base.GetErrors(errors);
this.l.GetErrors(errors);
this.r.GetErrors(errors);
}
}
public Sub(Location location, list<ErrorInfo> errors) : base(location, errors)
{
}
}
private SourceSnapshot _parsingSource;
public abstract override Parser Parser
{
get;
}
public SourceSnapshot ParsingSource
{
get
{
return this._parsingSource;
}
}
public string GetText(NToken tok)
{
return this._parsingSource.get_OriginalText().Substring(tok.get_StartPos(), checked(tok.get_EndPos() - tok.get_StartPos()));
}
public Location GetLocation(NToken tok)
{
return new Location(this._parsingSource, tok.get_StartPos(), tok.get_EndPos());
}
public option<CalcParser.Expr> ParseExpr(string text)
{
Tuple<int, CalcParser.Expr> _N_cache_5924 = this.TryParseExpr(text);
int pos = _N_cache_5924.Field0;
CalcParser.Expr res = _N_cache_5924.Field1;
return (pos >= 0) ? new option<CalcParser.Expr>.Some(res) : option<CalcParser.Expr>.None._N_constant_object;
}
public option<CalcParser.Expr> ParseExpr(SourceSnapshot source)
{
Tuple<int, CalcParser.Expr> _N_cache_5937 = this.TryParseExpr(source);
int pos = _N_cache_5937.Field0;
CalcParser.Expr res = _N_cache_5937.Field1;
return (pos >= 0) ? new option<CalcParser.Expr>.Some(res) : option<CalcParser.Expr>.None._N_constant_object;
}
public Tuple<int, CalcParser.Expr> TryParseExpr(string text)
{
return this.TryParseExpr(new SourceSnapshot(text, 0, ""));
}
public abstract override Tuple<int, CalcParser.Expr> TryParseExpr(SourceSnapshot source);
public option<CalcParser.Start> ParseStart(string text)
{
Tuple<int, CalcParser.Start> _N_cache_5954 = this.TryParseStart(text);
int pos = _N_cache_5954.Field0;
CalcParser.Start res = _N_cache_5954.Field1;
return (pos >= 0) ? new option<CalcParser.Start>.Some(res) : option<CalcParser.Start>.None._N_constant_object;
}
public option<CalcParser.Start> ParseStart(SourceSnapshot source)
{
Tuple<int, CalcParser.Start> _N_cache_5967 = this.TryParseStart(source);
int pos = _N_cache_5967.Field0;
CalcParser.Start res = _N_cache_5967.Field1;
return (pos >= 0) ? new option<CalcParser.Start>.Some(res) : option<CalcParser.Start>.None._N_constant_object;
}
public Tuple<int, CalcParser.Start> TryParseStart(string text)
{
return this.TryParseStart(new SourceSnapshot(text, 0, ""));
}
public abstract override Tuple<int, CalcParser.Start> TryParseStart(SourceSnapshot source);
}
|