public override void Visit(StructAST structAST) { var typeInfo = new CustomTypeInfo { type = structAST, kind = TypeKind.STRUCT, position = _currentNodePosition, scopeId = _currentScope.id, memberNameType = new Dictionary <string, TypeAST>() }; foreach (var member in structAST.Variables) { var variableDec = member as VariableDecAST; typeInfo.memberNameType.Add(variableDec.Name, variableDec.Type); } AddType(typeInfo); if (_currentScope.id != 0) { return; } GlobalTypes.Add(structAST.Name); }
public override void Visit(StructAST structAST) { foreach (var variable in structAST.Variables) { var decAssign = variable as VariableDecAssignAST; if (decAssign == null) { continue; } var exprType = _exprTypeVisitor.GetAstNodeType(_currentFileName, _currentScopeId, _currentNodePosition, decAssign.ExpressionValue); if (!IsSameTypeOrNullPtr(decAssign.Type, exprType)) { throw new Exception(string.Format("Type mismatch : struct variable '{0}' have type '{1}' but assigned '{2}' type", decAssign.Name, decAssign.Type, exprType)); } } }
public override void Visit(StructAST structAST) { }
public static LLVMTypeRef GetStructType(StructAST structAST, bool packed = false) { return(new LLVMTypeRef()); }
public virtual void Visit(StructAST structAST) { }