public static IDPacket CreateIDPacket(YSStateModule state, string name, IdentityType type) { ScopeFrame[] scope_stack = state.Scope_Stack.ToArray(); string path = "/"; for (int i = scope_stack.Length - 1; i >= 0; i--) { if (scope_stack [i].Type == ScopeFrame.FrameTypes.Structure) { path += "s:"; } else if (scope_stack [i].Type == ScopeFrame.FrameTypes.Function) { path += "f:"; } else if (scope_stack [i].Type == ScopeFrame.FrameTypes.Loop) { path += "l:"; } else { path += "u:"; } path += scope_stack [i].Name + "/"; } state.Debug("Created IDPacket with path: " + path.Trim() + " name: " + name); return(new IDPacket(name, type, path.Trim())); }
public Yumascript(bool DEBUG_MODE) { YSLexer.DEBUG = DEBUG_MODE; YSRDParser.DEBUG = DEBUG_MODE; YSInterpreter.DEBUG = DEBUG_MODE; YSStateModule.DEBUG = DEBUG_MODE; State = new YSStateModule (); }
public Yumascript(bool DEBUG_MODE) { YSLexer.DEBUG = DEBUG_MODE; YSRDParser.DEBUG = DEBUG_MODE; YSInterpreter.DEBUG = DEBUG_MODE; YSStateModule.DEBUG = DEBUG_MODE; State = new YSStateModule(); }
public bool Interpret(ref YSStateModule state) { Console.WriteLine ("Beginning Program..."); STATE = state; STATE.SetContext (this); bool result = Program (Node); state = STATE; return result; }
public bool Interpret(ref YSStateModule state) { Console.WriteLine("Beginning Program..."); STATE = state; STATE.SetContext(this); bool result = Program(Node); state = STATE; return(result); }
public static bool LPIProcess(ref YSStateModule state, string raw) { bool result = false; YSLexer lexer = new YSLexer(raw); YSRDParser parser = new YSRDParser (lexer.GetTokenList()); if(parser.Parse() <= YSInterpreter.ERR_ACCEPT){ YSInterpreter interpreter = new YSInterpreter (parser.PopLast()); result = interpreter.Interpret(ref state); } else Console.WriteLine("Interpreter not started, parsing was aborted"); return result; }
public static bool LPIProcess(ref YSStateModule state, string raw) { bool result = false; YSLexer lexer = new YSLexer(raw); YSRDParser parser = new YSRDParser(lexer.GetTokenList()); if (parser.Parse() <= YSInterpreter.ERR_ACCEPT) { YSInterpreter interpreter = new YSInterpreter(parser.PopLast()); result = interpreter.Interpret(ref state); } else { Console.WriteLine("Interpreter not started, parsing was aborted"); } return(result); }
public static IDPacket CreateIDPacket(YSStateModule state, string name, IdentityType type) { ScopeFrame[] scope_stack = state.Scope_Stack.ToArray (); string path = "/"; for (int i = scope_stack.Length - 1; i >= 0; i--) { if (scope_stack [i].Type == ScopeFrame.FrameTypes.Structure) path += "s:"; else if (scope_stack [i].Type == ScopeFrame.FrameTypes.Function) path += "f:"; else if (scope_stack [i].Type == ScopeFrame.FrameTypes.Loop) path += "l:"; else path += "u:"; path += scope_stack [i].Name + "/"; } state.Debug ("Created IDPacket with path: " + path.Trim() + " name: " + name); return new IDPacket (name, type, path.Trim()); }