예제 #1
0
        /// <summary>
        /// Tries to parse an entity from the specified syntactic machine state.
        /// In case of success returns true and advances parsing position.
        /// </summary>
        public override bool Parse(SyntacticState state)
        {
            if (state.IsEndOfData)
            {
                return(false);
            }

            LexicalEntry entry = state.GetInner(state.InnerPosition);

            if (entry.Key != m_item.Key)
            {
                return(false);
            }

            state.AddAbsolute(
                Key,
                state.InnerPosition + 1,
                entry.EndPosition);

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Tries to parse an entity from the specified syntactic machine state.
        /// In case of success returns true and advances parsing position.
        /// </summary>
        public override bool Parse(SyntacticState state)
        {
            if (state.IsEndOfData)
            {
                return(false);
            }

            LexicalEntry entry = state.GetInner(state.InnerPosition);
            string       text  = state.GetOuter(entry);

            if (text != m_text)
            {
                return(false);
            }

            state.AddAbsolute(
                Key,
                state.InnerPosition + 1,
                entry.EndPosition);

            return(true);
        }