Hybrid parsing system and method
First Claim
1. A method for parsing a markup file, comprising:
- parsing a first portion of the markup file with a lightweight parser in a computer system, the lightweight parser being capable of performing a first set of parsing tasks;
parsing a second portion of the markup file with a heavyweight parser in the computer system, the heavyweight parser being capable of performing a second set of parsing tasks, wherein the first set of parsing tasks is a subset of the second set of parsing tasks;
detecting an occurrence of a transition event, the transition event comprising a requirement that the lightweight parser perform a parsing task excluded from the first set of parsing tasks; and
transitioning between the parsing of the first portion of the markup file with the lightweight parser to the parsing of the second portion of the markup file with the heavyweight parser upon the occurrence of the transition event.
2 Assignments
0 Petitions
Accused Products
Abstract
A system and method are provided for parsing a markup file. The present system includes a hybrid parser that employs both a lightweight parser and a heavy weight parser to parse a markup file. The lightweight parser is capable of performing a first set of parsing tasks and the heavyweight parser is capable of performing a second set of parsing tasks, where the first set of parsing tasks is a subset of the second set of parsing tasks. In addition, the hybrid parser provides for transitioning a parsing of a markup file from the lightweight parser to the heavyweight parser upon an occurrence of a transition event. A transition event is defined, for example, as the circumstance where the lightweight parser is required to perform a parsing task that is beyond its capability.
49 Citations
19 Claims
-
1. A method for parsing a markup file, comprising:
-
parsing a first portion of the markup file with a lightweight parser in a computer system, the lightweight parser being capable of performing a first set of parsing tasks;
parsing a second portion of the markup file with a heavyweight parser in the computer system, the heavyweight parser being capable of performing a second set of parsing tasks, wherein the first set of parsing tasks is a subset of the second set of parsing tasks;
detecting an occurrence of a transition event, the transition event comprising a requirement that the lightweight parser perform a parsing task excluded from the first set of parsing tasks; and
transitioning between the parsing of the first portion of the markup file with the lightweight parser to the parsing of the second portion of the markup file with the heavyweight parser upon the occurrence of the transition event. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A program embodied in a computer readable medium employed to parse a markup file, comprising:
-
a lightweight parser that performs a first set of parsing tasks to parse the markup file;
a heavyweight parser that performs a second set of parsing tasks to parse the markup file, wherein the first set of parsing tasks is a subset of the second set of parsing tasks; and
code that transitions a parsing of the markup file from the lightweight parser to the heavyweight parser upon an occurrence of a transition event, wherein the transition event further comprises a requirement that the lightweight parser perform a parsing task excluded from the first set of parsing tasks. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A system for parsing a markup file, comprising:
-
first means for parsing the markup file employing a first set of parsing tasks;
second means for parsing the markup file employing a second set of parsing tasks, wherein the first set of parsing tasks is a subset of the second set of parsing tasks;
and means for transitioning a parsing of the markup file from the first means to the second means upon an occurrence of a transition event, wherein the transition event further comprises a requirement that the first means perform a parsing task excluded from the first set of parsing tasks. - View Dependent Claims (16, 17)
-
-
18. A method for parsing a markup file, comprising:
-
parsing the markup file with a lightweight parser in a computer system, the lightweight parser being capable of performing a first set of parsing tasks;
maintaining an events stack in the computer system by storing a number of open events generated by the lightweight parser in the events stack and deleting select ones of the open events previously stored in the events stack that match corresponding ones of a number of closing events generated by the lightweight parser;
detecting an occurrence of a transition event in the computer system, the transition event comprising a requirement that the lightweight parser perform a parsing task excluded from the first set of parsing tasks; and
transitioning from the parsing of the markup file with the lightweight parser to parsing the markup file with the heavyweight parser in the computer system upon an occurrence of the transition event by;
ceasing an application of the markup file to the lightweight parser;
generating a priming file from the current ones of the events stored in the events stack and applying the priming file to the heavyweight parser; and
discarding a number of priming events generated by the heavyweight parser upon the application of the priming file thereto; and
parsing a remaining portion of the markup file with the heavyweight parser after the application of the priming file, the heavyweight parser being capable of performing a second set of parsing tasks, wherein the first set of parsing tasks is a subset of the second set of parsing tasks.
-
-
19. A system for parsing a markup file, comprising:
-
a processor circuit having a processor and a memory;
a hybrid parser stored in the memory and executable by the processor, the hybrid parser comprising;
a lightweight parser that performs a first set of parsing tasks to parse the markup file;
a heavyweight parser that performs a second set of parsing tasks to parse the markup file, wherein the first set of parsing tasks is a subset of the second set of parsing tasks;
an events stack stored in the memory;
logic that maintains the events stack by storing a number of open events generated by the lightweight parser in the events stack and deleting select ones of the open events previously stored in the events stack that match corresponding ones of a number of closing events generated by the lightweight parser; and
logic that transitions a parsing of the markup file from the lightweight parser to the heavyweight parser upon an occurrence of a transition event comprising;
logic that ceases applying the markup file to the lightweight parser;
logic that generates a priming file from the current ones of the events stored in the events stack and applies the priming file to the heavyweight parser;
logic that discards a number of priming events generated by the heavyweight parser upon the application of the priming file thereto; and
logic that applies a remaining portion of the markup file to the heavyweight parser after the application of the priming file.
-
Specification