Beispiel #1
0
        public void Accept(ICodeVisitor visitor)
        {
            visitor.VisitMethodBody(this);
            m_variables.Accept(visitor);
            m_instructions.Accept(visitor);
            m_exceptions.Accept(visitor);

            visitor.TerminateMethodBody(this);
        }
 public override void Dispatch(ICodeVisitor visitor) {
   CompileTimeConstant labelIndex = new CompileTimeConstant(this.rootClass.GetLabelIndex(this.TargetLabel.Name), this.TargetLabel.SourceLocation);
   labelIndex.SetContainingExpression(this.TargetLabel);
   List<Expression> arguments = new List<Expression>(1);
   arguments.Add(labelIndex);
   IMethodDefinition constructor = Dummy.Method;
   foreach (IMethodDefinition cons in this.rootClass.TypeDefinition.GetMembersNamed(this.Compilation.NameTable.Ctor, false)) {
     constructor = cons; break;
   }
   Expression thisArgument = new CreateObjectInstanceForResolvedConstructor(constructor, arguments, this.SourceLocation);
   //^ assume this.ContainingBlock.ContainingMethodDeclaration != null;
   MethodCall mcall = new ResolvedMethodCall(this.rootClass.MainMethod.MethodDefinition, thisArgument, new List<Expression>(0), this.SourceLocation);
   ExpressionStatement gosub = new ExpressionStatement(mcall);
   gosub.Dispatch(visitor);
 }
Beispiel #3
0
 public App(
     ISyntaxNodesToClasses syntaxNodesToClasse,
     ISyntaxNodesToCollections syntaxNodesToCollections,
     ISyntaxNodesToCsv syntaxNodesToCsv,
     ICodeVisitor codeVisitor,
     IConfigManager configManager,
     ISyntaxWalker syntaxWalker,
     IDatabaseManager databaseManager)
 {
     _syntaxNodesToClasses     = syntaxNodesToClasse;
     _syntaxNodesToCollections = syntaxNodesToCollections;
     _syntaxNodesToCsv         = syntaxNodesToCsv;
     _codeVisitor     = codeVisitor;
     _configManager   = configManager;
     _syntaxWalker    = syntaxWalker;
     _databaseManager = databaseManager;
 }
Beispiel #4
0
        public void Accept(ICodeVisitor visitor)
        {
            visitor.VisitMethodBody(this);
            if (HasVariables)
            {
                m_variables.Accept(visitor);
            }
            m_instructions.Accept(visitor);
            if (HasExceptionHandlers)
            {
                m_exceptions.Accept(visitor);
            }
            if (HasScopes)
            {
                m_scopes.Accept(visitor);
            }

            visitor.TerminateMethodBody(this);
        }
Beispiel #5
0
 public void Accept(ICodeVisitor visitor)
 {
     visitor.VisitExceptionHandlerCollection(this);
 }
Beispiel #6
0
 public override void Dispatch(ICodeVisitor visitor)
 {
     visitor.Visit(this); // do not go to base.Dispatch because it will not do anything for const decls
 }
Beispiel #7
0
 public override void Dispatch(ICodeVisitor visitor)
 {
     this.WrappedStatement.Dispatch(visitor);
 }
Beispiel #8
0
 public override void AcceptVisitor(ICodeVisitor visitor)
 {
     visitor?.VisitUserDefinedType(this);
 }
Beispiel #9
0
		public override void Accept (ICodeVisitor visitor)
		{
			visitor.VisitVariableDefinition (this);
		}
Beispiel #10
0
 public void Accept(ICodeVisitor visitor)
 {
     visitor.VisitInstruction(this);
 }
Beispiel #11
0
 public abstract void Accept(ICodeVisitor visitor);
Beispiel #12
0
 /// <summary>
 /// Calls the visitor.Visit(IExpressionStatement) method on an assignment statement that initializes the local.
 /// </summary>
 public override void Dispatch(ICodeVisitor visitor)
 {
 }
Beispiel #13
0
 public override void Dispatch(ICodeVisitor visitor)
 {
     this.WrappedStatement.Dispatch(visitor);
 }
Beispiel #14
0
 /// <summary>
 /// Calls visitor.Visit(INamedArgument).
 /// </summary>
 public override void Dispatch(ICodeVisitor visitor)
 {
     visitor.Visit((INamedArgument)this);
 }
Beispiel #15
0
 public override void Dispatch(ICodeVisitor visitor)
 {
     visitor.Visit(this); // do not go to base.Dispatch because it will not do anything for const decls
 }
Beispiel #16
0
 /// <summary>
 /// Calls visitor.Visit(ICreateArray).
 /// </summary>
 public override void Dispatch(ICodeVisitor visitor)
 {
     visitor.Visit((ICreateArray)this);
 }
Beispiel #17
0
 /// <summary>
 /// Calls visitor.Visit(ICompileTimeConstant).
 /// </summary>
 public override void Dispatch(ICodeVisitor visitor)
 {
     visitor.Visit((ICompileTimeConstant)this);
 }
Beispiel #18
0
 public override void Dispatch(ICodeVisitor visitor)
 {
     //Debug.Assert(false); //Objects of this class are not supposed to escape.
 }
Beispiel #19
0
		public void Accept (ICodeVisitor visitor)
		{
			visitor.VisitInstructionCollection (this);
		}
