Domain-specific language highlight display method and device, electronic equipment, medium and product

By using the editor to detect and highlight the text information of specific languages ​​in the field in the webpage application software, the lack of support for specific language support in the webpage application software has been solved, and the readability of highlight display and code readability is improved. Scope of application of specific languages ​​in the field.

CN119356655APending Publication Date: 2025-01-24GF SECURITIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411392655.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The lack of support for domain-specific languages ​​in web application software has led to the inability to highlight text information in domain-specific languages, increasing the coding complexity and error rate of developers.

Method used

By obtaining the user in the webpage application software page to enter text information, use the mount editor to detect whether the text information of a specific language in the target field, and respond to the test results highlight the corresponding target text information on the page.

Benefits of technology

The highlights of specific languages ​​in the field have been achieved, the readability of code is improved, and the developer can quickly identify the code structure and potential errors, reduce the degree of language abstraction and expand the scope of the application of specific languages ​​in the field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356655A_ABST
    Figure CN119356655A_ABST
Patent Text Reader

Abstract

The invention discloses a field-specific language highlight display method and device, electronic equipment, a medium and a product. The method comprises the following steps: acquiring text information input by a user on a page of webpage application software; detecting whether the text information is text information of a specific language in a target field by utilizing an editor mounted on the webpage application software; and in response to the fact that the text information is detected to be the text information of the target domain specific language, highlighting the target text information corresponding to the text information on a page of the webpage application software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a method, device, electronic equipment, medium and product for highlighting a domain-specific language. Background Art

[0002] A Domain-Specific Language (DSL) is a programming language designed specifically to solve problems in a specific domain. Unlike a general-purpose language (GPL), a DSL usually focuses on a specific problem domain or task, providing customized syntax and functions to make problem solving in that domain more efficient and intuitive.

[0003] Currently, there is a lack of support for domain-specific languages ​​in web (World Wide Web, web) application software. Summary of the invention

[0004] Embodiments of the present application provide a method, device, electronic device, medium, and product for highlighting domain-specific language.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] A domain specific language highlighting method, the method comprising:

[0007] Obtain text information entered by the user on the page of the web application software;

[0008] Using the editor mounted on the web application software to detect whether the text information is text information in a target domain specific language;

[0009] In response to detecting that the text information is text information in the target domain-specific language, target text information corresponding to the text information is highlighted on the page of the web application software.

[0010] In the above solution, in response to detecting that the text information is text information in the target domain specific language, highlighting the target text information corresponding to the text information on the page of the web application software includes:

[0011] In response to detecting that the text information is text information in the target domain specific language, using the editor to obtain identification information of the text information in the target domain specific language, and searching for a domain specific language rule table and a display style corresponding to the identification information;

[0012] Based on the domain-specific language rule table and the display style, adding styles to the comments and keywords in the language elements included in the text information to obtain the target text information;

[0013] The target text information is highlighted on the page of the web application software.

[0014] In the above solution, the key in the domain-specific language rule table is the language element type and the value is a regular expression.

[0015] In the above solution, different language elements in the target text information correspond to different display styles.

[0016] In the above solution, before using the editor to obtain identification information of the text information in the target domain specific language, the method further includes:

[0017] Put the text information into an element tag and add a style to the element tag.

[0018] In the above solution, the step of using the editor mounted on the web application software to detect whether the text information is text information in a target domain specific language includes:

[0019] Invoking a target thread independent of the main program of the web application software, and using the editor to detect whether the text information is text information in the target domain specific language;

[0020] Accordingly, in response to detecting that the text information is text information in the target domain specific language, highlighting target text information corresponding to the text information on the page of the web application software includes:

[0021] The target thread is called, and in response to detecting that the text information is text information in the target domain-specific language, the target text information is highlighted on the page.

[0022] A domain-specific language highlighting display device, the domain-specific language highlighting display device comprising:

[0023] An acquisition module is used to acquire text information input by a user on a page of a web application software;

[0024] A processing module, used for detecting whether the text information is text information in a target domain specific language by using an editor mounted on the web application software;

