Beispiel #1
0
        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;
        }
Beispiel #2
0
        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--;
        }