示例#1
0
        public override SLValue VisitFunctionDecl(FunctionDeclContext ctx)
        {
            List <ITerminalNode> param = ctx.idList() != null?ctx.idList().Identifier().ToList() : new List <ITerminalNode>();

            List <TypeDefContext> paramType = ctx.idList() != null?ctx.idList().typeDef().ToList() : new List <TypeDefContext>();

            IParseTree block = ctx.block();
            String     id    = ctx.Identifier().GetText(); // + param.Count;

            functions[id] = new Function(param, paramType, block);
            return(SLValue.VOID);
        }
示例#2
0
 /// <summary>
 /// Pushes a <see cref="FunctionDeclContext"/> to the stack.
 /// </summary>
 /// <param name="context">The context.</param>
 public void PushFunctionDecl(FunctionDeclContext context)
 {
     Push(LocationTypes.FunctionDecl, context);
 }
示例#3
0
		/// <summary>
		/// Pushes a <see cref="FunctionDeclContext"/> to the stack.
		/// </summary>
		/// <param name="context">The context.</param>
		public void PushFunctionDecl(FunctionDeclContext context)
		{
			Push(LocationTypes.FunctionDecl, context);
		}