Beispiel #20
0
 public override void Accept(ICodeVisitor visitor)
 {
     visitor.Visit(this);
 }
 public void Accept(ICodeVisitor visitor)
 {
     visitor.VisitScopeCollection(this);
 }
 public static void Accept(this Collection<ExceptionHandler> col, ICodeVisitor visitor)
 {
     col.ToList().ForEach(e => visitor.VisitExceptionHandler(e));
 }
Beispiel #23
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="visitor"></param>
 public void Dispatch(ICodeVisitor visitor) {
   visitor.Visit(this);
 }
Beispiel #24
0
 public void Dispatch(ICodeVisitor visitor)
 {
     Contract.Requires(visitor != null);
     throw new NotImplementedException();
 }
Beispiel #25
0
 public override void AcceptVisitor(ICodeVisitor visitor)
 {
     visitor?.VisitIf(this);
 }
Beispiel #26
0
 public DeepFirstWalker(ICodeVisitor codeVisitor, ILogger <DeepFirstWalker> logger)
 {
     _codeVisitor = codeVisitor;
     _logger      = logger;
 }
Beispiel #27
0
 public override void Dispatch(ICodeVisitor visitor)
 {
     this.Expression.Dispatch(visitor);
 }
Beispiel #28
0
 public void Dispatch(ICodeVisitor visitor) {
 }
Beispiel #29
0
 public void Dispatch(ICodeVisitor visitor)
 {
     throw new NotImplementedException();
 }
 public override void Accept(ICodeVisitor visitor)
 {
     visitor.VisitVariableDefinition(this);
 }
		public void Accept (ICodeVisitor visitor)
		{
			visitor.VisitVariableDefinitionCollection (this);
		}
		public void Accept (ICodeVisitor visitor)
		{
			visitor.VisitMethodBody (this);
			if (HasVariables)
				m_variables.Accept (visitor);
			m_instructions.Accept (visitor);
			if (HasExceptionHandlers)
				m_exceptions.Accept (visitor);
			if (HasScopes)
				m_scopes.Accept (visitor);

			visitor.TerminateMethodBody (this);
		}
Beispiel #33
0
 public void Dispatch(ICodeVisitor visitor)
 {
 }
Beispiel #34
0
 public override void Dispatch(ICodeVisitor visitor)
 {
     visitor.Visit(this);
 }
Beispiel #35
0
 /// <summary>
 /// Calls the visitor.Visit(IExpressionStatement) method on an assignment statement that initializes the local. 
 /// </summary>
 public override void Dispatch(ICodeVisitor visitor)
 {
 }
 public override void AcceptVisitor(ICodeVisitor visitor)
 {
     visitor?.VisitFunction(this);
 }
		public void Accept (ICodeVisitor visitor)
		{
			visitor.VisitExceptionHandler (this);
		}
Beispiel #38
0
 public void Dispatch(ICodeVisitor visitor)
 {
     Contract.Requires(visitor != null);
       throw new NotImplementedException();
 }
Beispiel #39
0
 public void Accept(ICodeVisitor visitor)
 {
     visitor.VisitVariableDefinitionCollection(this);
 }
		public void Accept (ICodeVisitor visitor)
		{
			visitor.VisitScopeCollection (this);
		}
Beispiel #41
0
 public override void AcceptVisitor(ICodeVisitor visitor)
 {
     visitor?.VisitNamespace(this);
 }
Beispiel #42
0
 public override void Dispatch(ICodeVisitor visitor)
 {
     //Debug.Assert(false); //Objects of this class are not supposed to escape.
 }
Beispiel #43
0
 public override void AcceptVisitor(ICodeVisitor visitor)
 {
     visitor?.VisitProperty(this);
 }
Beispiel #44
0
		public void Accept (ICodeVisitor visitor)
		{
			visitor.VisitScope (this);
		}
Beispiel #45
0
 /// <summary>
 /// Calls the visitor.Visit(T) method where T is the most derived object model node interface type implemented by the concrete type
 /// of the object implementing IDoubleDispatcher. The dispatch method does not invoke Dispatch on any child objects. If child traversal
 /// is desired, the implementations of the Visit methods should do the subsequent dispatching.
 /// </summary>
 public abstract void Dispatch(ICodeVisitor visitor);
Beispiel #46
0
 public override void AcceptVisitor(ICodeVisitor visitor)
 {
     visitor?.VisitVariable(this);
 }
Beispiel #47
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="visitor"></param>
 public override void Dispatch(ICodeVisitor visitor) {
   visitor.Visit(this);
 }
Beispiel #48
0
 public override void Dispatch(ICodeVisitor visitor)
 {
     throw new NotImplementedException();
 }
Beispiel #49
0
 public abstract void Accept(ICodeVisitor visitor);
 public static void Accept(this Collection<Instruction> col, ICodeVisitor visitor)
 {
     col.ToList().ForEach(e => visitor.VisitInstruction(e));
 }
Beispiel #51
0
		public void Accept (ICodeVisitor visitor)
		{
			visitor.VisitMethodBody (this);
			m_variables.Accept (visitor);
			m_instructions.Accept (visitor);
			m_exceptions.Accept (visitor);

			visitor.TerminateMethodBody (this);
		}
 public static void Accept(this Collection<VariableDefinition> col, ICodeVisitor visitor)
 {
     col.ToList().ForEach(e => visitor.VisitVariableDefinition(e));
 }
 public void Accept(ICodeVisitor visitor)
 {
     visitor.VisitScope(this);
 }
 public override void AcceptVisitor(ICodeVisitor visitor)
 {
     // no implementation here
 }