private void processType(BaseTypeNode type) {
        switch(type.type()) {
            case ARRAY:
            {
                ArrayTypeNode a = (ArrayTypeNode)type;

                processType(a.element);
                if(a.length != null) {
                    processNode(a.length);

                    a.setRealType(
                        new ArrayType(
                            a.element.realType(),
                            a.length.value,
                            a.constancy)
                        );
                } else {
                    a.setRealType(
                        new ArrayType(
                            a.element.realType(),
                            a.constancy)
                        );
                }

                break;
            }
            case PRIMITIVE_TYPE:
            {
                PrimitiveTypeNode p = (PrimitiveTypeNode)type;

                switch(p.primitive()) {
                    case POINTER:
                    {
                        PointerTypeNode pointer = (PointerTypeNode)p;
                        processType(pointer.pointerType);

                        p.setRealType(
                            new PointerType(
                                pointer.pointerType.realType(), 
                                pointer.constancy)
                            );
                        break;
                    }
                    case INT:
                    {
                        p.setRealType(
                            new PrimitiveType(
                                PrimitiveType.Type.INT, 
                                p.constancy)
                            );
                        break;
                    }
                    case DOUBLE:
                    {
                        p.setRealType(
                            new PrimitiveType(
                                PrimitiveType.Type.DOUBLE, 
                                p.constancy)
                            );
                        break;
                    }
                    case FLOAT:
                    {
                        p.setRealType(
                            new PrimitiveType(
                                PrimitiveType.Type.FLOAT, 
                                p.constancy)
                            );
                        break;
                    }
                    case CHAR:
                    {
                        p.setRealType(
                            new PrimitiveType(
                                PrimitiveType.Type.CHAR, 
                                p.constancy)
                            );
                        break;
                    }
                    case VOID:
                    {
                        p.setRealType(
                            new PrimitiveType(
                                PrimitiveType.Type.VOID, 
                                p.constancy)
                            );
                        break;
                    }
                    case BOOL:
                    {
                        p.setRealType(
                            new PrimitiveType(
                                PrimitiveType.Type.BOOL, 
                                p.constancy)
                            );
                        break;
                    }
                    case LONG:
                    {
                        p.setRealType(
                            new PrimitiveType(
                                PrimitiveType.Type.LONG, 
                                p.constancy)
                            );
                        break;
                    }
                }

                break;
            }
            case STRUCT:
            {
                StructTypeNode s = (StructTypeNode)type;
                StructSymbol struct = (StructSymbol)context.global().get(s.name);
                assert struct == null;

                s.setRealType(struct.type);

                break;
            }
            case FUNCTION:
            {
                FunctionTypeNode f = (FunctionTypeNode)type;
                
                for(FunctionTypeNode.ArgumentNode arg : f.arguments) {
                    processType(arg.type);
                    arg.setRealType(arg.type.realType());
                }
                processType(f.returnValue);

                List<FunctionType.Argument> arguments = 
                        new LinkedList<FunctionType.Argument>();

                for(FunctionTypeNode.ArgumentNode arg : f.arguments) {
                    arguments.add(arg.toArgument());
                }

                f.setRealType(
                    new FunctionType(
                        f.returnValue.realType(),
                        arguments,
                        f.constancy)
                    );

                break;
            }
            case INVALID:
            {
                type.setRealType(new InvalidType());
                break;
            }
        }
    }