Example #1
0
        static void Variable(out int value)
        {
            Expect(identifier_Sym);
            string ident_name = token.val;

            IO.Write(token.val);
            IO.Write("", 10 - token.val.Length);
            ;
            int lineNumber = token.line;

            value = VarTable.FindOffset(ident_name, lineNumber);
        }
Example #2
0
 static void Assem()
 {
     Expect(assem_Sym);
     Expect(EOL_Sym);
     Expect(begin_Sym);
     Expect(EOL_Sym);
     IO.WriteLine("ASSEM\nBEGIN");
     while (StartOf(1))
     {
         Statement();
     }
     Expect(end_Sym);
     Expect(point_Sym);
     while (la.kind == EOL_Sym)
     {
         Get();
     }
     LabelTable.CheckLabels();
     LabelTable.ListReferences(pretty);
     VarTable.ListReferences(pretty);
 }