Exemple #1
0
 public EOF(SymbolsGen yyp)
     : base(yyp)
 {
     this.yytext    = nameof(EOF);
     this.m_yynum   = 2;
     this.m_symtype = CSymbol.SymType.eofsymbol;
 }
Exemple #2
0
        public SymbolType(SymbolsGen yyp, string name, bool defined)
        {
            Lexer lexer  = yyp.m_lexer;
            int   length = name.IndexOf("+");
            int   num    = 0;

            if (length > 0)
            {
                num = int.Parse(name.Substring(length + 1));
                if (num > yyp.LastSymbol)
                {
                    yyp.LastSymbol = num;
                }
                name = name.Substring(0, length);
            }
            lexer.yytext = name;
            CSymbol csymbol1 = new CSymbol(yyp);

            if (num > 0)
            {
                csymbol1.m_yynum = num;
            }
            CSymbol csymbol2 = csymbol1.Resolve();

            if (defined)
            {
                csymbol2.m_defined = true;
            }
            this.m_name = name;
            this.m_next = yyp.stypes;
            yyp.stypes  = this;
        }
Exemple #3
0
 public Digraph(SymbolsGen s, Relation r, Func f1, Func f2, AddToFunc d)
 {
     sg = s; R = r; F1 = f1; F2 = f2; DF2 = d;
     N  = new int[sg.m_trans];
     for (int j = 0; j < sg.m_trans; j++)
     {
         N[j] = 0;
     }
 }
Exemple #4
0
 public ParserOldAction(SymbolsGen yyp)
     : base(yyp)
 {
     this.m_action = yyp.action_num++;
     yyp.actions.Add((object)this);
     this.m_sym     = (CSymbol)null;
     this.m_symtype = CSymbol.SymType.oldaction;
     yyp.OldAction(this);
 }
Exemple #5
0
 public Literal(SymbolsGen yyp)
     : base(yyp)
 {
     this.m_symtype = CSymbol.SymType.terminal;
 }
Exemple #6
0
 public SymbolType(SymbolsGen yyp, string name)
     : this(yyp, name, false)
 {
 }