コード例 #1
0
        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()));
        }
コード例 #2
0
 public Yumascript(bool DEBUG_MODE)
 {
     YSLexer.DEBUG 		= DEBUG_MODE;
     YSRDParser.DEBUG	= DEBUG_MODE;
     YSInterpreter.DEBUG = DEBUG_MODE;
     YSStateModule.DEBUG	= DEBUG_MODE;
     State =  new YSStateModule ();
 }
コード例 #3
0
 public Yumascript(bool DEBUG_MODE)
 {
     YSLexer.DEBUG       = DEBUG_MODE;
     YSRDParser.DEBUG    = DEBUG_MODE;
     YSInterpreter.DEBUG = DEBUG_MODE;
     YSStateModule.DEBUG = DEBUG_MODE;
     State = new YSStateModule();
 }
コード例 #4
0
 public bool Interpret(ref YSStateModule state)
 {
     Console.WriteLine ("Beginning Program...");
     STATE = state;
     STATE.SetContext (this);
     bool result = Program (Node);
     state = STATE;
     return result;
 }
コード例 #5
0
    public bool Interpret(ref YSStateModule state)
    {
        Console.WriteLine("Beginning Program...");
        STATE = state;
        STATE.SetContext(this);
        bool result = Program(Node);

        state = STATE;
        return(result);
    }
コード例 #6
0
 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;
 }
コード例 #7
0
    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);
    }
コード例 #8
0
 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());
 }