CN112379917A - Browser compatibility improving method, device, equipment and storage medium - Google Patents

Browser compatibility improving method, device, equipment and storage medium Download PDF

Info

Publication number
CN112379917A
CN112379917A CN202011302811.9A CN202011302811A CN112379917A CN 112379917 A CN112379917 A CN 112379917A CN 202011302811 A CN202011302811 A CN 202011302811A CN 112379917 A CN112379917 A CN 112379917A
Authority
CN
China
Prior art keywords
syntax tree
abstract syntax
end file
node
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011302811.9A
Other languages
Chinese (zh)
Other versions
CN112379917B (en
Inventor
周利杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kangjian Information Technology Shenzhen Co Ltd
Original Assignee
Kangjian Information Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kangjian Information Technology Shenzhen Co Ltd filed Critical Kangjian Information Technology Shenzhen Co Ltd
Priority to CN202011302811.9A priority Critical patent/CN112379917B/en
Publication of CN112379917A publication Critical patent/CN112379917A/en
Application granted granted Critical
Publication of CN112379917B publication Critical patent/CN112379917B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention relates to the field of research and development management, and discloses a browser compatibility improving method, a device, equipment and a storage medium, wherein the compatibility of a browser is improved, and the method comprises the following steps: acquiring a front-end file of a browser; inputting the front-end file into a syntax analyzer, and analyzing the front-end file into a first abstract syntax tree; traversing the first abstract syntax tree to obtain a code implementation version of each node; replacing codes of nodes of which the code implementation versions are higher than the preset versions in each node with codes of the preset versions to obtain a second abstract syntax tree; traversing the second abstract syntax tree, and replacing codes of incompatible nodes of the second abstract syntax tree with corresponding compatible codes; and inputting the second abstract syntax tree after code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatible front-end file through the syntax analyzer, and inputting the compatible front-end file into an engineering directory of the browser. In addition, the invention also relates to a block chain technology, and the front-end file can be stored in the block chain.

Description

Browser compatibility improving method, device, equipment and storage medium
Technical Field
The invention relates to the field of research and development management, in particular to a browser compatibility improving method, device, equipment and storage medium.
Background
With the development of society, more and more users browse webpages through browsers, and meanwhile, more and more workflows are transferred from desktop applications to browser ends for use. Accompanying the continuous iteration of the novel technology, the method is powerless, a plurality of incompatible and non-standard APIs are left, and in order to make the user experience consistent, the low-version browser uses high-level methods and attributes, and the polyfil concept is extended. Polyfil is a piece of code (usually JavaScript on the Web) that is used to provide newer functionality for low-version browsers without native support. Assign method, for example, which is used to copy the values of all enumerable attributes from one or more source objects to a target object. In the process of business development, the method greatly improves the development efficiency of the merged and latent copied objects, but because of incompatibility of the low-version IE browser, the user experience is reduced, even no user experience exists, and at the moment, the polyfil solves the problem of downward compatibility, so that the user experience is consistent. But polyfil is not without its drawbacks and only patches the methods and properties that are not compatible with the low-version browser. For the grammar level, there is still no power, and a large amount of polyfil detection will affect the application performance to some extent.
Disclosure of Invention
The invention mainly aims to solve the technical problem of low compatibility of the grammar of the existing low-version browser.
The first aspect of the present invention provides a method for improving browser compatibility, including:
acquiring a front-end file of a browser;
inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer;
traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree;
replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to reduce the versions of the nodes of which the implementation modes are higher than the preset version in the first abstract syntax tree, so as to obtain a second abstract syntax tree;
traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering directory of the browser.
Optionally, in a first implementation manner of the first aspect of the present invention, the inputting the front-end file into a preset parser, and parsing the front-end file into a first abstract syntax tree by the parser includes:
inputting the front-end file into the syntactic analyzer, performing lexical analysis on the front-end file through the syntactic analyzer, and converting the front-end file into an array consisting of lexical units;
and generating a first abstract syntax tree of the front-end file according to the array.
Optionally, in a second implementation manner of the first aspect of the present invention, the inputting the front-end file into the parser, performing lexical analysis on the front-end file through the parser, and converting the front-end file into an array composed of lexical units includes:
inputting the front-end file into the syntactic parser, scanning a source code of the front-end file line by line through the syntactic parser, and decomposing the source code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language;
and combining the lexical unit sequences into an array.
Optionally, in a third implementation manner of the first aspect of the present invention, the generating a first abstract syntax tree of the front-end file according to the array includes:
according to the number group, carrying out syntactic analysis on the source code, and judging whether the grammar of the source code is correct or not;
if so, generating a syntax analysis tree corresponding to the source code according to a preset source code language specification;
and calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating a first abstract syntax tree according to the node object.
Optionally, in a fourth implementation manner of the first aspect of the present invention, before the inputting the front-end file into a preset parser and parsing the front-end file into the first abstract syntax tree by the parser, the method further includes:
judging whether the statement of each source code in the front-end file is missing or not;
and if the source code statement is missing, discarding the source code.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes includes:
reading a root node of the second abstract syntax tree, and taking the root node as a current node;
judging whether the type value of the current node meets the conversion condition;
if the conversion conditions are met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
replacing the source code of the current node with the compatibility code, and skipping to the step of detecting whether the current node is at the bottom of the node of the second abstract syntax tree;
if the current node is not in accordance with the conversion condition, directly jumping to the step of detecting whether the current node is at the bottom of the node of the second abstract syntax tree or not;
detecting whether a current node is at the bottom of a node of the second abstract syntax tree;
if the current node is at the bottom of the node of the second abstract syntax tree, ending the traversal;
and if the current node is not at the bottom of the node of the second abstract syntax tree, reading the next node as the current node, and skipping to the step of judging whether the type value of the current node meets the conversion condition.
A second aspect of the present invention provides a device for improving browser compatibility, including:
the acquisition module is used for acquiring a front-end file of the browser;
the input module is used for inputting the front-end file into a preset syntax analyzer and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer;
the first traversal module is used for traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree;
a replacing module, configured to replace, with a code of a preset version, a code of a node of which a code implementation version is higher than a preset version among all nodes of the first abstract syntax tree with a code of a preset version, so as to reduce a version of a node of which an implementation manner is higher than the preset version in the first abstract syntax tree, and obtain a second abstract syntax tree;
the second traversal module is used for traversing all nodes of the second abstract syntax tree and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
and the output module is used for inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatible front-end file through the syntax analyzer, and inputting the compatible front-end file into the engineering catalog of the browser.
Optionally, in a first implementation manner of the second aspect of the present invention, the input module includes:
the lexical analysis unit is used for inputting the front-end file into the syntactic analyzer, carrying out lexical analysis on the front-end file through the syntactic analyzer and converting the front-end file into an array consisting of lexical units;
and the syntax tree generating unit is used for generating a first abstract syntax tree of the front-end file according to the array.
Optionally, in a second implementation manner of the second aspect of the present invention, the lexical analysis unit is specifically configured to:
inputting the front-end file into the syntactic parser, and scanning the source code of the front-end file line by line through the syntactic parser and decomposing the source code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language;
and combining the lexical unit sequences into an array.
Optionally, in a third implementation manner of the second aspect of the present invention, the syntax tree generating unit is specifically configured to:
according to the number group, carrying out syntactic analysis on the source code, and judging whether the grammar of the source code is correct or not;
if so, generating a syntax analysis tree corresponding to the source code according to a preset source code language specification;
and calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating a first abstract syntax tree according to the node object.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the browser compatibility improving apparatus further includes a determining module, where the determining module is specifically configured to:
judging whether the statement of each source code in the front-end file is missing or not;
and if the source code statement is missing, discarding the source code.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the second traversal module is specifically configured to:
reading a root node of the second abstract syntax tree, and taking the root node as a current node;
judging whether the type value of the current node meets the conversion condition;
if the conversion conditions are met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
replacing the source code of the current node with the compatibility code, and skipping to the step of detecting whether the current node is at the bottom of the node of the second abstract syntax tree;
if the current node is not in accordance with the conversion condition, directly jumping to the step of detecting whether the current node is at the bottom of the node of the second abstract syntax tree or not;
detecting whether a current node is at the bottom of a node of the second abstract syntax tree;
if the current node is at the bottom of the node of the second abstract syntax tree, ending the traversal;
and if the current node is not at the bottom of the node of the second abstract syntax tree, reading the next node as the current node, and skipping to the step of judging whether the type value of the current node meets the conversion condition.
A third aspect of the present invention provides a device for improving browser compatibility, including: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line; the at least one processor calls the instruction in the memory to enable the browser compatibility improving device to execute the browser compatibility improving method.
A fourth aspect of the present invention provides a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute the above-mentioned browser compatibility improving method.
According to the technical scheme, a front-end file of a browser is obtained; inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer; traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree; replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree; traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes; and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering directory of the browser. According to the method and the device, lexical analysis and syntax analysis are carried out on the front-end file of the browser to generate the abstract syntax tree, nodes in the abstract syntax tree are replaced according to compatibility rules, all the nodes in the abstract syntax tree have compatibility, the replaced abstract syntax tree is converted into the compatible front-end file, and the compatible front-end file is input into an engineering directory of the browser, so that the compatibility of the browser is improved. In addition, the invention also relates to a block chain technology, and the front-end file can be stored in the block chain.
Drawings
Fig. 1 is a schematic diagram of a first embodiment of a browser compatibility improving method according to an embodiment of the present invention;
FIG. 2 is a diagram of a browser compatibility enhancement method according to a second embodiment of the present invention;
fig. 3 is a schematic diagram of a third embodiment of a browser compatibility improving method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a fourth embodiment of a browser compatibility improving method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a fifth embodiment of a method for improving browser compatibility according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an embodiment of a browser compatibility improving apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of another embodiment of a browser compatibility improving apparatus according to an embodiment of the present invention;
fig. 8 is a schematic diagram of an embodiment of a browser compatibility improving apparatus in an embodiment of the present invention.
Detailed Description
According to the technical scheme, a front-end file of a browser is obtained; inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer; traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree; replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree; traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes; and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering directory of the browser. According to the method and the device, lexical analysis and syntax analysis are carried out on the front-end file of the browser to generate the abstract syntax tree, nodes in the abstract syntax tree are replaced according to compatibility rules, all the nodes in the abstract syntax tree have compatibility, the replaced abstract syntax tree is converted into the compatible front-end file, and the compatible front-end file is input into an engineering directory of the browser, so that the compatibility of the browser is improved. In addition, the invention also relates to a block chain technology, and the front-end file can be stored in the block chain.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a detailed flow of the embodiment of the present invention is described below, and with reference to fig. 1, a first embodiment of a browser compatibility improving method in the embodiment of the present invention includes:
101. inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer;
it is to be understood that the execution subject of the present invention may be a browser compatibility promoting device, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
It is emphasized that to ensure the privacy and security of the browser, the front-end file may be stored in a node of a blockchain.
In this embodiment, the front-end file is a js (JavaScript) file, js is a high-level programming language with function priority, lightweight, interpretative, or just-in-time compilation, and can be used as a scripting language for a Web page of a browser, and JavaScript is based on a prototype programming and a multi-modal dynamic scripting language, and supports object-oriented, command, and declarative (e.g., functional programming) styles, and is commonly used to add various dynamic functions to a Web page of a browser, thereby providing a smoother and more beautiful browsing effect for a user.
102. Inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer;
in this embodiment, the Parser is mainly a Babel compiler, and the Parser (Parser) is usually present as a component of the compiler or interpreter, and is used for performing syntax checking and constructing a data structure (generally, a hierarchical data structure such as a parsing tree or an abstract syntax tree) composed of input words. A parser typically uses a separate lexical parser to separate individual "words" from the input character stream and uses the word stream as its input. In actual development, the parser can be written manually or (semi-) automatically generated using tools. babel is a JavaScript compiler. Macroscopically, it runs code in 3 phases: parsing (parsing) -converting the code string into an AST abstract syntax tree, translating (transforming) -transforming the abstract syntax tree, generating (generating) -generating a new code string from the transformed abstract syntax tree.
In this embodiment, the parsing process of the front-end file into the first Abstract Syntax Tree by the parser includes lexical analysis and syntactic analysis, where the lexical analysis mainly reads a character stream of a source code of the input front-end file and then identifies tokens (also called word symbols or symbols) according to word formation rules, and the syntactic analysis mainly combines word sequences into various types of syntactic phrases such as "program", "sentence", "expression", and so on based on the lexical analysis to form AST (Abstract Syntax Tree).
103. Traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree;
104. replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree;
in this embodiment, the preset version is implemented as an ES5 version, where ES represents ECMAScript, and the front-end language JavaScript is mainly divided into 3 parts, namely, a core syntax, DOM and BOM, where the core syntax is ECMAScript, which defines the language components: updates to grammar, types, statements, keywords, reserved words, operators, objects, front-end language JavaScript are primarily updates to versions of ECMAScript, while updates to DOM and BOM are minor, and thus ECMAScript can be considered a reference to JavaScript, which is an implementation of ECMAScript. In the embodiment, the implementation versions of ES5 higher than the preset version include versions of ES6, ES7, etc. released behind ES5, and in practical applications, there is no JavaScript agent (whether in a browser environment or a server environment) that fully supports ES6, so developers interested in using the latest features of languages need to translate ES6 code into ES5 code.
105. Traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
in this embodiment, the second abstract syntax tree leading to ES5 is used as an input condition, the root node Type of the second abstract syntax tree is read, and whether the Type value of the node matches the conversion condition is checked, and if so, the compatible implementation is substituted for the current node.
In this embodiment, the abstract syntax tree generated by the syntax analyzer has many levels, and the function of providing compatibility to the entire second abstract syntax tree is implemented by traversing all nodes in all abstract syntax trees from the top level to determine whether the type value of each node needs to be replaced by compatibility. Reading js files through a command line and converting the js files into ast for processing, wherein the run comprises run, reading js files through a command line and converting the js files into ast for processing, and converting the tnt: traversing the AST tree to obtain the effective AST object and change the effective AST object, wherein the receiver is used for AST node traversal, the operation function statement is used for visitionDellaration traversal, the assignment expression is operated, and the visiExpressionsState is used. As long as the object defined in the AST object document is preceded by visit, traversal is possible.
106. And inputting the second abstract syntax tree after code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatible front-end file through the syntax analyzer, and inputting the compatible front-end file into an engineering directory of the browser.
In this embodiment, the second abstract syntax tree after code replacement is input and compared with the polyfil to detect the API during the running of the browser environment for compatibility processing, the API of the low-version browser is repaired in the construction phase, and the syntax support degree of the corresponding version browser is determined according to the input parameters in the parsing phase, so that incompatible Getter, Setter and other syntaxes under IE8 are converted into compatible implementation modes of the corresponding version.
In the embodiment, a front-end file of a browser is acquired; inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer; reducing the version of the node with the implementation mode higher than the preset version in the first abstract syntax tree to obtain a second abstract syntax tree; traversing all nodes of the second abstract syntax tree, and replacing incompatible nodes in all the nodes with compatible codes; and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering directory of the browser. According to the method and the device, lexical analysis and syntax analysis are carried out on the front-end file of the browser to generate the abstract syntax tree, nodes in the abstract syntax tree are replaced according to compatibility rules, all the nodes in the abstract syntax tree have compatibility, the replaced abstract syntax tree is converted into the compatible front-end file, and the compatible front-end file is input into an engineering directory of the browser, so that the compatibility of the browser is improved. In addition, the invention also relates to a block chain technology, and the front-end file can be stored in the block chain.
Referring to fig. 2, a second embodiment of the method for enhancing browser compatibility according to the embodiment of the present invention includes:
201. acquiring a front-end file of a browser;
step 201 in this embodiment is similar to step 101 in the first embodiment, and is not described here again.
202. Inputting the front-end file into a grammar analyzer, scanning the source code of the front-end file line by line through the grammar analyzer and decomposing the source code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language;
in this embodiment, an Abstract Syntax Tree is mainly constructed through two processes of lexical analysis and syntactic analysis, where the lexical analysis mainly identifies tokens (also called word symbols or symbols) according to word formation rules after reading a character stream of a source code of an input front-end file, and the syntactic analysis mainly combines a sequence of words into various types of syntactic phrases such as "program", "sentence", "expression", and so on based on the lexical analysis to form an AST (Abstract Syntax Tree).
203. Combining the lexical unit sequences into an array;
in this embodiment, each statement of the source code is scanned during the lexical analysis process, and word segmentation is performed while scanning, so as to obtain a lexical unit of each statement of the source code. The lexical unit is a basic constituent unit of a sentence, and may be a keyword, a variable name, an operator, a constant, or the like, for example, the obtained source code is "const a +1, const b + 1; "scan the first sentence" const a ═ 1, "scan" const "first, produce a lexical unit and represent" const "as the key word; scanning to 'a', and generating a lexical unit which indicates that 'a' is a variable name; then scanning to generate a lexical unit which represents that the word is an operator; then scanning to a constant value of 1, and generating a lexical unit to indicate that 1 is a constant value; finally, the punctuation mark is scanned to generate a lexical unit representation and the punctuation mark is generated. In the lexical analysis process, each lexical unit of a sentence "const a is 1" is formed into an array { const a is 1. Similarly, the lexical subsystem sets the statement "const b ═ a + 1; "convert to an array consisting of lexical units { const b ═ a + 1; }.
204. Generating a first abstract syntax tree of the front-end file according to the array;
205. traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree;
206. replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree;
207. traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
208. and inputting the second abstract syntax tree after code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatible front-end file through the syntax analyzer, and inputting the compatible front-end file into an engineering directory of the browser.
Steps 205-208 in this embodiment are similar to steps 103-106 in the first embodiment, and are not described herein again.
The present embodiment describes in detail a process of generating an abstract syntax tree on the basis of the previous embodiment, and converts a front-end file into an array composed of lexical units by inputting the front-end file into a syntax analyzer and performing lexical analysis on the front-end file through the syntax analyzer; generating a first abstract syntax tree of the front-end file according to the array, wherein the lexical analysis is carried out on the front-end file through a syntax analyzer, and the conversion of the front-end file into the array consisting of lexical units is mainly carried out by inputting the front-end file into the syntax analyzer and scanning the source codes of the front-end file line by line through the syntax analyzer; decomposing a source code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language; the lexical unit sequences are combined into an array, and the method realizes the effect of replacing incompatible codes in the front-end file by generating an abstract syntax tree.
Referring to fig. 3, a third embodiment of the method for enhancing browser compatibility according to the embodiment of the present invention includes:
301. acquiring a front-end file of a browser;
302. inputting the front-end file into a syntactic analyzer, carrying out lexical analysis on the front-end file through the syntactic analyzer, and converting the front-end file into an array consisting of lexical units;
303. carrying out syntactic analysis on the source code according to the number group, and judging whether the grammar of the source code is correct or not;
304. if so, generating a syntax analysis tree corresponding to the source code according to a preset source code language specification;
305. calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating a first abstract syntax tree according to the node object;
in this embodiment, if the syntax of the source code is incorrect, the error information may be fed back to the user, the modified source code returned by the user is received, lexical analysis is performed on the modified source code, the modified source code is converted into an array composed of lexical units, and the abstract syntax tree is generated according to the array composed of lexical units of the modified source code. For example, the parser pairs the source code "const a ═ 1, const b ═ a + 1; "analyze, determine the syntax error of the first sentence" const a ═ 1 "of the source code, and the end of the sentence should be a semicolon instead of a comma. And the parser feeds the error information back to the user and receives the modified source code fed back by the user. For example, receiving a modified source code "const a ═ 1 returned by the user; const b is a + 1; ". The lexical analyzer performs lexical analysis on the modified source code to obtain an array of lexical units of the modified source code, for example, { const a ═ 1; { const b ═ a + 1; and the syntax analyzer generates the abstract syntax tree according to the array of the modified source codes, which is composed of lexical units.
In the present embodiment, the abstract syntax tree is built on the basis of the parse tree. The working process is that according to the grammar of the self-defined abstract syntax tree, the character strings in the syntax tree are analyzed and analyzed, the Token information is extracted, meanwhile, according to different nodes of all levels, such as root nodes, class node classes and method node classes, the corresponding methods are respectively called, node objects are created, and then the program abstract syntax tree is generated.
306. Traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree;
307. replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree;
308. traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
309. and inputting the second abstract syntax tree after code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatible front-end file through the syntax analyzer, and inputting the compatible front-end file into an engineering directory of the browser.
On the basis of the previous embodiment, the process of generating the first abstract syntax tree of the front-end file according to the array is described in detail, and whether the syntax of the source code is correct or not is judged by performing syntax analysis on the source code according to the array; if so, generating a syntax analysis tree corresponding to the source code according to a preset source code language specification; calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating a first abstract syntax tree according to the node object.
Referring to fig. 4, a fourth embodiment of the method for enhancing browser compatibility according to the embodiment of the present invention includes:
401. acquiring a front-end file of a browser;
402. judging whether the statement of each source code in the front-end file is missing or not;
403. if the source code statement is missing, discarding the source code;
in this embodiment, before the front-end file is input into the parser, the source codes of the front-end file may be checked to determine whether each source code in the front-end file is missing, and when there is a missing source code, the position of the source code is determined and an alarm is issued, and whether the source code only has a start statement and an end statement may be determined according to a preset keyword. For example, it may be determined whether the source code only includes a keyword of a start statement and a keyword of an end statement, and if the source code only includes a keyword of a start statement and a keyword of an end statement, it is determined that the source code only includes a start statement and an end statement, and a statement of the source code is missing.
404. Inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer;
405. traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree;
406. replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree;
407. traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
408. and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering directory of the browser.
On the basis of the previous embodiment, the present embodiment adds a process of checking the source code in the front-end file, and determines whether the statement of each source code in the plurality of source codes is missing; if the source code statement is missing, the source code is abandoned, and the problem of code missing during compatibility code conversion is avoided by the method.
Referring to fig. 5, a fifth embodiment of the method for enhancing browser compatibility according to the embodiment of the present invention includes:
501. acquiring a front-end file of a browser;
502. inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer;
503. traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree;
504. replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree;
505. reading a root node of the second abstract syntax tree, and taking the root node as a current node;
506. judging whether the type value of the current node meets the conversion condition;
507. if the conversion conditions are met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
508. replacing the source code of the current node with the compatibility code, and jumping to step 508 to detect whether the current node is at the bottom of the node of the second abstract syntax tree;
509. if the current node is not in accordance with the conversion condition, detecting whether the current node is at the bottom of the node of the second abstract syntax tree;
510. if the current node is at the bottom of the node of the second abstract syntax tree, ending the traversal;
511. if the current node is not at the bottom of the node of the second abstract syntax tree, reading the next node as the current node, and skipping to the step of judging whether the type value of the current node meets the conversion condition;
512. and inputting the second abstract syntax tree after code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatible front-end file through the syntax analyzer, and inputting the compatible front-end file into an engineering directory of the browser.
In this embodiment, the Type value in the abstract syntax tree is a set of fixed values defined in the industry, including Variable Declaration, While status, and With status, for example, where var a is 1 and must be replaced by const a 1 in a node of the abstract syntax tree, at this time, it is determined that the Type value of var is Variable Declaration and meets the conversion condition, which represents that a var Statement is hit, at this time, it is only necessary to replace var With const through the fixed syntax, traverse all nodes in the second abstract syntax tree, determine whether the Type of each node in the abstract syntax tree meets the conversion condition, and convert the codes of the nodes meeting the conversion condition, so that all nodes in the obtained new abstract syntax tree meet the compatibility.
The present embodiment describes in detail a process of traversing all nodes of the second abstract syntax tree and replacing incompatible nodes in all nodes with compatibility codes on the basis of the previous embodiment, and determines whether a type value of a root node meets a conversion condition by reading the root node of the second abstract syntax tree; if the conversion condition is met, replacing the code of the current node with the compatible code, detecting whether the current node is at the bottom of the node of the second abstract syntax tree or not, and if the current node is at the bottom of the node of the second abstract syntax tree, ending traversal; if the current node is not at the bottom of the node of the second abstract syntax tree, reading the next node to judge whether the type value meets the conversion condition; if the type value does not accord with the conversion condition, reading the next node to judge whether the type value accords with the conversion condition, and by the method, codes in all nodes in the abstract syntax tree have compatibility, so that the converted front-end file has compatibility.
In the above description of the method for improving browser compatibility according to the embodiment of the present invention, referring to fig. 6, a browser compatibility improving device according to the embodiment of the present invention is described below, where an embodiment of the browser compatibility improving device according to the embodiment of the present invention includes:
an obtaining module 601, configured to obtain a front-end file of a browser;
an input module 602, configured to input the front-end file into a preset syntax analyzer, and analyze the front-end file into a first abstract syntax tree through the syntax analyzer;
a first traversal module 603, configured to traverse all nodes of the first abstract syntax tree, and obtain a code implementation version of each node in the first abstract syntax tree;
a replacing module 604, configured to replace, with a code of a preset version, a code of a node whose code implementation version is higher than the preset version in all nodes of the first abstract syntax tree with a code of a preset version to reduce the version of a node whose implementation manner is higher than the preset version in the first abstract syntax tree, so as to obtain a second abstract syntax tree;
a second traversal module 605, configured to traverse all nodes of the second abstract syntax tree, and replace codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
an output module 606, configured to input the second abstract syntax tree after code replacement into the parser, convert the second abstract syntax tree into a compatible front-end file through the parser, and input the compatible front-end file into the engineering directory of the browser.
It is emphasized that to ensure the privacy and security of the browser, the front-end file may be stored in a node of a blockchain.
In an embodiment of the present invention, the browser compatibility improving apparatus operates the browser compatibility improving method, and the browser compatibility improving method includes: acquiring a front-end file of a browser; inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer; traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree; replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree; traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes; and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering directory of the browser. According to the method and the device, lexical analysis and syntax analysis are carried out on the front-end file of the browser to generate the abstract syntax tree, nodes in the abstract syntax tree are replaced according to compatibility rules, all the nodes in the abstract syntax tree have compatibility, the replaced abstract syntax tree is converted into the compatible front-end file, and the compatible front-end file is input into an engineering directory of the browser, so that the compatibility of the browser is improved. In addition, the invention also relates to a block chain technology, and the front-end file can be stored in the block chain.
Referring to fig. 7, a second embodiment of the device for improving browser compatibility according to the embodiment of the present invention includes:
an obtaining module 601, configured to obtain a front-end file of a browser;
an input module 602, configured to input the front-end file into a preset syntax analyzer, and analyze the front-end file into a first abstract syntax tree through the syntax analyzer;
a first traversal module 603, configured to traverse all nodes of the first abstract syntax tree, and obtain a code implementation version of each node in the first abstract syntax tree;
a replacing module 604, configured to replace, with a code of a preset version, a code of a node whose code implementation version is higher than the preset version in all nodes of the first abstract syntax tree with a code of a preset version to reduce the version of a node whose implementation manner is higher than the preset version in the first abstract syntax tree, so as to obtain a second abstract syntax tree;
a second traversal module 605, configured to traverse all nodes of the second abstract syntax tree, and replace codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
an output module 606, configured to input the second abstract syntax tree after code replacement into the parser, convert the second abstract syntax tree into a compatible front-end file through the parser, and input the compatible front-end file into the engineering directory of the browser.
Wherein the input module 602 comprises:
a lexical analysis unit 6021, configured to input the front-end file into the parser, perform lexical analysis on the front-end file through the parser, and convert the front-end file into an array composed of lexical units;
and the syntax tree generating unit 6022 is configured to generate a first abstract syntax tree of the front-end file according to the array.
Optionally, the lexical analysis unit 6021 is specifically configured to:
inputting the front-end file into the syntactic parser, scanning a source code of the front-end file line by line through the syntactic parser, and decomposing the source code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language;
and combining the lexical unit sequences into an array.
Optionally, the syntax tree generating unit 6022 is specifically configured to:
according to the number group, carrying out syntactic analysis on the source code, and judging whether the grammar of the source code is correct or not;
if so, generating a syntax analysis tree corresponding to the source code according to a preset source code language specification;
and calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating a first abstract syntax tree according to the node object.
Optionally, the device for improving browser compatibility further includes a determining module 607, where the determining module 607 is specifically configured to:
judging whether the statement of each source code in the front-end file is missing or not;
and if the source code statement is missing, discarding the source code.
Optionally, the second traversal module 605 is specifically configured to:
reading a root node of the second abstract syntax tree, and taking the root node as a current node;
judging whether the type value of the current node meets the conversion condition;
if the conversion conditions are met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
replacing the source code of the current node with the compatibility code, and skipping to the step of detecting whether the current node is at the bottom of the node of the second abstract syntax tree;
if the current node is not in accordance with the conversion condition, directly jumping to the step of detecting whether the current node is at the bottom of the node of the second abstract syntax tree or not;
detecting whether a current node is at the bottom of a node of the second abstract syntax tree;
if the current node is at the bottom of the node of the second abstract syntax tree, ending the traversal;
and if the current node is not at the bottom of the node of the second abstract syntax tree, reading the next node as the current node, and skipping to the step of judging whether the type value of the current node meets the conversion condition.
The present embodiment describes the specific functions of each module and the unit composition of a part of the modules in detail on the basis of the previous embodiment, where the input module includes a lexical analysis unit and a syntax tree generation unit, and performs lexical analysis and syntax analysis to generate an abstract syntax tree through the modules and units, and replaces nodes in the abstract syntax tree according to compatibility rules, so that all nodes in the abstract syntax tree have compatibility, converts the replaced abstract syntax tree into a compatibility front-end file, and inputs the compatibility front-end file into an engineering directory of a browser, so that the compatibility of the browser is improved. In addition, the invention also relates to a block chain technology, and the front-end file can be stored in the block chain.
Fig. 6 and fig. 7 describe the device for improving browser compatibility in the embodiment of the present invention in detail from the perspective of a modular functional entity, and the device for improving browser compatibility in the embodiment of the present invention is described in detail from the perspective of hardware processing.
Fig. 8 is a schematic structural diagram of a browser compatibility improving device according to an embodiment of the present invention, where the browser compatibility improving device 800 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) storing an application 833 or data 832. Memory 820 and storage medium 830 may be, among other things, transient or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), and each module may include a series of instruction operations for the browser compatibility improving apparatus 800. Further, the processor 810 may be configured to communicate with the storage medium 830, and execute a series of instruction operations in the storage medium 830 on the browser compatibility improving device 800, so as to implement the steps of the browser compatibility improving method.
The browser compatibility enhancement device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input-output interfaces 860, and/or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that the browser compatibility promotion device structure shown in fig. 8 does not constitute a limitation of the browser compatibility promotion device provided herein, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, or a volatile computer-readable storage medium, where instructions are stored, and when the instructions are executed on a computer, the instructions cause the computer to execute the steps of the browser compatibility improving method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A browser compatibility improving method is characterized by comprising the following steps:
acquiring a front-end file of a browser;
inputting the front-end file into a preset syntax analyzer, and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer;
traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree;
replacing codes of nodes of which the code implementation versions are higher than the preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree;
traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering directory of the browser.
2. The method according to claim 1, wherein the inputting the front-end file into a preset parser, and the parsing the front-end file into the first abstract syntax tree by the parser comprises:
inputting the front-end file into the syntactic analyzer, performing lexical analysis on the front-end file through the syntactic analyzer, and converting the front-end file into an array consisting of lexical units;
and generating a first abstract syntax tree of the front-end file according to the array.
3. The method of claim 2, wherein the inputting the front-end file into the parser, performing lexical analysis on the front-end file through the parser, and converting the front-end file into an array consisting of lexical units comprises:
inputting the front-end file into the syntactic parser, and scanning the source code of the front-end file line by line through the syntactic parser and decomposing the source code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language;
and combining the lexical unit sequences into an array.
4. The method according to claim 3, wherein the generating the first abstract syntax tree of the front-end file according to the array comprises:
according to the number group, carrying out syntactic analysis on the source code, and judging whether the grammar of the source code is correct or not;
if so, generating a syntax analysis tree corresponding to the source code according to a preset source code language specification;
and calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating a first abstract syntax tree according to the node object.
5. The method according to claim 3, wherein before the inputting the front-end file into a preset parser, and parsing the front-end file into a first abstract syntax tree by the parser, the method further comprises:
judging whether the statement of each source code in the front-end file is missing or not;
and if the source code statement is missing, discarding the source code.
6. The browser compatibility promotion method of claim 1, wherein traversing all nodes of the second abstract syntax tree and replacing codes of incompatible nodes of all nodes of the second abstract syntax tree with corresponding compatibility codes comprises:
reading a root node of the second abstract syntax tree, and taking the root node as a current node;
judging whether the type value of the current node meets the conversion condition;
if the conversion conditions are met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
replacing the source code of the current node with the compatibility code, and skipping to the step of detecting whether the current node is at the bottom of the node of the second abstract syntax tree;
if the current node is not in accordance with the conversion condition, directly jumping to the step of detecting whether the current node is at the bottom of the node of the second abstract syntax tree or not;
detecting whether a current node is at the bottom of a node of the second abstract syntax tree;
if the current node is at the bottom of the node of the second abstract syntax tree, ending the traversal;
and if the current node is not at the bottom of the node of the second abstract syntax tree, reading the next node as the current node, and skipping to the step of judging whether the type value of the current node meets the conversion condition.
7. A browser compatibility improving apparatus, comprising:
the acquisition module is used for acquiring a front-end file of the browser;
the input module is used for inputting the front-end file into a preset syntax analyzer and analyzing the front-end file into a first abstract syntax tree through the syntax analyzer;
the first traversal module is used for traversing all nodes of the first abstract syntax tree to obtain a code implementation version of each node in the first abstract syntax tree;
a replacing module, configured to replace, with a code of a preset version, a code of a node of which a code implementation version is higher than a preset version among all nodes of the first abstract syntax tree with a code of a preset version, so as to reduce a version of a node of which an implementation manner is higher than the preset version in the first abstract syntax tree, and obtain a second abstract syntax tree;
the second traversal module is used for traversing all nodes of the second abstract syntax tree and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatible codes;
and the output module is used for inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatible front-end file through the syntax analyzer, and inputting the compatible front-end file into the engineering catalog of the browser.
8. The browser compatibility promotion device according to claim 7, wherein the input module comprises:
the lexical analysis unit is used for inputting the front-end file into the syntactic analyzer, carrying out lexical analysis on the front-end file through the syntactic analyzer and converting the front-end file into an array consisting of lexical units;
and the syntax tree generating unit is used for generating a first abstract syntax tree of the front-end file according to the array.
9. A browser compatibility promotion device, the browser compatibility promotion device comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor invoking the instructions in the memory to cause the browser compatibility promotion device to perform the browser compatibility promotion method of any of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a browser compatibility promotion method according to any one of claims 1-6.
CN202011302811.9A 2020-11-19 2020-11-19 Browser compatibility improving method, device, equipment and storage medium Active CN112379917B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011302811.9A CN112379917B (en) 2020-11-19 2020-11-19 Browser compatibility improving method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011302811.9A CN112379917B (en) 2020-11-19 2020-11-19 Browser compatibility improving method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112379917A true CN112379917A (en) 2021-02-19
CN112379917B CN112379917B (en) 2023-10-20

Family

ID=74584544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011302811.9A Active CN112379917B (en) 2020-11-19 2020-11-19 Browser compatibility improving method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112379917B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965695A (en) * 2021-03-12 2021-06-15 中国平安财产保险股份有限公司 Front-end code access detection method, device, equipment and storage medium
CN113254023A (en) * 2021-05-14 2021-08-13 网易(杭州)网络有限公司 Object reading method and device and electronic equipment
CN113326048A (en) * 2021-06-24 2021-08-31 上海万向区块链股份公司 Floating point number calculation precision processing method, system, medium and device
CN113971027A (en) * 2021-10-26 2022-01-25 北京字节跳动网络技术有限公司 Code conversion method and device, computer equipment and storage medium
CN117270961A (en) * 2023-11-21 2023-12-22 武汉蜂鸟龙腾软件有限公司 Method for analyzing and loading MFC character resources in Linux environment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150301811A1 (en) * 2013-01-23 2015-10-22 Tencent Technology (Shenzhen) Company Limited Method and apparatus for testing browser compatibility
CN109684584A (en) * 2018-11-15 2019-04-26 北京海泰方圆科技股份有限公司 A kind of intelligent switch method of browser kernel, device, terminal and storage medium
CN110457065A (en) * 2019-08-14 2019-11-15 中国工商银行股份有限公司 For obtaining the method and device of compatible multi version systematic difference
CN110471666A (en) * 2019-07-18 2019-11-19 五八有限公司 Code automatic switching method and device, code converter and medium
CN110688300A (en) * 2019-08-13 2020-01-14 平安科技(深圳)有限公司 Compatibility testing method, device, equipment and storage medium
CN111708542A (en) * 2020-06-24 2020-09-25 中国平安财产保险股份有限公司 Test case generation method, system, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150301811A1 (en) * 2013-01-23 2015-10-22 Tencent Technology (Shenzhen) Company Limited Method and apparatus for testing browser compatibility
CN109684584A (en) * 2018-11-15 2019-04-26 北京海泰方圆科技股份有限公司 A kind of intelligent switch method of browser kernel, device, terminal and storage medium
CN110471666A (en) * 2019-07-18 2019-11-19 五八有限公司 Code automatic switching method and device, code converter and medium
CN110688300A (en) * 2019-08-13 2020-01-14 平安科技(深圳)有限公司 Compatibility testing method, device, equipment and storage medium
CN110457065A (en) * 2019-08-14 2019-11-15 中国工商银行股份有限公司 For obtaining the method and device of compatible multi version systematic difference
CN111708542A (en) * 2020-06-24 2020-09-25 中国平安财产保险股份有限公司 Test case generation method, system, device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王国庆: "浅谈浏览器兼容统一性问题与解决方案", 《电脑知识与技术》 *
高培: "基于Web 应用的浏览器兼容性测试方法研究", 《软件导刊》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965695A (en) * 2021-03-12 2021-06-15 中国平安财产保险股份有限公司 Front-end code access detection method, device, equipment and storage medium
CN113254023A (en) * 2021-05-14 2021-08-13 网易(杭州)网络有限公司 Object reading method and device and electronic equipment
CN113254023B (en) * 2021-05-14 2023-08-11 网易(杭州)网络有限公司 Object reading method and device and electronic equipment
CN113326048A (en) * 2021-06-24 2021-08-31 上海万向区块链股份公司 Floating point number calculation precision processing method, system, medium and device
CN113971027A (en) * 2021-10-26 2022-01-25 北京字节跳动网络技术有限公司 Code conversion method and device, computer equipment and storage medium
CN117270961A (en) * 2023-11-21 2023-12-22 武汉蜂鸟龙腾软件有限公司 Method for analyzing and loading MFC character resources in Linux environment
CN117270961B (en) * 2023-11-21 2024-04-12 武汉蜂鸟龙腾软件有限公司 Method for analyzing and loading MFC character resources in Linux environment

Also Published As

Publication number Publication date
CN112379917B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
CN112379917B (en) Browser compatibility improving method, device, equipment and storage medium
Schordan et al. A source-to-source architecture for user-defined optimizations
US8332828B2 (en) System for translating diverse programming languages
Goossens et al. The LATEX companion
US9086931B2 (en) System for translating diverse programming languages
US9965259B2 (en) System for translating diverse programming languages
US8850414B2 (en) Direct access of language metadata
US20130081004A1 (en) System for Translating Diverse Programming Languages
JP5734311B2 (en) Efficient invariant syntactic representation with gradual change
Miecznikowski et al. Decompiling Java using staged encapsulation
JPH1083293A (en) Error correction compiler
US20130152061A1 (en) Full fidelity parse tree for programming language processing
US20070271550A1 (en) System and method for extensible java server page resource management
CN115202626A (en) Low-code front-end development method supporting multi-technology stack components
Juričić Detecting source code similarity using low-level languages
US20080141230A1 (en) Scope-Constrained Specification Of Features In A Programming Language
CN112965695A (en) Front-end code access detection method, device, equipment and storage medium
JP7391983B2 (en) Methods, decompiling devices, recompilation systems and computer program products for generating representations of program logic
Iwama et al. Constructing parser for industrial software specifications containing formal and natural language description
CN114816435A (en) Software development method based on reverse technology
CN112948734A (en) Project style integration and adaptation method, device, equipment and storage medium
Andrews et al. The formal definition of Modula-2 and its associated interpreter
JP3266097B2 (en) Automatic reentrant method and system for non-reentrant program
An et al. Automatic inference of translation rules for native cross-platform mobile applications
CN117785213B (en) Front-end construction tool and construction method based on Rust development

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant