Example #1
0
        private bool Parse(Scanner scanner)
        {
            var parser = new Parser(scanner);
            var result = parser.Parse();

            Errors = scanner.Errors;
            ErrorLocations = scanner.ErrorLocations;
            SchemaInstance = parser.Model;

            return result;
        }
Example #2
0
 /// <summary>
 /// This function starts parsing of the schema input. Function returns true if parser didn't crash. 
 /// It means that it didn't encounter any error or all errors were caught in parser. These errors might
 /// be due to complex schema structure.
 /// </summary>
 /// <param name="schemaData">String representation of the Express schema</param>
 /// <returns>True if parser finished regularly, False if it crashed unexpectedly</returns>
 public bool Parse(string schemaData)
 {
     var scanner = new Scanner();
     scanner.SetSource(schemaData, 0);
     return Parse(scanner);
 }
Example #3
0
 /// <summary>
 /// This function starts parsing of the schema input. Function returns true if parser didn't crash. 
 /// It means that it didn't encounter any error or all errors were caught in parser. These errors might
 /// be due to complex schema structure.
 /// </summary>
 /// <param name="schema">Stream containing textual Express schema definition</param>
 /// <returns>True if parser finished regularly, False if it crashed unexpectedly</returns>
 public bool Parse(Stream schema)
 {
     var scanner = new Scanner(schema);
     return Parse(scanner);
 }