예제 #1
0
파일: mysParser.cs 프로젝트: Koneke/Yukkuri
        public static List<mysToken> Parse(
			mysState state,
			string expression,
			object[] replaces = null
		)
        {
            ParseMachine pm = new ParseMachine(
                state,
                expression,
                replaces: replaces
            );

            while ( pm.CanStep() ) {
                pm.Step();
            }

            return pm.Tokens;
        }
예제 #2
0
파일: mysParser.cs 프로젝트: Koneke/Yukkuri
        void makeList()
        {
            int length = findBuddy( expression[ current ] ) - current + 1;

            string body = string.Join(
                " ", expression.Between( current + 1, length - 2)
            );

            ParseMachine pm = new ParseMachine(
                state,
                body,
                stringQueue,
                replaces
            );
            while ( pm.CanStep() ) {
                pm.Step();
            }

            List<mysToken> bodyTokens = pm.Tokens;

            Tokens.Add( new mysToken( bodyTokens ).Quote( quote ) );

            quote = false;

            expression.RemoveRange(
                current,
                length
            );

            current--;
        }