예제 #1
0
 public void Visit(NodeTypeDef typeDef)
 {
 }
예제 #2
0
 public void Visit(NodeTypeDef typeDef)
 {
     symbols.InsertType(typeDef.Name, typeDef.modifiers, typeDef.Ty);
 }
예제 #3
0
 public void Visit(NodeTypeDef typeDef)
 {
     throw new NotImplementedException();
 }
예제 #4
0
 public void Visit(NodeTypeDef typeDef)
 {
     ResolveTy(typeDef.spTy);
 }
예제 #5
0
 public void Visit(NodeTypeDef typeDef)
 {
     log.Error(typeDef.Span, "A type def is not valid in a function.");
 }
예제 #6
0
 public void Visit(NodeTypeDef type)
 {
     Write("'type' ");
     Write(type.name.value);
     Write(" '=' ");
     WriteLine(type.Ty.ToString());
 }
예제 #7
0
        private NodeTypeDef ParseTypeDef(Modifiers mods)
        {
            var type = new NodeTypeDef();
            type.modifiers = mods;
            type.type = Current;
            Advance();

            var name = ExpectIdent("Identifier expected to name the type.");
            type.name = name.Image.Spanned(name.span);

            if (HasCurrent)
                type.eq = Current;
            Expect(EQ, "Expected '='.");

            type.spTy = ParseTy();

            return type;
        }