public override int VisitClassDeclarationStatements([NotNull] ClepsParser.ClassDeclarationStatementsContext context) { if (context.ClassName == null) { //Some antlr parsing exception has occurred. Just exit. return(-1); } CurrentNamespaceAndClass.Add(context.ClassName.GetText()); string className = String.Join(".", CurrentNamespaceAndClass); //if this qualified name already exists, there is an error if (ClassManager.IsClassLoaded(className)) { string errorMessage = String.Format("Class {0} has multiple definitions", className); Status.AddError(new CompilerError(FileName, context.Start.Line, context.Start.Column, errorMessage)); //Don't process this class return(-1); } LLVMTypeRef structType = LLVM.StructCreateNamed(Context, className); ClassSkeletons[className] = structType; ClassManager.AddNewClass(className); CurrentNamespaceAndClass.RemoveAt(CurrentNamespaceAndClass.Count - 1); return(0); }