Example #1
0
 private void ParseTypedefs()
 {
     while (scan.Peek().type == Token.Type.KW_TYPEDEF)
     {
         Symbols.TYPEDEF typedef = new Symbols.TYPEDEF(scan.Read());
         Symbols.Type    type    = ParseTypeSpecifier();
         Pair <Symbols.Var, Pair <Symbols.RefType, Symbols.RefType> > pair = ParseDeclarator();
         if (pair.last != null)
         {
             pair.last.last.SetType(type);
             type = pair.last.first;
         }
         typedef.SetName(pair.first.GetName());
         typedef.SetType(type);
         tstack.AddSymbol(typedef);
         CheckToken(scan.Peek(), Token.Type.SEMICOLON, true);
     }
 }
Example #2
0
 private void ParseTypedefs()
 {
     while (scan.Peek().type == Token.Type.KW_TYPEDEF)
     {
         Symbols.TYPEDEF typedef = new Symbols.TYPEDEF(scan.Read());
         Symbols.Type type = ParseTypeSpecifier();
         Pair<Symbols.Var, Pair<Symbols.RefType, Symbols.RefType>> pair = ParseDeclarator();
         if (pair.last != null)
         {
             pair.last.last.SetType(type);
             type = pair.last.first;
         }
         typedef.SetName(pair.first.GetName());
         typedef.SetType(type);
         tstack.AddSymbol(typedef);
         CheckToken(scan.Peek(), Token.Type.SEMICOLON, true);
     }
 }