public override void Visit(MainClassDeclNode node)
 {
     ClassBeingVisited = Analysis.Environment.Classes.Lookup(node.classIdentifier.name);
     MethodBeingVisited = ClassBeingVisited.Methods.Add("main");
     ParameterDefinition parameterDefinition = MethodBeingVisited.Parameters.Add("args");
     parameterDefinition.ParameterType = Analysis.Environment.Classes.Lookup("String").ClassType;
 }
Exemplo n.º 2
0
 public virtual void Visit(MainClassDeclNode node)
 {
     ClassBeingVisited = Analysis.Environment.Classes.Lookup(node.classIdentifier.name);
     MethodBeingVisited = ClassBeingVisited.Methods.Lookup("main");
     node.classIdentifier.Accept(this);
     node.mainParameterIdentifier.Accept(this);
     node.statement.Accept(this);
 }
Exemplo n.º 3
0
 public override void Visit(MainClassDeclNode node)
 {
     GenText("asm_main:");
     ClassBeingVisited = Analysis.Environment.Classes.Lookup(node.classIdentifier.name);
     MethodBeingVisited = ClassBeingVisited.Methods.Lookup("main");
     node.classIdentifier.Accept(this);
     node.mainParameterIdentifier.Accept(this);
     node.statement.Accept(this);
     Gen("ret", "", "", "Retrun from asm_main");
 }
 public override void Visit(MainClassDeclNode node)
 {
 }
Exemplo n.º 5
0
 public ProgramNode(MainClassDeclNode mainNode, ClassDeclListNode classListNode, int lineNumber)
 {
     this.mainClassDecl = mainNode;
     this.classDeclList = classListNode;
     this.lineNumber = lineNumber;
 }
 public override void Visit(MainClassDeclNode node)
 {
     ClassBeingVisited = Analysis.Environment.Classes.Lookup(node.classIdentifier.name);
     ClassBeingVisited.SizeInBytes = 0;
 }
 public override void Visit(MainClassDeclNode node)
 {
     ClassBeingVisited = Analysis.Environment.Classes.Add(node.classIdentifier.name);
 }
Exemplo n.º 8
0
 public ProgramNode(MainClassDeclNode mainNode, ClassDeclListNode classListNode, int lineNumber)
 {
     this.mainClassDecl = mainNode;
     this.classDeclList = classListNode;
     this.lineNumber    = lineNumber;
 }
Exemplo n.º 9
0
 public override void Visit(MainClassDeclNode node)
 {
     Console.WriteLine(this.indentation + "Class <Identifier: " + node.classIdentifier.name + ">          ---- Main Class ---");
     indentation = indentation + "   ";
     Console.WriteLine(this.indentation + "public override static main          ---- Main Method ----");
     indentation = indentation + "   ";
     Console.WriteLine(this.indentation + "returns void");
     Console.WriteLine(this.indentation + "Parameter <Identifier: " + node.mainParameterIdentifier.name + ">");
     indentation = indentation + "   ";
     Console.WriteLine(this.indentation + "Type: String[]");
     indentation = indentation.Substring(0, indentation.Length - 3);
     node.statement.Accept(this);
     indentation = indentation.Substring(0, indentation.Length - 6);
 }