18 using System.Collections.Generic;
23 using ErrorManagement;
45 private bool isEntryPoint;
55 get {
return this.body; }
62 get {
return this.isEntryPoint; }
81 : base(id, returnType, parameters, modifiers, location) {
84 if (modifiers.Contains(
Modifier.Static) && id.Identifier.Equals(
"Main")) {
85 Program.SetEntryPointFound(this.Location);
86 this.isEntryPoint =
true;
101 return v.Visit(
this, o);
Encapsulates a definition of a concrete method.
Encapsulates a block of statements.
This class encapsulates a location in a specific file. Implements an Inmutable pattern. So it can be used in any context, that is his internal fields never change.
override Object Accept(Visitor v, Object o)
Accept method of a concrete visitor.
Encapsulates a identifier expression of our programming language.
Encapsulates a declaration of a concrete method.
MethodDefinition(SingleIdentifierExpression id, Block stats, string returnType, List< Parameter > parameters, List< Modifier > modifiers, Location location)
Constructor of MethodDefinition.
Location location
Location: Encapsulates in one object the line, column and filename
Modifier
Indicates differents modifiers to use in class (only public, internal or static), fields or methods...
bool IsEntryPoint
True if the method definition is a entry point. Otherwise, false.
Block Body
Gets the body of the method