Exemple #1
0
        public GamaFunctionCompiler(GamaNamespaceContext ctx, GamaFunctionRef fn)
        {
            NamespaceContext = ctx;
            Self             = fn;
            Frame            = new GamaStackFrame();
            Builder          = ctx.This.Context.Context.CreateBuilder();

            ExpressionCompiler = new GamaExpressionCompiler(this);

            // This compiler is responsible for compiling most of the function related code
            // This is why this unit needs to add a block always
            // All blocks contain a special character in them (such as '.') to avoid mixing user code and compiler generated code
            // Compiler always works with single block at a time and compiler is single threaded. So this code won't hurt compiler.
            SetBlock(fn.AddBlock("code"));
        }
Exemple #2
0
 public GamaTopLevelCompiler(GamaGlobalContext ctx, GamaNamespace parent)
 {
     GlobalContext    = ctx;
     NamespaceContext = new GamaNamespaceContext(this, parent);
 }