Concurrent parsing and processing of serial language code
Abstract
The aspects enable a processor to concurrently execute markup language code (e.g., HTML) having embedded scripting language code (e.g., JAVASCRIPT®) during a page load operation by a browser. A markup language parser parses markup language code until embedded scripting language code is encountered. The segment of embedded scripting language code is extracted for execution by a scripting language engine which proceeds concurrently with speculative parsing of the markup language code. Markup language code generated by execution of scripting language code is evaluated to determine if it is well formed, and a partial rollback of the markup language parse and re-parsing of portions of the markup language code is accomplished if not. Concurrent parsing of markup language code and execution of scripting language code, with partial roll back of the parsing process when necessary, continues until all markup language code has been parsed and all scripting language code has been executed.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A method by a processor, the method comprising:
parsing a first serial language code, wherein the parsing of the first serial language code includes:
encountering a second serial language code embedded in the first serial language code, the second serial language code being executable to generate additional first serial language code; and
in response to encountering the second serial language code embedded in the first serial language code:
generating the additional first serial language code by executing, in parallel with continued parsing of the first serial language code, the encountered second serial language code.
2 . The method of claim 1 , further comprising:
in response to encountering the second serial language code embedded in the first serial language code:
storing parsing state information indicating a portion of the first serial language code;
determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed; and
in response to determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed:
re-initiating parsing of the first serial language code from the portion of the first serial language code indicated by the stored parsing state information.
3 . The method of claim 1 , further comprising:
in response to encountering the second serial language code embedded in the first serial language code:
storing parsing state information indicating a portion of the first serial language code;
determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed; and
in response to determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed:
discarding parse data generated from the continued parsing of the first serial language code; and
re-initiating parsing of the first serial language code from the portion of the first serial language code indicated by the stored parsing state information.
4 . The method of claim 1 , further comprising:
determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed.
5 . The method of claim 4 , further comprising:
in response to determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed:
discarding parse data generated from the continued parsing of the first serial language code.
6 . The method of claim 1 , wherein the first serial language code comprises markup language code.
7 . The method of claim 6 , wherein the markup language code comprises hypertext markup language (HTML) code.
8 . The method of claim 6 , wherein the second serial language code comprises scripting language code.
9 . The method of claim 8 , wherein the scripting language code comprises JAVASCRIPT code.
10 . A computing device comprising
a processor configured with processor-executable instructions to perform operations comprising:
parsing a first serial language code, wherein the parsing of the first serial language code includes:
encountering a second serial language code embedded in the first serial language code, the second serial language code being executable to generate additional first serial language code; and
in response to encountering the second serial language code embedded in the first serial language code:
generating the additional first serial language code by executing, in parallel with continued parsing of the first serial language code, the encountered second serial language code.
11 . The computing device of claim 10 , wherein the processor is configured with processor-executable instructions to perform operations further comprising:
in response to encountering the second serial language code embedded in the first serial language code:
storing parsing state information indicating a portion of the first serial language code;
determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed; and
in response to determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed:
re-initiating parsing of the first serial language code from the portion of the first serial language code indicated by the stored parsing state information.
12 . The computing device of claim 10 , wherein the processor is configured with processor-executable instructions to perform operations further comprising:
in response to encountering the second serial language code embedded in the first serial language code:
storing parsing state information indicating a portion of the first serial language code;
determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed; and
in response to determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed:
discarding parse data generated from the continued parsing of the first serial language code; and
re-initiating parsing of the first serial language code from the portion of the first serial language code indicated by the stored parsing state information.
13 . The computing device of claim 10 , wherein the processor is configured with processor-executable instructions to perform operations further comprising:
determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed.
14 . The computing device of claim 13 , wherein the processor is configured with processor-executable instructions to perform operations further comprising:
in response to determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed:
discarding parse data generated from the continued parsing of the first serial language code.
15 . The computing device of claim 10 , wherein the first serial language code comprises markup language code.
16 . The computing device of claim 15 , wherein the markup language code comprises hypertext markup language (HTML) code.
17 . The computing device of claim 15 , wherein the second serial language code comprises scripting language code.
18 . The computing device of claim 17 , wherein the scripting language code comprises JAVASCRIPT code.
19 . A non-transitory storage medium having stored thereon processor-executable software instructions configured to cause a processor to perform operations comprising:
parsing a first serial language code, wherein the parsing of the first serial language code includes:
encountering a second serial language code embedded in the first serial language code, the second serial language code being executable to generate additional first serial language code; and
in response to encountering the second serial language code embedded in the first serial language code:
generating the additional first serial language code by executing, in parallel with continued parsing of the first serial language code, the encountered second serial language code.
20 . The non-transitory storage medium of claim 19 , wherein the processor-executable software instructions are configured to cause a processor to perform operations further comprising:
in response to encountering the second serial language code embedded in the first serial language code:
storing parsing state information indicating a portion of the first serial language code;
determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed; and
in response to determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed:
re-initiating parsing of the first serial language code from the portion of the first serial language code indicated by the stored parsing state information.
21 . The non-transitory storage medium of claim 19 , wherein the processor-executable software instructions are configured to cause a processor to perform operations further comprising:
in response to encountering the second serial language code embedded in the first serial language code:
storing parsing state information indicating a portion of the first serial language code;
determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed; and
in response to determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed:
discarding parse data generated from the continued parsing of the first serial language code; and
re-initiating parsing of the first serial language code from the portion of the first serial language code indicated by the stored parsing state information.
22 . The non-transitory storage medium of claim 19 , wherein the processor-executable software instructions are configured to cause a processor to perform operations further comprising:
determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed.
23 . The non-transitory storage medium of claim 22 , wherein the processor-executable software instructions are configured to cause a processor to perform operations further comprising:
in response to determining that the additional first serial language code, which was generated by executing the encountered second serial language code in parallel with the continued parsing of the first serial language code, is not well formed:
discarding parse data generated from the continued parsing of the first serial language code.
24 . The non-transitory storage medium of claim 19 , wherein the first serial language code comprises markup language code.
25 . The non-transitory storage medium of claim 24 , wherein the markup language code comprises hypertext markup language (HTML) code.
26 . The non-transitory storage medium of claim 24 , wherein the second serial language code comprises scripting language code.
27 . The non-transitory storage medium of claim 26 , wherein the scripting language code comprises JAVASCRIPT code.Join the waitlist — get patent alerts
Track US2016306786A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.