Exemplo n.º 1
0
 public Runtime(string text = "", IFileCache fileCache = null)
 {
     Sys                   = new Sys();
     stack                 = new ValueStack();
     blockManager          = new BlockManager();
     printBuffer           = new Buffer();
     patternManager        = new PatternManager();
     Regions               = new RegionManager(Sys, text);
     expressionManager     = new ExpressionManager();
     FieldPattern          = (Pattern)(STRING_BEGIN_PATTERN + "+" + STRING_END_PATTERN);
     RecordPattern         = (Pattern)(STRING_BEGIN_PATTERN + "'`r`n' | '`r' | '`n'" + STRING_END_PATTERN);
     FieldSeparator        = (String)" ";
     RecordSeparator       = (String)"\r\n";
     seed                  = DateTime.Now.Millisecond;
     random                = new Random(seed);
     valueStacks           = new Stack <ValueStack>();
     FileCache             = fileCache ?? new StandardFileCache();
     takeArray             = new Array();
     defaultParameterNames = new Stack <DefaultParameterNames>();
     defaultParameterNames.Push(new DefaultParameterNames(true));
     buffer                   = new Buffer();
     ArgumentDepth            = 0;
     invokeables              = new Hash <string, IInvokeable>();
     extenders                = new Hash <string, InvokeableReference>();
     Parser.InClassDefinition = false;
     consoleManager           = new ConsoleManager();
     indent                   = "";
 }
Exemplo n.º 2
0
 public BlockState(Block block)
 {
     this.block = block;
     if (this.block.AutoRegister)
     {
         Runtime.State.RegisterBlock(this.block, this.block.ResolveVariables);
     }
     verbStack  = Runtime.State.Expressions.Current;
     valueStack = Runtime.State.Stack;
     Stringify  = null;
     index      = -1;
 }