[0025] The processing module is used for highlighting target text information corresponding to the text information on the page of the web application software in response to detecting that the text information is text information in the target domain specific language.

[0026] An electronic device comprising: a processor and a memory for storing a computer program that can be run on the processor,

[0027] Wherein, when the processor is used to run the computer program, it executes the steps of any one of the above methods.

[0028] A storage medium stores a computer program, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0029] A computer product comprises a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above methods are implemented.

[0030] The domain-specific language highlighting method, device, electronic device, medium and product provided by the present application, wherein the domain-specific language highlighting method comprises: obtaining text information input by a user on a page of a web application software; using an editor mounted on the web application software to detect whether the text information is text information in a target domain-specific language; in response to detecting that the text information is text information in a target domain-specific language, highlighting the target text information corresponding to the text information on the page of the web application software; the present application solves the problem of lack of support for domain-specific languages ​​in web application software, realizes highlighting of domain-specific languages, and expands the scope of application of domain-specific languages. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A flowchart of a method for highlighting a domain-specific language provided in an embodiment of the present application;

[0032] Figure 2 A schematic diagram of a multi-stage implementation of a domain-specific language highlighting for a domain-specific language provided in an embodiment of the present application;

[0033] Figure 3 A schematic diagram of code display before highlight configuration provided in an embodiment of the present application;

[0034] Figure 4 A schematic diagram of code display after highlighting configuration provided in an embodiment of the present application;

[0035] Figure 5 A schematic diagram of a code snippet highlighting effect provided in an embodiment of the present application;

[0036] Figure 6 A schematic diagram of the structure of a domain-specific language highlighting display device provided in an embodiment of the present application;

[0037] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0039] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0040] The terms "first / second / third" involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0042] In the related art, code highlighting can be implemented in Hypertext Markup Language (HTML), that is, <pre>and <code>The tag writes a custom Cascading Style Sheets (CSS) to achieve code highlighting. This kind of highlighting has the following problems:

[0043] 1. Although the pre tag and code tag can realize the highlighting of the code, it cannot interact with the user and can only be displayed;

[0044] 2. For the input code, you need to manually split different elements of the code, and add different DOM structures and styles for different types, which increases the complexity of the project;

[0045] 3. For different languages, you need to repeat the above steps, re-process the input code, write the style, and change the code structure.

[0046] In the related art, in web application software, there is a lack of support for domain specific languages.

[0047] The embodiment of the present application provides a method for highlighting domain-specific language, referring to Figure 1 As shown, the method comprises the following steps:

[0048] Step S101: obtaining text information input by a user on a page of a web application software.

[0049] In actual application, the execution subject of this embodiment can be an electronic device, which has functions such as data processing, data communication and program running. Usually, the operation of each component in the electronic device can be driven by a core controller / processor, so the execution subject of this embodiment can also be a controller / processor in the electronic device. Among them, the text information includes text content displayed to the user on the web page through HyperText Markup Language (HTML) or other web page technologies (such as CSS, JavaScript, etc.). These text contents can be the title, paragraph, list item, link, form element (such as input box, text on button), description of the picture (alt text), and any other information presented in text form. User input includes but is not limited to selecting text information and entering text information through input tools (such as mouse, keyboard, etc.).

[0050] Step S102: using the editor mounted on the web application software to detect whether the text information is text information in the target domain specific language.

[0051] In practical applications, a domain-specific language is a computer language built to express a clearly defined specific domain. A domain-specific language is designed with grammatical notations and conceptual abstractions that fit its semantic model for a specific problem domain. This application does not specifically limit the domains involved in domain-specific languages.

[0052] In actual application, editors include code editors, text editors, and rich text editors. Among them, the code editor can be Monaco Editor, which has the following features: elegant and neat interface, excellent performance, out-of-the-box use, and strong stability. The editor is a component that is easy to embed into any web page.

[0053] In actual application, this application mounts the editor at the corresponding position of the web application software. In this way, after starting the web application software, the editor mounted by the web application software can be used to detect the text information input by the user to determine whether the user has entered a domain-specific language.

