BitOrchestra.Parser.AcceptProgram C# (CSharp) Method

AcceptProgram() public static method

Parses a program in the given text.
public static AcceptProgram ( string Text, int &Index, Expression>.Dictionary &Variables, SoundOptions &Options, int &ErrorIndex ) : void
Text string
Index int
Variables Expression>.Dictionary
Options SoundOptions
ErrorIndex int
return void
        public static void AcceptProgram(string Text, ref int Index, ref Dictionary<string, Expression> Variables, ref SoundOptions Options, out int ErrorIndex)
        {
            Variables = new Dictionary<string, Expression>();
            Variables[Parameter] = IdentityExpression.Instance;
            Variables[Resolution] = ResolutionExpression.Instance;

            while (true)
            {
                AcceptExtendedWhitespace(Text, ref Index);

                if (AcceptOption(Text, ref Index, Options, out ErrorIndex))
                {
                    continue;
                }

                string varname = null;
                Expression varvalue = null;
                if (AcceptAssignment(Variables, Text, ref Index, ref varname, ref varvalue, out ErrorIndex))
                {
                    Variables[varname] = varvalue;
                    continue;
                }

                break;
            }

            AcceptExtendedWhitespace(Text, ref Index);
        }