CN107220034B - Program code marking method and device - Google Patents

Program code marking method and device Download PDF

Info

Publication number
CN107220034B
CN107220034B CN201610164621.2A CN201610164621A CN107220034B CN 107220034 B CN107220034 B CN 107220034B CN 201610164621 A CN201610164621 A CN 201610164621A CN 107220034 B CN107220034 B CN 107220034B
Authority
CN
China
Prior art keywords
marking
program code
read
program codes
switching identifier
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.)
Active
Application number
CN201610164621.2A
Other languages
Chinese (zh)
Other versions
CN107220034A (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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610164621.2A priority Critical patent/CN107220034B/en
Publication of CN107220034A publication Critical patent/CN107220034A/en
Application granted granted Critical
Publication of CN107220034B publication Critical patent/CN107220034B/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/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Abstract

The application discloses a program code marking method and a device, wherein the method comprises the following steps: and sequentially reading the program codes, determining a marking rule corresponding to the switching identifier when the switching identifier contained in the program codes is read, adopting the marking rule to mark the subsequently read program codes until the next switching identifier contained in the program codes is read again, determining another marking rule corresponding to the next switching identifier again, adopting the other marking rule, and continuing to mark the read program codes until all the program codes are marked. By the method, even if the program codes are written by more than two programming languages, which marking rule needs to be used can be determined according to the switching identifier, and the program codes read subsequently can be accurately marked.

Description

Program code marking method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for marking a program code.
Background
As computers continue to evolve, it has become increasingly important to edit program code through programming languages, such as Structured Query Language (SQL) editing program code.
Currently, in order to improve the efficiency of editing program codes, it is common to mark some program codes in the program codes, for example, highlight variables in the program codes, so that a programmer can accurately locate a desired program code.
In the prior art, a code editing apparatus first receives a programming language selected by a user, reads program codes in sequence from the foremost end of the program codes, and directly marks the program codes when the program codes to be marked corresponding to the preset programming language are matched.
However, in the prior art, different programming languages have different syntax structures, so that different programming languages correspond to different program codes that need to be marked, for example, in the perl language, as long as a program code is a character string, the character string is directly marked in its entirety, while in the SQL language, a program code that is a character string is not marked in its entirety but is identified and marked in the character string, when a program code needs to be edited by two or more programming languages, that is, when the program code includes two or more different programming languages, the current program code can only be identified and marked in accordance with a program code marking mode corresponding to one of the programming languages.
For example, the following is program code that includes programming languages that use both the perl language and SQL:
Figure BDA0000946699490000011
Figure BDA0000946699490000021
Figure BDA0000946699490000031
in the above program code, if the perl language is selected to mark the program code, according to a preset perl language marking mode, the content in the middle of the "" -symbol in the program code is considered as a character string, and thus the content in the middle of the "" -symbol is marked, for example, "10" in the "10", "next _ month _ first \ ═ substr ($ bizdate,0,4)." "1001" in the "1001" and the like are marked.
For the SQL statement, the content in the middle of the "" -symbol is marked in the way of the perl language, which is obviously wrong.
Therefore, in the prior art, the program codes containing more than two different programming languages can be marked by adopting the marking mode of only one programming language, so that errors of the program code marking are caused.
Disclosure of Invention
The embodiment of the application provides a program code marking method and device, which are used for solving the problem that when program codes comprising more than two programming languages are marked, errors tend to occur in the program code marking.
The program code marking method provided by the embodiment of the application comprises the following steps:
sequentially reading the program codes;
when a switching identifier contained in a program code is read, determining a marking rule corresponding to the switching identifier;
and marking the subsequently read program codes by adopting the marking rule until the next switching identifier contained in the program codes is read again, determining another marking rule corresponding to the next switching identifier again, and continuously marking the read program codes by adopting the other marking rule until all the program codes are marked.
In an embodiment of the present application, a program code is written in two programming languages, and two marking rules respectively corresponding to the two programming languages are pre-stored in the program code, where the method includes:
sequentially reading the program codes;
marking the subsequently read program codes by adopting a default marking rule in the two marking rules;
and when the switching identifier contained in the program code is read, adopting the other marking rule different from the currently used marking rule in the two marking rules to continuously mark the subsequently read program code until all the program codes are marked.
The program code marking device provided by the embodiment of the application comprises:
the reading module is used for sequentially reading the program codes;
the device comprises a first determining module, a second determining module and a switching module, wherein the first determining module is used for determining a marking rule corresponding to a switching identifier when the switching identifier contained in a program code is read;
and the marking module is used for marking the subsequently read program codes by adopting the marking rule until the next switching identifier contained in the program codes is read again, determining another marking rule corresponding to the next switching identifier again, and continuously marking the read program codes by adopting the other marking rule until all the program codes are marked.
The program code marking device provided by the embodiment of the application is written by two programming languages, and two marking rules respectively corresponding to the two programming languages are pre-stored, and the device comprises:
the reading module is used for sequentially reading the program codes;
the default marking module is used for marking the subsequently read program codes by adopting the default marking rule in the two marking rules;
and the marking module is used for adopting another marking rule different from the currently used marking rule in the two marking rules to continuously mark the subsequently read program codes when the switching identifiers contained in the program codes are read until all the program codes are marked.
The embodiment of the application provides a program code marking method and a device, wherein the method comprises the following steps: and sequentially reading the program codes, determining a marking rule corresponding to the switching identifier when the switching identifier contained in the program codes is read, adopting the marking rule to mark the subsequently read program codes until the next switching identifier contained in the program codes is read again, determining another marking rule corresponding to the next switching identifier again, adopting the other marking rule, and continuing to mark the read program codes until all the program codes are marked. By the method, even if the program codes are written by more than two programming languages, which marking rule needs to be used can be determined according to the switching identifier, and the program codes read subsequently can be accurately marked.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a program code marking process provided by an embodiment of the present application;
FIG. 2 is a program code marking process provided by an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a first program code labeling apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a second program code marking apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a program code marking process provided in an embodiment of the present application, which specifically includes the following steps:
s101: the program code is read sequentially.
In practical applications, in order to improve the efficiency of editing program codes, some program codes in the program codes are usually marked, so that a programmer can accurately locate a desired program code.
Therefore, in the whole process of marking the program codes, the program codes are firstly read in a forward and backward sequence, and the sequence reading program codes can be executed by a code editing device and other code reading devices.
For example, assuming that the program code a is written in perl language, C language, and SQL language, the code editing apparatus reads the program code a sequentially.
S102: when a switching identifier contained in a program code is read, a marking rule corresponding to the switching identifier is determined.
Different programming languages have different syntactic structures, so that different programming languages correspond to different program codes to be marked, that is, different programming languages correspond to different marking rules, and the marking rules describe in detail the program codes to be marked when the program codes are written by using a certain programming language.
Further, since the program code may be written by more than two programming languages in practical applications, in the present application, if the program code is written by more than two programming languages, when the program code is marked, the program code written by different programming languages needs to be marked by different marking rules.
Furthermore, in order to mark program codes written in different programming languages by using different marking rules, in the present application, it is necessary to identify which programming language the program code is written in, and the present application specifically identifies by using a switching identifier, where each switching identifier corresponds to one programming language, that is, the switching identifier can accurately identify, which programming language the program code is written in next, and then determines the marking rule corresponding to the switching identifier.
It should be noted that, in the present application, in order to consider that the written program code can be recognized and executed by the execution device, when the switching identifier is preset, the program code existing in the programming language may be used as the switching identifier, for example, the program code "" symbol "in the perl language may be used as the switching identifier, but if the program code existing in the programming language is used as the switching identifier, there may be other meanings of the switching identifier, for example, if the program code" "is selected as the switching identifier, the program code" "may also represent escape, that is, the program code in the middle of the program code" "symbol" and the program codes on both sides are the same programming language, so that when the code editing device reads the switching identifier, the switching marking rule is continued according to the switching identifier, it is likely that an error in the mark is directly caused, and therefore, if a program code is used as the switching identifier, which has other meanings than the meaning of the switching identifier, the programming language may be modified such that the meaning of the program code used as the switching identifier is represented by a new program code, and thus the program code may be used as the switching identifier, for example, the program code "" representing an escape may be modified into the program code "" so that the program code "" may be used as the switching identifier.
In addition, since the comment can be customized in general and the execution device can normally recognize and execute the program code even if the comment is customized, in the present application, it is also possible to use the comment (which programming language the next program code is written in is explained in the comment) as the switching identifier and freely set the switching identifier.
Continuing the above example, it is assumed that a comment is used as the switching identifier, and the preset switching identifier is "// perl language" (indicating that the next program code is written in perl language), "// C language" (indicating that the next program code is written in C language), "// SQL language" (indicating that the next program code is written in SQL language), and "// perl language" corresponding to the perl markup rules, "// C language" corresponding to the C markup rules, and "// SQL language" corresponding to the SQL markup rules are set in advance.
Assume that the switching identifier appearing first in the program code a is in the "// perl language", and therefore, the code editing apparatus reads the program code a sequentially, and when the "// perl language" included in the program code is read, determines the perl markup rule corresponding to the "// perl language".
In practical applications, there may be a case where the top program code of the entire program code is not the switch identifier, but since the programming language used at the beginning of the entire program code corresponds to the file type in a normal case, that is, the file type may determine the programming language used at the beginning of the program code, for this case, in the present application, when marking the entire program code, specifically, before the switch identifier is read for the first time, a marking rule corresponding to the file type may be determined according to the file type of the file in which the program code is located, and according to the marking rule corresponding to the file type, the program code read subsequently may be marked until the switch identifier is read. For example, assuming that the program code located at the forefront in the program codes being written is not the switching identifier, assuming that the file where the program code is located is an SQL-type file, before the code editing device reads the switching identifier for the first time, according to the SQL file type, a marking rule corresponding to the file type is determined, assuming that the marking rule is an SQL marking rule, and according to the SQL marking rule, marking the program code read subsequently until the switching identifier is read.
S103: and marking the subsequently read program codes by adopting the marking rule until the next switching identifier contained in the program codes is read again, determining another marking rule corresponding to the next switching identifier again, and continuously marking the read program codes by adopting the other marking rule until all the program codes are marked.
In consideration of the fact that in practical application, when the adopted switching identifier is an existing program code in a programming language, there may be a case where a preset switching identifier appears in a comment, and the program code before the comment and the program code after the comment are both in the same programming language, therefore, in the present application, before a marking rule is adopted to mark a subsequently read program code, it is determined that the position of the switching identifier in the program code is not a preset specified position, and if the determined position of the switching identifier in the program code is a preset specified position, it is described that the program code before the switching identifier and the program code after the switching identifier are both in the same programming language, and therefore, the switching identifier can be directly ignored, i.e., no processing is performed.
For example, assuming that the program code "is used as the switching identifier, and the switching identifier cannot appear in the annotation, the code editing apparatus reads the switching identifier included in the annotation during the process of reading the program code E, and determines that the position of the switching identifier" in the program code is in the annotation, that is, the switching identifier "is at a preset specified position, then the code editing apparatus directly ignores the switching identifier", does not adopt the marking rule corresponding to the switching identifier "to mark the subsequently read program code, and still adopts the current marking rule to mark the subsequently read program code.
Further, after determining that the position of the switching identifier in the program code is not the preset designated position, the code editing device may directly mark the program code read subsequently according to the marking rule until the next switching identifier included in the program code is read again, determine another marking rule corresponding to the next switching identifier again, and continue to mark the read program code by using the other marking rule until all the program codes are marked.
In the process of marking the program code, in the present application, the program code may be marked in a highlighting manner, that is, the program code to be marked that is read subsequently is highlighted, and of course, different ground colors may be added to the program code to be marked according to different types.
Continuing with the above example, the code editing device determines the perl mark rule corresponding to the// perl language, and it is assumed that the code editing device determines that the position of the// perl language in the program code a is not the preset designated position, therefore, the code editing device uses the perl mark rule to highlight (i.e. mark) the subsequently read program code to be marked until the next switch identifier included in the program code is read again, and it is assumed that the next switch identifier is the// C language, determines the C mark rule corresponding to the// C language, and uses the C mark rule to highlight the subsequently read program code to be marked, and it is assumed that the next switch identifier is the// SQL language, determines the SQL mark rule corresponding to the// SQL language, and uses the SQL mark rule to highlight the subsequently read program code to be marked, until all of the program code a is marked.
By the method, even if the program codes are written by more than two programming languages, which marking rule needs to be used can be determined according to the switching identifier, and the program codes read subsequently can be accurately marked.
In the above method for marking program codes provided by the present application, in the whole process of marking program codes, the switching identifier uniquely corresponds to the marking rule of one programming language, that is, the marking rule corresponding to one programming language can be uniquely identified and determined by the switching identifier, however, in practical applications, for program codes written only by two programming languages, when the switching identifier is preset, the set switching identifier does not need to correspond to the marking rule of any one programming language, and as long as the code editing device reads the switching identifier, another marking rule different from the currently used marking rule in the two marking rules may be adopted, as specifically shown in fig. 2.
Fig. 2 is a program code marking process provided in an embodiment of the present application, which specifically includes the following steps:
s201: the program code is read sequentially.
For example, suppose that the program code B is written by perl language and SQL language, and the perl markup rules corresponding to the perl language are stored in advance, and the SQL markup rules corresponding to the SQL language are as follows:
Figure BDA0000946699490000101
Figure BDA0000946699490000111
the code editing apparatus reads the program codes B sequentially.
S202: and marking the subsequently read program codes by adopting a default marking rule in the two marking rules.
S203: and when the switching identifier contained in the program code is read, adopting the other marking rule different from the currently used marking rule in the two marking rules to continuously mark the subsequently read program code until all the program codes are marked.
Since only two programming languages are written in the application, in order to improve the efficiency of writing the program codes, only one switching identifier can be set in the application, and when the code editing device reads the switching identifier, another marking rule different from the currently used marking rule in the two marking rules is adopted to continuously mark the subsequently read program codes until all the program codes are marked.
Further, since only one switch identifier is set in the present application, in the entire program code, the program code located at the frontmost end is not the switch identifier, that is, the program code between the program code located at the frontmost end and the switch identifier that occurs for the first time needs to select one marking rule from two marking rules (in the present application, the marking rule may be used as a default marking rule) to mark the program code between the program code located at the frontmost end and the switch identifier that occurs for the first time.
The application provides a selection method for selecting which marking rule from two marking rules, which is specifically as follows: and determining a marking rule corresponding to the file type in the two marking rules according to the file type of the file where the program code is located, taking the marking rule as a default marking rule, and marking the subsequently read program code by adopting the default marking rule.
Continuing with the above example, assume that the preset switch identifier is a # switch identifier (the marking rule indicating the next program code is a perl marking rule and another marking rule different from the currently used marking rule in the SQL marking rule).
Assuming that the file type of the file where the program code B is located is perl, the code editing device determines a perl marking rule corresponding to the file type according to the file type perl of the file where the program code B is located, and takes the perl marking rule as a default marking rule, and the code editing device highlights the subsequently read program code by adopting the perl marking rule, namely highlights substr, "10", "1001", "y-% m-% d% m:% s", # bizdate ═ yesterday, and $.
Until the # switching identifier contained in the program code B is read, adopting another marking rule different from the currently used perl marking rule, namely, the SQL marking rule, to continue to highlight the program code B which is read subsequently, namely, to highlight ═ temp _ bizdate ', -statistical month, — payment account and bank account balance/bank, count, sum, ' yyyyyyyy-mm-dd hh: mi: ss ', ' yyymm ', until the program code B is completely marked.
Based on the same idea, the two methods for marking program codes provided by the embodiments of the present application further provide a first program code marking device, as shown in fig. 3, and a second program code marking device, as shown in fig. 4. .
Fig. 3 is a schematic structural diagram of a first program code marking apparatus provided in an embodiment of the present application, including:
a reading module 301, configured to read program codes sequentially;
a first determining module 302, configured to determine, when a handover identifier included in a program code is read, a marking rule corresponding to the handover identifier;
the marking module 303 is configured to mark the subsequently read program code by using the marking rule, determine another marking rule corresponding to a next switching identifier again when the next switching identifier included in the program code is read again, and continue to mark the read program code by using the other marking rule until all the program codes are marked.
The device further comprises:
an initial marking module 304, configured to determine, before the switching identifier is read for the first time, a marking rule corresponding to the file type according to the file type of the file where the program code is located, and mark, according to the marking rule corresponding to the file type, the program code that is read subsequently until the switching identifier is read.
The device further comprises:
a second determining module 305, configured to determine, by the marking module 303, that a position of the handover identifier in the program code is not a preset specified position before marking a subsequently read program code by using the marking rule.
The marking module 303 is specifically configured to highlight the program code that needs to be marked and is subsequently read.
Fig. 4 is a schematic structural diagram of a second program code marking apparatus provided in an embodiment of the present application, where the program code is written in two programming languages, and two marking rules respectively corresponding to the two programming languages are pre-stored, where the method includes:
a reading module 401, configured to read the program codes sequentially;
a default marking module 402, configured to mark a subsequently read program code by using a default marking rule of the two marking rules;
a marking module 403, configured to, each time a switching identifier included in a program code is read, adopt another marking rule different from the currently used marking rule in the two marking rules, and continue to mark a subsequently read program code until all program codes are marked.
The default marking module 402 is specifically configured to determine, according to the file type of the file where the program code is located, a marking rule corresponding to the file type in the two marking rules, as a default marking rule, and mark the subsequently read program code by using the default marking rule.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (12)

1. A program code marking method, the method comprising:
sequentially reading the program codes;
when a switching identifier contained in a program code is read, determining a marking rule corresponding to the switching identifier; the switching identifier is used for determining a programming language adopted by a program code after the switching identifier, and a marking rule corresponding to the switching identifier is a marking rule corresponding to the programming language;
and marking the subsequently read program codes by adopting the marking rule until a next switching identifier contained in the program codes is read, determining another marking rule corresponding to the next switching identifier again, and continuously marking the read program codes by adopting the other marking rule until all the program codes are marked.
2. The method of claim 1, wherein the method further comprises:
before the switching identifier is read for the first time, determining a marking rule corresponding to the file type according to the file type of the file where the program code is located;
and marking the program codes read subsequently according to the marking rule corresponding to the file type until the switching identifier is read.
3. The method of claim 1, wherein prior to employing the marking rule to mark subsequently read program code, the method further comprises:
determining that the position of the handover identifier in the program code is not a preset specified position.
4. The method according to any one of claims 1 to 3, wherein marking the program code read subsequently comprises:
and highlighting the program code which is read subsequently and needs to be marked.
5. A program code marking method, wherein the program code is written in two programming languages, and two marking rules respectively corresponding to the two programming languages are pre-stored, the method comprising:
sequentially reading the program codes;
marking the subsequently read program codes by adopting a default marking rule in the two marking rules;
and when the switching identifier contained in the program code is read, adopting the other marking rule different from the currently used marking rule in the two marking rules to continuously mark the subsequently read program code until all the program codes are marked.
6. The method of claim 5, wherein marking the subsequently read program code with a default marking rule of the two marking rules comprises:
determining a marking rule corresponding to the file type in the two marking rules as a default marking rule according to the file type of the file where the program code is located;
and marking the subsequently read program codes by adopting the default marking rule.
7. A program code tagging apparatus, the apparatus comprising:
the reading module is used for sequentially reading the program codes;
the device comprises a first determining module, a second determining module and a switching module, wherein the first determining module is used for determining a marking rule corresponding to a switching identifier when the switching identifier contained in a program code is read; the switching identifier is used for determining a programming language adopted by a program code after the switching identifier, and a marking rule corresponding to the switching identifier is a marking rule corresponding to the programming language;
and the marking module is used for marking the subsequently read program codes by adopting the marking rule until the next switching identifier contained in the program codes is read again, determining another marking rule corresponding to the next switching identifier again, and continuously marking the read program codes by adopting the other marking rule until all the program codes are marked.
8. The apparatus of claim 7, wherein the apparatus further comprises:
and the initial marking module is used for determining a marking rule corresponding to the file type according to the file type of the file where the program code is located before the switching identifier is read for the first time, and marking the program code which is read subsequently according to the marking rule corresponding to the file type until the switching identifier is read.
9. The apparatus of claim 7, wherein the apparatus further comprises:
and the second determining module is used for determining that the position of the switching identifier in the program code is not a preset specified position before the marking module adopts the marking rule to mark the subsequently read program code.
10. The device as claimed in any one of claims 7 to 9, wherein the marking module is specifically configured to highlight the program code to be marked that is subsequently read.
11. A program code marking apparatus, wherein the program code is written in two programming languages, and two marking rules respectively corresponding to the two programming languages are pre-stored, the apparatus comprising:
the reading module is used for sequentially reading the program codes;
the default marking module is used for marking the subsequently read program codes by adopting the default marking rule in the two marking rules;
and the marking module is used for adopting another marking rule different from the currently used marking rule in the two marking rules to continuously mark the subsequently read program codes when the switching identifiers contained in the program codes are read until all the program codes are marked.
12. The apparatus according to claim 11, wherein the default marking module is specifically configured to determine, according to a file type of a file in which the program code is located, a marking rule corresponding to the file type in the two marking rules, as a default marking rule, and mark a subsequently read program code by using the default marking rule.
CN201610164621.2A 2016-03-22 2016-03-22 Program code marking method and device Active CN107220034B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610164621.2A CN107220034B (en) 2016-03-22 2016-03-22 Program code marking method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610164621.2A CN107220034B (en) 2016-03-22 2016-03-22 Program code marking method and device

Publications (2)

Publication Number Publication Date
CN107220034A CN107220034A (en) 2017-09-29
CN107220034B true CN107220034B (en) 2020-10-16

Family

ID=59927935

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610164621.2A Active CN107220034B (en) 2016-03-22 2016-03-22 Program code marking method and device

Country Status (1)

Country Link
CN (1) CN107220034B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240743B (en) * 2018-08-03 2021-07-27 挖财网络技术有限公司 Method for switching codes by using specific label

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1510569A (en) * 2002-12-23 2004-07-07 华为技术有限公司 Method for extracting and concentrating hard code string from source codes
CN101071446A (en) * 2007-06-22 2007-11-14 腾讯科技(深圳)有限公司 Marked language archive analytical method, analytical module and user terminal
CN102750152A (en) * 2012-06-21 2012-10-24 新浪网技术(中国)有限公司 Method and device of application for generating a plurality of programming languages based on descriptive language

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1510569A (en) * 2002-12-23 2004-07-07 华为技术有限公司 Method for extracting and concentrating hard code string from source codes
CN101071446A (en) * 2007-06-22 2007-11-14 腾讯科技(深圳)有限公司 Marked language archive analytical method, analytical module and user terminal
CN102750152A (en) * 2012-06-21 2012-10-24 新浪网技术(中国)有限公司 Method and device of application for generating a plurality of programming languages based on descriptive language

Also Published As

Publication number Publication date
CN107220034A (en) 2017-09-29

Similar Documents

Publication Publication Date Title
US9760347B2 (en) Method and system to identify GUI objects for non-markup-language-presented applications
JP2007094818A (en) Batch copy and paste method, device and computer program for a plurality of pieces of data
CN109241026B (en) Data management method, device and system
CN108846069B (en) Document execution method and device based on markup language
CN110221824B (en) Method and device for generating component
CN106598828B (en) A kind of invalid class in source code determines method and device
CN116627429B (en) Assembly code generation method and device, electronic equipment and storage medium
CN107515739B (en) Method and device for improving code execution performance
CN113010169A (en) Method and apparatus for converting UI diagram into code file
CN111222315B (en) Movie scenario prediction method
CN105677805A (en) Data storing and reading method and device using protobuf
CN115599764A (en) Method, device and medium for migrating table data
US9454382B2 (en) Verification of UML state machines
CN107220034B (en) Program code marking method and device
CN105867886B (en) Method and device for writing table
CN105447040B (en) Binary file management and updating method, device and system
CN110058996B (en) Program debugging method, device, equipment and storage medium
CN106874181B (en) Interface conversion verification method and device
CN105426676A (en) Drilling data processing method and system
CN115981617A (en) Code sentence recommendation method and device, electronic equipment and storage medium
CN107943923B (en) Telegram code database construction method, telegram code identification method and device
CN105843661B (en) A kind of code method for relocating and its system towards host system
CN107239270B (en) Code processing method and device
EP3992785A1 (en) Method and apparatus for acquiring command line multiway tree of data network device
CN113434748A (en) Template annotation based distributed crawler method and device, computer device and computer readable storage medium

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201013

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201013

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.