예제 #1
0
        public void ValidateIdent_ShouldReturnFalse(string input)
        {
            ILexicalRules identValidator = new BracesIdent();
            bool          result         = identValidator.validate(input);

            Assert.False(result);
        }
예제 #2
0
        public bool IsGrammarCorrect()
        {
            AttrRef attrRef = new AttrRef(text, declarations);

            if (attrRef.IsGrammarCorrect())
            {
                refType = attrRef.refType;
                return(true);
            }

            ProglineSynonym proglineSynonym = new ProglineSynonym(text, declarations);

            if (proglineSynonym.IsGrammarCorrect())
            {
                refType = RefType.Integer;
                return(true);
            }

            BracesIdent bracesIdent = new BracesIdent();

            if (bracesIdent.validate(text))
            {
                refType = RefType.String;
                return(true);
            }

            IntegerRule integerRule = new IntegerRule();

            if (integerRule.validate(text))
            {
                refType = RefType.Integer;
                return(true);
            }


            return(false);
        }