[0054] Step S103: In response to detecting that the text information is text information in a target domain specific language, highlighting target text information corresponding to the text information on a page of the web application software.

[0055] In actual application, text information includes code, so highlighting text information can be called code highlighting, also known as syntax highlighting or source code highlighting. When highlighting the code, the application can distinguish different elements in the code by different colors and styles when displaying the source code.

[0056] In actual application, when it is detected that the user has entered a domain-specific language, in response to this detection result, that is, the text information entered by the user belongs to the text information of the target domain-specific language, the target text information corresponding to the text information is highlighted on the web page, thereby improving the readability of the domain-specific language and helping developers to identify code structure and potential errors more quickly, thereby reducing the language abstraction level of the domain-specific language and expanding the scope of application of the domain-specific language.

[0057] This application can highlight the text information entered by users on web pages, thereby providing real-time user input feedback and intelligent auxiliary functions for domain-specific language highlighting, helping developers lower the usage threshold, improve writing efficiency, reduce errors and optimize the programming experience.

[0058] The domain-specific language highlighting method provided by the present application includes: obtaining text information input by a user on a page of a web application software; using an editor mounted on the web application software to detect whether the text information is text information in a target domain-specific language; in response to detecting that the text information is text information in a target domain-specific language, highlighting the target text information corresponding to the text information on the page of the web application software; it can be seen that the present application can determine whether the user has input a domain-specific language, and if the user has input a specific language, the present application can highlight the domain-specific language. The present application solves the problem of lack of support for domain-specific languages ​​in web application software, realizes the highlighting of domain-specific languages, expands the scope of application of domain-specific languages, improves the domain user experience, and improves product competitiveness.

[0059] In some embodiments of the present application, step S102 uses an editor mounted on the web application software to detect whether the text information is text information in a target domain specific language, including: calling a target thread independent of the main program of the web application software, and using the editor to detect whether the text information is text information in a target domain specific language.

[0060] In some embodiments of the present application, step S103, in response to detecting that the text information is text information in a target domain-specific language, highlights target text information corresponding to the text information on a page of the web application software, including: calling a target thread, and in response to detecting that the text information is text information in a target domain-specific language, highlights the target text information on the page.

[0061] In actual application, the target thread can be a worker thread created for a domain-specific language. This application places the domain-specific language highlighting display in the worker for execution. After the execution is completed, the result is returned to the main thread of the Web application software. The worker thread is independent of the main thread and will not affect the page performance of the Web application software, thereby improving the efficiency of the domain-specific language highlighting display.

[0062] In some embodiments of the present application, in response to detecting that the text information is text information in a target domain specific language, step S103 highlights target text information corresponding to the text information on a page of the web application software, including:

[0063] First, in response to detecting that the text information is text information in a target domain-specific language, an editor is used to obtain identification information of the text information in the target domain-specific language, and a domain-specific language rule table and a display style corresponding to the identification information are searched; wherein the domain-specific language rule table includes but is not limited to lexical rules and / or grammatical rules.

[0064] Secondly, based on the domain-specific language rule table and display style, styles are added to the comments and keywords in the language elements included in the text information to obtain the target text information.

[0065] The keywords include but are not limited to functions and variables.

[0066] Finally, the target text information is highlighted on the page of the web application software.

[0067] In actual application, it is detected that the text information input by the user is text information in a target domain-specific language, and an editor is used to obtain identification information (Identity document, ID) of the text information in the target domain-specific language, and a domain-specific language rule table and display style corresponding to the ID are searched; based on the domain-specific language rule table and display style, styles are added to the comments and keywords in the language elements included in the text information to obtain the target text information, and the target text information is highlighted on the page of the Web application software.

[0068] In some embodiments of the present application, the key in the domain-specific language rule table is the language element type and the value is a regular expression.

[0069] In some embodiments of the present application, different language elements in the target text information correspond to different display styles.

