Пример #1
0
        public override void PreExecute(IPreExecutionContext pec)
        {
            // on créer des values à profusion
            foreach (string str in _types)
            {
                _localsVars.Add(pec.TypeManager.Find(str));
            }

            pec.LocalsVar = _localsVars;
        }
Пример #2
0
        public void Stop()
        {
            _strTok   = null;
            _analyzer = null;
            _tree     = null;
            _ctx      = null;
            _pec      = null;

            // Là on pète un event END_RUNNING
        }
Пример #3
0
        public int Start()
        {
            _strTok   = new StringTokenizer(_sourceCode);
            _analyzer = new Analyzer(_strTok, this);
            _tree     = _analyzer.ParseBody();

            if (_syntaxErrors.Count >= 1)
            {
                return(-1);
            }
            else
            {
                _pec  = new PreExecutionContext(this);
                _code = _pec.PreExecut(_tree);

                _ctx = new ExecutionContext(_code, this);
                return(0);
            }
        }
Пример #4
0
        public override void PreExecute(IPreExecutionContext pec)
        {
            Object function;

            FunctionScope fcs = pec.SearchFunction(_labels, out function);

            if (fcs == FunctionScope.External)
            {
                _fctToCall      = null;
                _externFunction = (Type)function;
                _nameOfMethod   = _labels[_labels.Count - 1];
            }
            else if (fcs == FunctionScope.Internal)
            {
                _fctToCall      = (Function)function;
                _externFunction = null;
                _nameOfMethod   = _labels[_labels.Count - 1];
            }
            else
            {
                pec.AddError("Error : Function not found.");
            }
        }
Пример #5
0
 public override void PreExecute(IPreExecutionContext pec)
 {
     pec.CurrentFunction.AddLabel(_label, pec.CurrentLineInstruction);
 }
Пример #6
0
 public virtual void PreExecute(IPreExecutionContext pec)
 {
     // Nothing
 }