Пример #1
0
        void IRule.CreateScript(IGrammar grammar, string rule, string method, RuleMethodScript type)
        {
            switch (type)
            {
            case RuleMethodScript.onInit:
                _onInit = method;
                break;

            case RuleMethodScript.onParse:
                _onParse = method;
                break;

            case RuleMethodScript.onRecognition:
                _onRecognition = method;
                break;

            case RuleMethodScript.onError:
                _onError = method;
                break;

            default:
                // unknown method!!!
                System.Diagnostics.Debug.Assert(false);
                break;
            }
        }
Пример #2
0
        void IRule.CreateScript(IGrammar grammar, string rule, string method, RuleMethodScript type)
        {
            switch (type)
            {
            case RuleMethodScript.onInit:
                _onInit = method;
                break;

            case RuleMethodScript.onParse:
                _onParse = method;
                break;

            case RuleMethodScript.onRecognition:
                _onRecognition = method;
                break;

            case RuleMethodScript.onError:
                _onError = method;
                break;
            }
        }
Пример #3
0
 void IRule.CreateScript(IGrammar grammar, string rule, string method, RuleMethodScript type)
 {
     ((GrammarElement)grammar).CustomGrammar._scriptRefs.Add(new ScriptRef(rule, method, type));
 }
 internal ScriptRefStruct(string rule, RuleMethodScript method)
 {
     _rule   = rule;
     _method = method;
 }
Пример #5
0
 internal ScriptRef(string rule, string sMethod, RuleMethodScript method)
 {
     _rule    = rule;
     _sMethod = sMethod;
     _method  = method;
 }