[0070] In some embodiments of the present application, before using the editor to obtain identification information of the text information in the target domain-specific language, the method further includes:

[0071] Put text information into element tags and add styles to element tags.

[0072] In actual application, take the text information input by the user as code, put the input code into the element tag (pre tag), and add style to the pre tag. Further, analyze the input code, split it into comment and keyword parts, and wrap them in span tags respectively; add style to comment and keyword; refresh the page to observe the highlighting effect.

[0073] In a possible domain-specific language domain-specific language highlighting scenario, see Figure 2 As shown in the figure, the implementation of domain-specific language highlighting is described in three stages:

[0074] Phase 1: Complete editor setup and start domain-specific language design.

[0075] In this phase, Monaco Editor is used as the code editing container, the initial configuration of Monaco Editor is completed, and the build process is integrated. Monaco Editor is a web-based code editor developed by Microsoft. It provides an editing experience similar to Visual Studio Code. It is designed as a component that is easy to embed in any web page.

[0076] In phase 1, you can use the following code to initialize the editor, set the editor basic worker, set the theme skin bound to the domain-specific language, and set the domain-specific language Token Provider.

[0077]

[0078]

[0079] As can be seen from the above, the first stage is to initialize the editor and register the domain-specific language highlighting worker for the domain-specific language, where id is the id of the preset domain-specific language. In actual application, when the user uses a domain-specific language in the editor and triggers a domain-specific language highlighting event, the editor will use this id to find the corresponding domain-specific language rule table and display style, and notify the editor to highlight different parts of the language in the interface.

[0080] Phase 2: Complete the domain-specific language design and mount it on the web application software page.

[0081] In this phase, the domain-specific language is invented, lexical analysis is completed, the lexical analysis results are exported, the lexical rules are imported into Monaco Editor, and the domain-specific language design is completed.

[0082] In phase 2, the design of domain-specific language highlighting can be completed through the following code:

[0083]

[0084]

[0085]

[0086]

[0087] From the above, it can be seen that stage 2 is the specific implementation of domain-specific language highlighting. This application invents a domain-specific language, completes lexical analysis of the language, exports lexical analysis results, imports lexical rules into Monaco Editor, completes domain-specific language involvement, and mounts it on a web application software page.

[0088] Phase 3: Complete the web application software interface coding, mount the code editor to the corresponding node, and debug and run the functions.

[0089] This application uses Monaco Editor as the interactive terminal of the domain-specific language, imports the rules of the domain-specific language into it, and mounts the web component to the corresponding position of the web application.

[0090] Combination Figure 3 and Figure 4 As shown, Figure 3 This is a schematic diagram showing the code before highlighting configuration. Figure 4 A schematic diagram is shown for the highlighted configured code, such as Figure 4 As shown, the functions, variables, and comments of the domain-specific language are distinguished by different colors, which is clear at a glance, and this method is applicable to any domain-specific language.

[0091] In a scenario where domain-specific language highlighting is feasible, the following steps can be used to set up the code editor to support the domain-specific language highlighting feature:

[0092] Step 1: Use Monaco Editor as a code editing container, complete the initial configuration of Monaco Editor, and integrate the build process. Monaco Editor is a web-based code editor developed by Microsoft. It provides an editing experience similar to Visual Studio Code. It is designed as a component that is easy to embed in any web page.

[0093] Step 2: Complete lexical analysis of the domain-specific language and compile a list of keywords

[0094] Step 3: Complete the code highlighting style design and design different colors for different tokens

[0095] Step 4: Set the highlight to the Monaco Editor theme, set the domain-specific language id, and import the lexical rules and display styles.

[0096] For example, combining the following code snippet, we can get Figure 5 The highlighted effect shown,

[0097]

[0098]

[0099] It can be seen from the above content that the domain-specific language highlighting method provided by this application has the following beneficial effects: by using Monaco Editor as the code editing container, the interface is elegant, beautiful and neat, with excellent performance, ready to use out of the box and strong stability. Developer-friendly, complete types, strong extensibility, and simple secondary development. The bottom layer of the editor uses Web Worker to open up a separate thread for syntax highlighting, which will not affect the main page thread, improves the code running efficiency, and brings users a smooth interactive experience. By customizing the lexical analysis and syntax analysis of the domain-specific language, all details of the domain-specific language can be controlled and all functions of the language can be highly customized.

