예제 #1
0
        // This method actually returns a Dictionary<string, eeObject>, but uses eeObject as a vehicle as to conform to the visitor's uniform return type
        public override eeObject VisitFn_args([NotNull] EelooParser.Fn_argsContext ctx)
        {
            // add this to scope
            Interpreter.currentScope.scopeCtx = ctx;

            // key is argument name, value is the default value if one is provided
            ArgList arguments
                = new ArgList();

            var args = ctx.fn_arg();

            if (args != null)
            {
                foreach (var arg in args)
                {
                    if (arg.exp() == null)
                    {
                        arguments.Add(arg.IDENTIFIER().GetText(), null);
                    }
                    else
                    {
                        arguments.Add(arg.IDENTIFIER().GetText(), Visit(arg.exp()));
                    }
                }
            }

            return(new eeObject(arguments)
            {
                type = eeObjectType.internal_FN_ARG_LIST
            });
        }
 public virtual string PInvokeFunctionHeader(string functionName)
 {
     for (var i = 0; i <= Arguments.Length - 1; i++)
     {
         args.Add(Arguments[i].PInvokeCallParameter);
     }
     return(string.Format("{0} {1}({2})", ReturnType.PInvokeSymbol, functionName, args.Join()));
 }
예제 #3
0
파일: frmMain.cs 프로젝트: bwoogie/Baiter
        private void btnLaunch_Click(object sender, EventArgs e)
        {
            if (lbPopups.SelectedIndex == -1)
            {
                return;
            }

            frmBrowser browser = new frmBrowser();

            ArgList args = new ArgList();

            foreach (TextBox tb in flpArgs.Controls)
            {
                Argument newArg = GetPopups()[lbPopups.SelectedIndex].Arguments.GetArgumentByName(tb.Name);
                newArg.Value = tb.Text;
                args.Add(newArg);
            }
            Visible = false;
            browser.SetPopup(GetPopups()[lbPopups.SelectedIndex], args);
            browser.Show();
        }