[0100] Based on the same inventive concept as above, Figure 6 A schematic diagram of a domain-specific language highlighting display device provided by an embodiment of the present invention is shown in FIG. 600 . The domain-specific language highlighting display device 600 includes:

[0101] The acquisition module 601 is used to acquire text information input by a user on a page of a web application software;

[0102] Processing module 602, used to detect whether the text information is text information in a target domain specific language using an editor mounted by the web application software;

[0103] The processing module 602 is used to control the display module 603 to highlight the target text information corresponding to the text information on the page of the web application software in response to detecting that the text information is text information in a target domain specific language.

[0104] In some embodiments of the present application, the processing module 602 is used to, in response to detecting that the text information is text information in a target domain-specific language, obtain identification information of the text information in the target domain-specific language using an editor, and search for a domain-specific language rule table and a display style corresponding to the identification information; based on the domain-specific language rule table and the display style, add styles to comments and keywords in the language elements included in the text information to obtain the target text information; and control the display module 603 to highlight the target text information on the page of the web application software.

[0105] In some embodiments of the present application, the key in the domain-specific language rule table is the language element type and the value is a regular expression.

[0106] In some embodiments of the present application, different language elements in the target text information correspond to different display styles.

[0107] In some embodiments of the present application, the processing module 602 is used to put text information into an element tag and add a style to the element tag.

[0108] In some embodiments of the present application, the processing module 602 is used to call a target thread independent of the main program of the web application software, and use the editor to detect whether the text information is text information in the target domain specific language. The processing module 602 is used to call the target thread, and in response to detecting that the text information is text information in the target domain specific language, control the display module 603 to highlight the target text information on the page.

[0109] The domain-specific language highlighting device provided by the present application obtains text information input by a user on a page of a web application software; uses an editor mounted on the web application software to detect whether the text information is text information in a target domain-specific language; in response to detecting that the text information is text information in a target domain-specific language, the target text information corresponding to the text information is highlighted on the page of the web application software; it can be seen that the present application is able to determine whether the user has input a domain-specific language, and if the user has input a specific language, the present application can highlight the domain-specific language. The present application solves the problem of lack of support for domain-specific languages ​​in web application software, realizes the highlighting of domain-specific languages, expands the scope of application of domain-specific languages, improves the domain user experience, and enhances product competitiveness.

[0110] Based on the foregoing embodiments, an embodiment of the present application provides an electronic device, Figure 7 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. The electronic device 700 includes: at least one processor 701, a memory 702, and optionally, the electronic device 700 may further include at least one communication interface 703. The various components in the electronic device 700 are coupled together via a bus system 704. It can be understood that the bus system 704 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 704 .

[0111] Based on the hardware implementation of the above program modules, the communication interface 703 can exchange information with other communication devices;

[0112] The processor 701 is connected to the communication interface 703 to implement information interaction with other communication devices, and is used to execute the method provided by one or more of the above technical solutions when running the computer program;

[0113] A memory 702 on which the computer program is stored.

[0114] Specifically, processor 701 is used to obtain text information input by a user on a page of a web application software; use an editor mounted on the web application software to detect whether the text information is text information in a target domain-specific language; in response to detecting that the text information is text information in a target domain-specific language, highlight the target text information corresponding to the text information on the page of the web application software.

[0115] In some embodiments of the present application, the processor 701 is used to, in response to detecting that the text information is text information in a target domain-specific language, obtain identification information of the text information in the target domain-specific language using an editor, and search for a domain-specific language rule table and display style corresponding to the identification information; based on the domain-specific language rule table and display style, add styles to comments and keywords in the language elements included in the text information to obtain the target text information; and highlight the target text information on a page of the web application software.

[0116] In some embodiments of the present application, the key in the domain-specific language rule table is the language element type and the value is a regular expression.

[0117] In some embodiments of the present application, different language elements in the target text information correspond to different display styles.

[0118] In some embodiments of the present application, the processor 701 is used to put text information into an element tag and add a style to the element tag.

[0119] In some embodiments of the present application, the processor 701 is used to call a target thread independent of the main program of the web application software, and use an editor to detect whether the text information is text information in a target domain specific language. The target thread is called, and in response to detecting that the text information is text information in a target domain specific language, the target text information is highlighted on the page.

[0120] In some embodiments of the present application, the prompt information includes annotation text and / or usage help information corresponding to the text information.

[0121] It can be understood that the memory 702 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Sync Link Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 702 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memories.

[0122] The memory 702 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device 700. Examples of such data include: any computer program for operating on the electronic device 700. The program for implementing the method of the embodiment of the present invention may be included in the memory 702.

[0123] The method disclosed in the above embodiment of the present invention can be applied to the processor 701, or implemented by the processor 701. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0124] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the above method.

[0125] Based on the above embodiments, the embodiments of the present application further provide a computer product, including a computer program, which is executed by a processor to implement Figure 1 The corresponding embodiment provides steps in the domain specific language highlighting method.

[0126] Based on the above embodiments, the embodiments of the present application further provide a storage medium, wherein the storage medium stores computer executable instructions, and the computer executable instructions are configured to execute Figure 1 The corresponding embodiment provides a domain-specific language highlighting method.

[0127] It should be noted that the above-mentioned computer storage medium can be a memory such as ROM, PROM, EPROM, EEPROM, FRAM, FlashMemory, magnetic surface storage, optical disk, or CD-ROM; it can also be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0128] It should be noted that, in this article, the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0129] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0131] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0132] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0133] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0134] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.< / code> < / pre>

Claims

1. A method for highlighting domain-specific language, characterized in that: The method comprises: Obtain text information entered by the user on the page of the web application software; Using the editor mounted on the web application software to detect whether the text information is text information in a target domain specific language; In response to detecting that the text information is text information in the target domain-specific language, target text information corresponding to the text information is highlighted on the page of the web application software.

2. The method according to claim 1, characterized in that In response to detecting that the text information is text information in the target domain specific language, highlighting target text information corresponding to the text information on the page of the web application software includes: In response to detecting that the text information is text information in the target domain specific language, using the editor to obtain identification information of the text information in the target domain specific language, and searching for a domain specific language rule table and a display style corresponding to the identification information; Based on the domain-specific language rule table and the display style, adding styles to the comments and keywords in the language elements included in the text information to obtain the target text information; The target text information is highlighted on the page of the web application software.

3. The method according to claim 2, characterized in that The keys in the domain specific language rule table are language element types and the values ​​are regular expressions.

4. The method according to claim 2, characterized in that: Different language elements in the target text information correspond to different display styles.

5. The method according to claim 2, characterized in that: Before using the editor to obtain identification information of the text information in the target domain specific language, the method further includes: Put the text information into an element tag and add a style to the element tag.

6. The method according to any one of claims 1 to 5, characterized in that The step of using the editor mounted on the web application software to detect whether the text information is text information in a target domain specific language includes: Invoking a target thread independent of the main program of the web application software, and using the editor to detect whether the text information is text information in the target domain specific language; Accordingly, in response to detecting that the text information is text information in the target domain specific language, highlighting target text information corresponding to the text information on the page of the web application software includes: The target thread is called, and in response to detecting that the text information is text information in the target domain-specific language, the target text information is highlighted on the page.

7. A domain-specific language highlighting device, characterized in that: include: An acquisition module is used to acquire text information input by a user on a page of a web application software; A processing module, used for detecting whether the text information is text information in a target domain specific language by using an editor mounted on the web application software; The processing module is used for highlighting target text information corresponding to the text information on the page of the web application software in response to detecting that the text information is text information in the target domain specific language.

8. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the method described in any one of claims 1 to 6.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.