CN114675831B - Compiling system and method for programming language - Google Patents

Compiling system and method for programming language Download PDF

Info

Publication number
CN114675831B
CN114675831B CN202210232360.9A CN202210232360A CN114675831B CN 114675831 B CN114675831 B CN 114675831B CN 202210232360 A CN202210232360 A CN 202210232360A CN 114675831 B CN114675831 B CN 114675831B
Authority
CN
China
Prior art keywords
code
function
current
codes
flag bit
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
CN202210232360.9A
Other languages
Chinese (zh)
Other versions
CN114675831A (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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202210232360.9A priority Critical patent/CN114675831B/en
Publication of CN114675831A publication Critical patent/CN114675831A/en
Application granted granted Critical
Publication of CN114675831B publication Critical patent/CN114675831B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a compiling system and a method of a programming language, wherein the system comprises an interaction module, a compiling module, a pre-executing module and an executing module, the received rule codes are converted into process codes through the compiling module and the pre-executing module, and then the process codes are executed through the executing module to obtain results, so that a user can finally obtain a resolving result only by inputting the rule codes into the compiling system of the programming language, and the working difficulty and the error quantity of the user are greatly reduced.

Description

Compiling system and method for programming language
Technical Field
The present invention relates to a compiling system and method for a programming language, and more particularly, to a compiling system and method capable of converting a rule code into a process code.
Background
The current mainstream scientific computing system implementation method generally combines a user interaction interface with a compiler and a virtual machine of a programming language based on a process, the scientific computing system constructed based on the user interaction interface needs a user to manually write a process code for solving the scientific computing problem, the writing of the process code needs strong specialization, and the probability of error occurrence is high, so that the systematic defects of large user workload and easy error exist.
A function can be understood as a logic path from a condition to a result, and in a programming language which we commonly touch, the result is obtained finally by writing the function, then inputting an initial condition; this process of deriving results through initial conditions, logical paths of conditions to results is referred to as process operations, where the source code that needs to be entered is the process code.
When the condition is sufficient for the result, the result is deterministic, whether or not it indicates a logical path for the calculation result. The process of deriving the result by the initial condition and calculating the rule is rule operation, wherein the source code needing to be input is the rule code.
The advantages of the rule-based operation language over the procedural operation language are quite obvious, since the user does not have to spend a great deal of time thinking about the logical procedure from condition to result. For example, the solution of the unitary quadratic equation is required, and a user is originally required to write different simplifying, merging and solving logics according to different equations, and now, all the unitary quadratic equations can be solved only by providing basic conversion rules such as addition combination law, multiplication allocation law and the like and solving the unitary quadratic equation.
Aiming at the problems, some rule operation languages are proposed and designed at present, the rule operation languages are higher-level programming languages than the process operation languages, and the logic thinking of users can be reduced through rule operation, however, the existing rule operation languages have the problems of narrow application range, difficult reading, complex use and the like, and the user experience is poor, so that the large-scale popularization and application of the rule operation languages are severely restricted.
For the above reasons, the present invention has made intensive studies on rule codes and process codes in hopes of designing a compiling system and method capable of solving the above problems.
Disclosure of Invention
In order to overcome the problems, the inventor has conducted intensive research and devised a compiling system and method of a programming language, the system comprises an interaction module, a compiling module, a pre-executing module and an executing module, the received rule codes are converted into process codes through the compiling module and the pre-executing module, and then the process codes are executed through the executing module to obtain results, so that a user can finally obtain a resolving result only by inputting the rule codes into the compiling system of the programming language, and the working difficulty and the error quantity of the user are greatly reduced, thereby completing the invention.
In particular, it is an object of the present invention to provide a compiling system in a programming language, the system comprising:
an interaction module for receiving source code;
the compiling module is used for preprocessing the source codes to obtain primary code tables;
the pre-execution module is used for pre-executing the primary code table to obtain a secondary code table;
and the execution module is used for executing the secondary code table to obtain the solution of the problem.
The source code comprises problem constraint of a problem to be solved and transformation rules used for solving the problem.
The compiling module comprises a preprocessing sub-module, a compiling sub-module and a converting sub-module;
the preprocessing sub-module is used for preprocessing the source code and generating a precompiled code;
the compiling sub-module is used for compiling the pre-compiled codes, generating character codes and storing the character codes in a character code table;
the conversion sub-module is used for converting the character codes in the character code table into primary codes and generating a scope table, an attribute table and a function table.
Wherein, in the preprocessing process, the preprocessing submodule executes any one or more of the following steps:
step 1, deleting source code annotation;
Step 2, deleting the blank space and the line feed symbol in the source code;
step 3, merging source codes in a plurality of files;
step 4, sentence replacement;
step 5, deleting the invalid source codes;
step 6, replacing the non-ASCII code appearing in the source code identifier with an ASCII code character string;
and 7, deforming function statement and call statement which are composed of character strings and parameters in the source code.
In step 7, all function parameters which are not behind the function name string are moved to the back of the string, and the sequence of the function parameters is kept unchanged; at the same time, the character string of the new function name is formed by replacing the specific character string at the original position of the function parameter.
And in the compiling submodule, generating character codes with character code type flag bits, character code quaternion and character code quaternion parameter type flag bit arrays through a lexical analysis algorithm and a grammar analysis algorithm.
The conversion sub-module reads the character codes line by line from the character code table, performs preliminary analysis on the character codes to generate primary codes, and stores the primary codes in the primary code table; parsing generates a scope table, an attribute table and a function table simultaneously.
The pre-execution process of the pre-execution module comprises the following steps:
step a: for codes with code executable flag bits being abandoned or not executed, directly skipping over the currently executed codes; the current execution code is the code in the pre-execution process;
step b: for codes with code executable flag bits of 'executing under certain conditions', and when the current condition is not a function call or the current condition is not a conditional statement execution, directly skipping codes in the whole scope;
step c: for the code with the code executable flag bit being "executed under a certain condition", and when the current condition is a function call or a conditional statement execution, or for the code with the code executable flag bit being "directly executed", setting an execution process according to the code type flag bit, and specifically executing any one or more steps of the following sub steps:
c-1, skipping the current execution code when the code type flag bit is skip;
c-2, skipping the current execution code when the code type flag bit is the tag;
c-3, skipping the current execution code when the code type flag bit is the return operation;
C-4, skipping the current execution code when the code type flag bit is "function operation";
c-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing additional information of the activity record, and marking the created activity record as the current activity record;
c-6, destroying and leaving the current active record when the code type flag bit is 'domain end', and marking the return active record as the current active record;
c-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
preferably, the method further comprises a substep c-8, namely, when the "code type flag bit" is "expression", any one or more of the following substeps are specifically executed:
sub-step c-8-1, when the currently executing code has been bound to the function, i.e. the matching function address is not empty,
if the flag bit of the function root node is false, skipping the current execution code;
If the flag bit of the function root node is true, calling the bound function; comparing the grammar tree taking the current execution code as a root node with the grammar tree corresponding to the function statement expression of the bound function to generate a shape parameter reference table, setting the current execution code as a function realization scope starting code of the bound function, and executing the function realization scope starting code under a function call condition;
when the current execution code is not bound with the function, namely when the matching function address is empty, performing code replacement and function binding on the current execution code; copying the code segment corresponding to the longest expression where the current execution code is located, and adding a key value pair taking an initial accumulated weight value 0 as a key and the copied code segment as a value to a current code bin; the code bin is a two-dimensional table taking accumulated weight values as keys and code segments as values, each key value pair in the code bin is arranged from front to back according to the accumulated weight values, the maximum number of storable key value pairs in the code bin is set by a user, when trying to add a new key value pair to a full code bin, if the accumulated weight value in the key value pair is greater than the minimum value of the accumulated weight values in all keys in the code bin, the code bin firstly deletes the head key value pair and then adds the new key value pair, and if the accumulated weight value in the key value pair is smaller than or equal to the minimum value of the accumulated weight values in all keys, the code bin does not perform any treatment on the added key value pair and does not add the new key value pair;
When the current code bin is not empty, popping up code segments and accumulated weight values thereof from the tail end of the code bin, and matching all local code segments corresponding to grammar tree branches meeting the condition that any node is not bound with the function in the code segments with all accessible functions;
when the local code segment is successfully matched with the function and the matched function is a function of a return expression, copying the code segment to be matched, replacing the local code segment matched with the function declaration expression in the copied code segment with the code segment corresponding to the expression returned by the function subjected to parameter replacement, adding the accumulated weight value of the code segment to be matched with the weight value of the function matched with the local code segment to obtain the accumulated weight value of the copied code segment, and adding a key value pair consisting of the accumulated weight value of the copied code segment and the copied code segment to a waiting code bin;
when the local code segment is successfully matched with the function and the bound function is a function returning an operation result, copying the code segment to be matched, binding each row of codes in the local code segment matched with the function in the copied code segment with the matched function, and setting the root node mark position of the root node code of the local code segment as true; at the moment, checking whether all codes in the copied code segment are bound with the function, if all codes are bound with the function, finishing the matching process, replacing the corresponding code segment of the longest expression of the current execution code in the code table by the copied code segment, marking the first row of codes of the replacement part in the code table as the current execution code after the replacement is finished, and executing the code;
If the code segments in the copied code segments are not bound with the functions, adding the accumulated weight value of the code segments to be matched with the weight value of the bound functions to obtain the accumulated weight value of the copied code segments, and adding a key value pair consisting of the weight value of the copied code segments and the copied code segments to a waiting code bin;
when the current code bin is empty, marking the current code bin as a waiting code bin, marking the original waiting code bin as the current code bin, and re-executing the operation when the current code bin is not empty;
preferably, substep c-9 is also included, namely skipping the currently executing code when the "code type flag bit" is "end of expression".
The execution process of the execution module comprises the following steps:
step one, for the code of which the code executable flag bit is abandoned or not executed, directly skipping the code;
step two, for the code of which the code executable zone bit is executed under a certain condition, and when the current condition is not function call or conditional statement execution, directly skipping the code in the whole scope;
step C, for the code with the code executable flag bit being executed under a certain condition, when the current condition is function call or conditional statement execution, or for the code with the code executable flag bit being directly executed,
Specifically, any one or more of the following sub-steps are performed:
step C-1, when the code type flag bit is 'jump', setting the current execution code as the code of the next row of codes of the code where the jumped tag is located if the jump condition is true, otherwise, directly skipping the current execution code;
sub-step C-2, when the code type flag bit is the tag, skipping the current execution code;
sub-step C-3, when the code type flag bit is return operation, ending executing the function and returning to the function calling position; specifically, the returned operation value is assigned to an actual return parameter corresponding to a return parameter in the form of the 'shape parameter reference table', and if the actual return parameter does not exist, the value is not assigned;
marking the current activity record as an activity record to be destroyed, marking a return address corresponding code of the current activity record as a current execution code, marking the return activity record of the current activity record as the current activity record, recursively destroying the activity record to be destroyed, and executing the current execution code;
sub-step C-4, skipping the current execution code when the code type flag bit is "function operation";
Sub-step C-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing activity record information, and setting the created activity record as the current activity record;
step C-6, when the code type flag bit is 'domain end', marking the current activity record as an activity record to be destroyed, if the returned activity record does not exist, destroying the current activity record, and ending the program execution; otherwise, marking the return address corresponding code of the current activity record as a current execution code, marking the return activity record of the current activity record as the current activity record, recursively destroying the activity record, and executing the current execution code;
sub-step C-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
sub-step C-8, when the code type flag bit is the expression, skipping the current execution code if the function root node flag bit is false; if the flag bit of the function root node is true, calling the bound function;
And a sub-step C-9, when the code type flag bit is 'expression end', indicating that the expression of the last line of codes of the current execution code is ended, and skipping the current execution code.
The application also provides a compiling method of the programming language,
the method comprises the following steps:
receiving source codes through an interaction module;
preprocessing and compiling the source code through a compiling module to obtain a primary code table;
pre-executing the primary code table through a pre-executing module to obtain a secondary code table;
and executing the secondary code table by an execution module to obtain a solution of the problem.
The application has the beneficial effects that:
according to the compiling system of the programming language, provided by the application, the rule codes can be converted into the process codes, and then the process codes are solved to obtain the solution of the problem, so that a user does not need to spend a great deal of time to think about the logic process from the condition to the result, and the possibility of error occurrence can be reduced while the working intensity of the user is reduced; in general, when the total number of transformations (including the transformation of errors to be excluded by the user) performed by the rules is used as a measure of consideration when the result is finally obtained, the workload required for writing the code, the number of errors in the code, and the code length are in positive correlation with the consideration required for writing the code.
Drawings
FIG. 1 is a logical view showing the overall structure of a compiling system for a programming language according to a preferred embodiment of the present application.
Reference numerals
1-interaction module
2-compiling module
3-Pre-execution Module
4-execution module
Detailed Description
The application is further described in detail below by means of the figures and examples. The features and advantages of the present application will become more apparent from the description.
The word "exemplary" is used herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. Although various aspects of the embodiments are illustrated in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
According to the compiling system of the programming language provided by the application, as shown in fig. 1, the system comprises an interaction module 1, a compiling module 2, a pre-executing module 3 and an executing module 4.
In a preferred embodiment, the interaction module 1 is configured to receive a source code, where the source code refers to a code input by a user through an input port, and the source code includes a rule code described in the present application, where the rule code refers specifically to a problem constraint of a problem to be solved and a transformation rule used for solving the problem. Therefore, a user can directly input the problem constraint of the problem to be solved and the transformation rule used for solving the problem into the compiling system in the form of source codes, so that the input workload of the user is greatly simplified, and the error risk can be reduced under the condition of improving the working efficiency.
The problem constraint of the problem to be solved in the application can be an expression, and the change rule can be a function.
In a preferred embodiment, the compiling module 2 is configured to preprocess the source code to obtain a primary code table, a scope table, an attribute table and a function table;
in particular, the compiling module 2 comprises a preprocessing sub-module, a compiling sub-module and a converting sub-module,
the preprocessing sub-module is used for preprocessing the source code and generating a precompiled code, and in the preprocessing process, the preprocessing sub-module executes any one or more of the following steps according to the specific content of the source code:
step 1, deleting source code annotation;
step 2, deleting the blank space and the line feed symbol in the source code;
step 3, merging source codes in a plurality of files;
step 4, sentence replacement;
step 5, deleting the invalid source codes; the invalid source code is a code marked by a user through a preprocessing instruction without compiling and a code which is not executed necessarily due to the fact that the user writes the code without specification;
step 6, replacing the non-ASCII code appearing in the source code identifier with an ASCII code character string;
Step 7, deforming the function statement and the call statement which are formed by the character strings and the parameters in the source code;
in step 7, all the function parameters which are not behind the function name character string are moved to the back of the function name character string, and the sequence of the function parameters is kept unchanged; at the same time, a specific character string is replaced at the original position of the function parameter to form a new character string, wherein the specific character string is used for identifying that the position corresponds to one parameter originally, for example: "_Arg_"; specifically, add (a) and (B) to (C) are deformed into add_arg_and_arg_to (a, B, C) after precoding.
The compiling sub-module is used for compiling the pre-compiled codes to generate character codes and storing the character codes in a character code table, and preferably, in the compiling sub-module, character codes with character code type flag bits, character code quaternion and character code quaternion parameter type flag bit arrays are generated through a lexical analysis algorithm and a grammar analysis algorithm; the lexical analysis algorithm is an algorithm that converts a character sequence of the pre-compiled code into a word sequence; the grammar analysis algorithm is an algorithm that combines word sequences into various grammar phrases and outputs them as character codes.
Wherein, the character code type flag bit is used for marking the function type of the character code, specifically: when the type mark position of the character code obtained by the compiling sub-module is 'domain start', the function of the character code can be identified to set the start of the function domain;
when the type mark position of the character code obtained by the compiling sub-module is 'domain end', the function of the character code can be identified to set the end of the function domain;
when the type mark position of the character code obtained by the compiling sub-module is variable declaration, the function of the character code can be identified to create a new variable;
when the type mark position of the character code obtained by the compiling sub-module is an expression, the quaternion of the character code can be identified to correspond to a basic expression, wherein the basic expression refers to an expression of a minimum operation unit which can be decomposed and can be represented by a quaternion;
when the type mark position of the character code obtained by the compiling sub-module is 'expression end', the expression of the character code before the character code line is marked to be ended, wherein the expression of the character code refers to the expression of the quaternary expression in the character code;
When the type mark position of the character code obtained by the compiling sub-module is 'function operation', the function of the character code can be identified to be a function declaration scope of a marking function, or a function realization scope, or a function weight value;
when the type mark position of the character code obtained by the compiling sub-module is 'return operation', the function of the character code can be identified to perform function return operation;
when the type mark position of the character code obtained by the compiling sub-module is a label, the label of the character code in the row which is the next row can be identified;
when the character code type mark position obtained by the compiling sub-module is 'skip', the function of identifying the character code is to skip to the position of the character code corresponding to the appointed label to continue execution when the skip condition is met;
regarding the character code quaternion, when the character code type is an expression, the character code quaternion is used for expressing basic monobasic, dibasic and zero arithmetic expressions and storing operators, operation objects and operation results; when the character code type is not an expression, the character code quaternion is only used for storing parameters;
the character code quaternion parameter type flag bit number group is used for marking parameter types of operators, operation objects I, operation objects II and operation results stored in the character code quaternion, and specifically: when the mark position in the mark bit array is an address, the corresponding parameter type in the character code quaternion can be marked as the address; when the mark position in the mark bit array is a number, the corresponding parameter type in the character code quaternary is marked as a number; when the mark position in the mark bit array is an identifier, the corresponding parameter type in the character code quaternion can be marked as the identifier; when the flag position in the flag bit array is a character string, the corresponding parameter type in the character code quaternion can be marked as the character string.
The conversion sub-module is used for converting the character codes in the character code table into primary codes and generating a scope table, an attribute table and a function table, wherein the conversion sub-module reads the character codes line by line from the character code table, performs primary analysis on the character codes to generate primary codes, and stores the primary codes in the primary code table; resolving and generating a scope table, an attribute table and a function table at the same time; preferably, the addresses in the primary code table are multi-level addresses.
Preferably, the character code table specifically includes: a two-dimensional table with single-stage addresses as keys and four-element values is assembled; the single-level address refers to an address represented by an integer, the single-level address of a code in a character code table is the number of rows of the code in a character code file, and each key value pair in the character code table is arranged from front to back according to the size of the single-level address from small to large;
preferably, the primary code table obtained by the conversion sub-module is a two-dimensional table taking multi-level addresses as keys and primary codes as values;
wherein, the multi-level address specifically is: the system comprises an address which is formed by a one-dimensional integer array and has no zero first bit and no last bit, wherein the multi-stage address with only one number in the array is a single-stage address, and the multi-stage address with zero number in the array is a null address; the size comparison mode between the multi-stage addresses is that the corresponding bit numbers are sequentially compared from the initial position of the multi-stage address array to the back: if the numbers of each bit are equal, the two multi-level addresses are equal, and if the two numbers are unequal, the address corresponding to the array where the larger number is located is larger; if the array of one multi-level address is shorter than the array of the other multi-level address, the number of the vacant position of the shorter array relative to the longer array defaults to zero when compared;
The primary code specifically includes: the method comprises the steps of setting an address of a scope where a code is located, a code executable flag bit, a code type flag bit, a quaternary type parameter flag bit array, a quaternary type cost scope parameter flag bit array, a quaternary type parameter modifiable flag bit array and a quaternary type parameter flag bit array.
The address of the scope where the code is located is used for recording the address corresponding to the scope information of the scope where the code is located in the scope table;
the code executable flag bit is used for identifying whether the line of code can be directly executed, and if the flag bit is 'directly executed', the line of code can be directly executed; if the flag bit is "execute under certain conditions", the line of code may not be executed directly, but may be executed under certain conditions; if the flag bit is "not executing," then the line of code may not be executed; if the flag bit is "obsolete", then the line code is invalid and should be deleted;
the code type zone bit is used for identifying the code type of the row of codes and is consistent with the character code type zone bit in the character codes;
the quaternary type parameter flag bit array is used for marking whether the parameters in the quaternary type are form parameters, and is effective when the code executable flag bit is not executed and the parameter type of the corresponding parameters in the quaternary type is an identifier;
The quaternary type book action domain parameter mark bit number group is used for marking whether to search from the action domain where the current code is located when searching the corresponding parameter in the quaternary type book action domain, is effective when the code executable mark bit is 'immediately executed' or 'executed under a certain condition', and the parameter type of the corresponding parameter in the quaternary type is an identifier, the quaternary type parameter is 'true' at the corresponding mark position of the mark bit number group to mark that the parameter is searched, the search is preferentially started from the current action domain, if the current action domain does not exist, the father action domain of the current action domain is searched, the recursion is sequentially carried out, and the value of the homonymy identifier which is searched for the first time is used as the value of the quaternary type parameter; the corresponding flag position of the flag bit array of the quaternary parameter is false so as to inhibit inquiry from the current scope when the parameter is inquired, the parameter is directly inquired in a recursion way from the father scope of the current scope, and the value of the homonymous identifier inquired for the first time is used as the value of the quaternary parameter;
the quaternary parameter modifiable flag bit number set is used for identifying whether the value of a parameter in the quaternary after the line code is executed is allowed to be automatically modified by an execution module, and is valid when the parameter type of the corresponding parameter in the quaternary is an identifier or an address and the modifiable flag bit of at least one parameter in all the parameters in the longest expression where the quaternary is located is not false; when the quaternary parameter is true at the corresponding flag bit of the flag bit array, the value of the quaternary parameter can be identified to be allowed to be automatically modified by the virtual machine after the quaternary is executed; when the corresponding flag bit of the flag bit array is false, the value of the corresponding flag bit of the flag bit can be identified, and the value of the corresponding flag bit is forbidden to be automatically modified by the virtual machine after the quaternary is executed;
The quaternary parameter type flag bit array is expanded from character code quaternary parameter type flag bit arrays and is used for identifying the types of quaternary parameters at corresponding positions.
Preferably, the scope table obtained at the conversion submodule is a two-dimensional table taking a multi-level address as a key and scope information as a value; the key value pairs in the action domain table are arranged from front to back from small to large according to the size of the multi-level address.
Wherein, the scope information specifically includes: a scope type flag bit, a scope starting address, a scope ending address, a parameter query scope address, and a scope attribute address array;
the scope type flag bit is used for identifying the type of the scope, and when the flag bit is 'function declaration', the scope expression can be identified as a function declaration expression, namely the name of the function; when the zone bit is 'function realization', the realization that the expression in the action domain is a function can be identified; when the flag bit is "function implementation with return statement", the expression in this scope can be identified as the implementation of the function and the return statement contained therein;
the scope starting address refers to the address of the scope starting code in the code table;
The acting domain end address refers to the address of the acting domain end code in a code table;
the parameter query scope address is used to query the addresses of the scopes that are involved in this scope but not claimed in this scope and the outer scopes of this scope for which parameters need to be accessed. For example, the function realizes that the parameter of the scope queries the scope address, i.e. the corresponding function declares the scope address, and the parameter of the conditional execution scope queries the scope address, i.e. the address of the scope where the corresponding conditional statement is located. The outer scope of the scope, i.e. the scope comprising the scope directly or indirectly; the (address of the) scope, i.e. the address of the scope information describing this scope in the scope table.
The action scope attribute address array is an array for recording the address of the attribute of the action scope; the (address of the) attribute is the address of the attribute information describing the attribute in the attribute table.
Preferably, the attribute table obtained in the conversion sub-module is a two-dimensional table with a multi-level address as a key and attribute information as a value; the key value pairs in the attribute table are arranged from front to back according to the sizes of the multi-level addresses from small to large.
Preferably, the function table obtained at the conversion sub-module is a two-dimensional table with multi-level addresses as keys and function information as values; the key value pairs in the function table are arranged from front to back according to the size of the multi-stage address from small to large.
The function information specifically includes: a function declaration scope starting address, a function declaration scope ending address, a function declaration root node address, a function realization scope address, a return code address array, a function realization scope starting address, a function realization scope ending address, a function return expression flag bit, a function weight value, and an allow ring structure flag bit.
The function declaration scope is the address of the scope starting code of the scope where the function declaration is located, wherein the function declaration scope only allows one expression of the function declaration expression to exist; the action domain starting code is a code with a code type of 'domain starting'; the addresses of the codes, namely the addresses corresponding to the codes in the code table, specifically the addresses of the character codes in the character code table, the addresses of the primary codes in the primary code table and the addresses of the secondary codes in the secondary code table.
The function declaration scope end address is the position of the scope end code of the scope where the function declaration is located in the primary code table. The scope end code, i.e. the code type is "domain end".
The function declaration root node address is the address of the primary code corresponding to the root node of the grammar tree of the function declaration expression. The grammar tree is the tree expression form of the grammar structure corresponding to the code segment or the expression.
The function realization scope address is the address corresponding to the function realization scope information in the scope table.
The return code address array is the address of all codes executing the function return actions in the function realization scope. The code for executing the return action of the function is the code with the code type of return operation.
The function realization scope starting address is the address of the scope starting code of the scope where the function realization is located.
The function realization scope end address is the address of the scope end code of the scope where the function realization is located.
The function return expression flag bit is used for identifying whether a function return value is an expression or not; when the flag bit is true, the return result of the function is an expression, and the function is a function of the return expression; when the flag bit is false, the return result of the function is an operation value, and the function is a function for returning the operation value.
The function of the return expression is used for replacing the code segment matched with the function declaration expression with the code segment corresponding to the function return expression subjected to parameter replacement; the matching means that the grammar tree structures corresponding to the grammar tree structures are consistent; the code segment matched with the function declaration expression is the code segment matched with the grammar tree corresponding to the function declaration expression, and when the grammar tree corresponding to the code segment is a subtree of the expression grammar tree, the code segment is not necessarily a continuous code segment, but also a plurality of discontinuous codes. The code segment corresponding to the expression of the function return value after parameter replacement, namely the code segment after the form parameters in the code segment corresponding to the expression as the function return value are replaced by the actual parameters; when the function of the return expression represents a reduction operation, code substitution using the function of the return expression may result in code fragments that deviate from the syntax tree of the expression (e.g., transformation a (x+1) +b (x+1) → (a+b) →x+1) may cause an x+1 to deviate from the syntax tree), while when the function of the return expression represents a multiplication operation, the syntax tree of the expression may result in a loop structure (e.g., transformation (a+b) →x+1) +a x+b (x+1) may result in a x+1) and b (x+1) referencing root nodes of the same x+1 branch when the syntax tree has only one x+1 branch, and secondary referencing of x+1 results in a loop structure); after code replacement, the code segments of the expression grammar tree in the code segments are forcedly and automatically searched and deleted, after the code segments of the expression grammar tree in the code segments are searched and deleted, if the allowed annular structure flag bit of the function is true, the annular structure is not checked and expanded, if the allowed annular structure flag bit of the function is false, the annular structure check is carried out, in particular, the condition that whether a new replacement part of the grammar tree refers to the same grammar tree branch at least twice occurs is checked, if the condition exists, the annular structure is expanded, in particular, the code segments corresponding to the grammar tree branches with copy root nodes which are referred to at least twice are used, the code addresses of the copied grammar tree branches corresponding to the code segments are replaced by addresses which are not used and the addresses for storing intermediate variables generated during operation, so that the grammar tree branch copy code segments can be inserted into the code segments with the code replaced and positioned in the second-language of root nodes of the original grammar tree branches under the condition that the code segments do not conflict with the code segments corresponding to the primitive grammar tree branches, in the annular structure is repeatedly copied, and the annular structure is replaced by the code segments after the grammar tree branches are inserted into the annular tree branch copy nodes until the second-referenced code segments are replaced by the annular structure;
When the flag bit of the function return expression is false, the function return value is an operation value; only when all codes of which the types are 'expressions' and the executable flag bits are 'true' in the code segment corresponding to one expression are bound with the function of the return operation value, the code segment corresponding to the expression is executed, and the function of the return expression cannot be used for binding. Binding the code with the function refers to setting the bound function address of the code as the address of the function.
The weight value of the function is used for identifying the weight value of the function, and can be any real number.
In a preferred embodiment, the pre-execution module 3 is configured to pre-execute the primary code table to obtain a secondary code table;
wherein the secondary code table refers to a two-dimensional table taking an address as a key and taking a secondary code as a value;
the secondary code is expanded from a primary code and specifically comprises the primary code, a matching function address and a function root node flag bit;
the matching function address is used for recording the address of the function information of the function matched by the expression of the code in the row in a function table, and the address is valid if and only if the executable flag bit of the code is not 'no execution';
The function root node flag bit is used for identifying whether the node where the line of codes is located corresponds to the root node of the function declaration expression of the bound function, and is valid if and only if the matching function address is not null. And when the flag position is 'true', the root node of the function declaration expression corresponding to the bound function by the node of the line code is identified, and when the flag position is 'false', the child node or the cotyledon node of the function declaration expression corresponding to the bound function by the node of the line code is identified. The codes in the application refer to character codes in a character code table, primary codes in a primary code table and secondary codes in a secondary code table; the node where the code is located is the node of the basic expression represented by the quaternary expression of the code on the grammar tree corresponding to the expression where the code is located; the function declaration expression refers to an expression within a function declaration scope.
The pre-execution process of the pre-execution module 3 comprises the following steps:
step a: for codes with code executable flag bits being abandoned or not executed, directly skipping over the currently executed codes; the current execution code is the code in the pre-execution process; the disused code refers to code without any effect, and the non-executed code refers to code located inside the function declaration scope, can only be used as a function declaration, and cannot be executed;
Step b: for codes with code executable flag bits of 'executing under certain conditions', and when the current condition is not function call or conditional statement execution, directly skipping codes in the whole scope; the code executed under the certain condition is a function implementation scope starting and ending code of the scope and a scope starting and ending code of the scope of the conditional statement conditional body scope.
Step c: setting an execution process according to a code type flag bit when the code executable flag bit is a code executed under a certain condition and when the current condition is a function call or a conditional statement execution or when the code executable flag bit is a code executed directly; specifically, any one or more of the following sub-steps are performed:
c-1, skipping the current execution code when the code type flag bit is skip;
c-2, skipping the current execution code when the code type flag bit is the tag;
c-3, skipping the current execution code when the code type flag bit is the return operation;
c-4, skipping the current execution code when the code type flag bit is "function operation";
C-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing additional information of the activity record, and marking the created activity record as the current activity record;
the activity record is a record of activity of a scope, and is used for recording context information related to specific execution of codes in the scope and information generated in the execution process, and specifically includes: a data table and active area information;
the data table is a two-dimensional table, the key of the two-dimensional table is an identifier name, or an address where a parameter is located, or an activity record scope address, and the value of the two-dimensional table is a number, or a character string, or an activity record, or other supported data types.
The active area information specifically includes: a reference table of the shape parameter, an active record scope address, a pointer pointing to a father active record, a pointer pointing to a return active record, and a return address of a current active record;
the shape parameter reference table is a two-dimensional table taking a shape parameter identifier as a key and an actual parameter identifier or an actual parameter address as a value, and the table is created if and only if the activity record is created because of a function call;
The action domain address of the activity record is the address of the action domain corresponding to the activity record;
the father activity record in the pointer pointing to the father activity record is an activity record of which the data table value field directly contains the activity record;
the return activity record in the pointer pointing to the return activity record refers to the activity record which should be set as the current activity record after leaving from the current activity record, and the return activity record of one activity record defaults to its parent activity record; if an activity record is created because of a function call, its return activity record should be the activity record that records the action of this function call, so the return activity record needs to be accessed for query when the actual parameters are queried;
the return address of the current active record refers to the address of the code which should be marked as the current executing code after returning from the current active record, defaults to the next line of code of the current executing code, and if the current active record is created by the function call, the return address should be the next line of code of the function call code.
C-6, destroying and leaving the current active record when the code type flag bit is 'domain end', and marking the return active record as the current active record;
C-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
substep c-8, when the "code type flag bit" is satisfied as an "expression", specifically executing any one or more of the following substeps:
sub-step c-8-1, when the currently executing code has been bound to the function, i.e. the matching function address is not empty,
if the flag bit of the function root node is false, skipping the current execution code;
if the flag bit of the function root node is true, calling the bound function; the grammar tree taking the current execution code as a root node is compared with the grammar tree corresponding to the function statement expression of the bound function, a shape parameter reference table is generated, the initial code of the function realization scope of the bound function of the current execution code is set as the current execution code, and the current execution code is executed under the function call condition.
Sub-step c-8-2, when the current execution code is not bound with the function, i.e. the matching function address is empty, performing code replacement and function binding on the current execution code; specifically, copying the longest expression corresponding code segment of the current execution code, and adding a key value pair taking an initial accumulated weight value (namely 0) as a key and the copied code segment as a value to the current code bin; the code bin is a two-dimensional table taking accumulated weight values as keys and code segments as values; the key value pairs in the code bin are arranged from front to back from small to large according to the magnitude of the accumulated weight value; the maximum number of storable key value pairs of the code bin is set by a user, when a new key value pair is attempted to be added to a full code bin, if the accumulated weight value of the key value pair is larger than the minimum value of the accumulated weight values in all keys of the code bin, the code bin firstly deletes the head key value pair and then adds the new key value pair, and if the accumulated weight value of the key value pair is smaller than or equal to the minimum value of the accumulated weight values in all keys, the code bin does not perform any processing on the added key value pair and does not add the new key value pair. The accumulated weight value is the accumulated weight value of the function, and when the code segment is subjected to code replacement through the function of the return expression or is bound with the function of the return operation value, the weight values of the functions are accumulated to be used as the accumulated weight value of the code segment after transformation; the initial accumulated weight value of the code segment which is not replaced by any code and is not bound with any function is zero;
When the current code bin is not empty, popping up the code segments to be matched and the accumulated weight values thereof from the tail end of the code bin, and matching all local code segments corresponding to the branches of the grammar tree meeting the condition that any node is not bound with the function in the code segments with all accessible functions;
the matching of the local code segment with the function means that the local code segment is matched with the code segment corresponding to the function declaration expression of the function, that is, the grammar tree corresponding to the local code segment is matched with the grammar tree corresponding to the function declaration expression of the function.
Further, when the partial code segment is successfully matched with the function and the matched function is a function of a return expression, copying the code segment to be matched, replacing the partial code segment matched with the function declaration expression in the copied code segment with the code segment corresponding to the expression returned by the function subjected to parameter replacement, adding the accumulated weight value of the code segment to be matched with the weight value of the bound function to obtain the accumulated weight value of the copied code segment, and adding a key value pair consisting of the accumulated weight value of the copied code segment and the copied code segment to a waiting code bin;
when the local code segment is successfully matched with the function and the matched function is a function returning an operation result, copying the code segment to be matched, binding each row of codes in the local code segment matched with the function in the copied code segment with the matched function, and setting the function root node mark position of the root node code of the local code segment as true; at this time, checking whether all codes in the copied code segment are bound with the function, if all codes are bound with the function, finishing the matching process, replacing the corresponding code segment of the longest expression of the current execution code in the code table by the copied code segment, ensuring that the arrangement sequence of each row of codes in the copied code segment is unchanged, ensuring that the multi-level address range corresponding to the codes is between the corresponding address of the last row of codes and the corresponding address of the next row of codes of the replaced part in the code table, marking the first row of codes of the replaced part in the code table as the current execution code after the replacement is finished, and executing the code;
If the codes in the copied code segment are not bound with the functions, adding the accumulated weight value of the code segment to be matched with the weight value of the bound functions to obtain the accumulated weight value of the copied code segment, and adding a key value pair consisting of the weight value of the copied code segment and the copied code segment to a waiting code bin.
When the current code bin is empty, marking the current code bin as a waiting code bin, marking the original waiting code bin as the current code bin, and re-executing the operation when the current code bin is not empty;
in the substep c-9, when the "code type flag bit" is "expression end", it is known that the longest expression in which the code of the last line of the currently executed code is located has ended, and the currently executed code is skipped.
In the application, the pre-execution process does not solve specific values, so that actual numerical operation and logic operation are not performed in the pre-execution process, but variables are still required to be created according to sentences to ensure that the parameter environment is correct.
During the pre-execution, each branch of the branch statement and the loop body of the loop structure should be executed once, so that no jump is performed during the pre-execution.
According to the application, the pre-execution module 3 can deduce the solving process of the problem to be solved, and replace the codes corresponding to the problem constraint of the original problem to be solved with the codes corresponding to the deduced solving process; after the pre-execution processing of the pre-execution module 3, the code of the problem constraint in the primary code table is replaced by the solving process code, the primary code table is the secondary code table, and then the execution module 4 executes the secondary code table to obtain the solution of the problem.
In a preferred embodiment, the execution module 4 is configured to execute the codes in the secondary code table from the starting position of the secondary code table, and finally obtain a solution of the problem;
specifically, the execution process of the execution module 4 includes the following steps:
step one, for the code of which the code executable flag bit is abandoned or not executed, directly skipping the code;
step two, for the code of which the code executable zone bit is executed under a certain condition, and when the current condition is not a function call or the current condition is not a conditional statement execution, directly skipping the code in the whole scope;
step C, for the code with the code executable flag bit being "executed under a certain condition", and when the current condition is function call or conditional statement execution, or for the code with the code executable flag bit being "directly executed", specifically executing any one or more of the following sub-steps:
step C-1, when the code type flag bit is 'jump', setting the current execution code as the code of the next row of codes of the code where the jumped tag is located if the jump condition is true, otherwise, directly skipping the current execution code;
Sub-step C-2, when the code type flag bit is the tag, skipping the current execution code;
sub-step C-3, when the code type flag bit is return operation, ending executing the function and returning to the function calling position; specifically, the returned operation value is assigned to an actual return parameter corresponding to a return parameter in the form of the 'shape parameter reference table', and if the actual return parameter does not exist, the value is not assigned;
marking the current activity record as an activity record to be destroyed, marking a return address corresponding code of the current activity record as a current execution code, marking the return activity record of the current activity record as the current activity record, recursively destroying the activity record to be destroyed, and executing the current execution code; the specific processing procedure of the recursion destroying activity records is that if a father record of the record to be destroyed is not the same activity record as the current activity record, the father activity record of the record to be destroyed is also marked as the record of the activity to be destroyed, recursion is performed in turn, and finally all the records of the activity to be destroyed are destroyed together.
Sub-step C-4, skipping the current execution code when the code type flag bit is "function operation";
Sub-step C-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing activity record information, and setting the created activity record as the current activity record;
step C-6, when the code type flag bit is 'domain end', marking the current activity record as an activity record to be destroyed, if the returned activity record does not exist, destroying the current activity record, and ending the program execution; otherwise, marking the return address corresponding code of the current activity record as a current execution code, marking the return activity record of the current activity record as the current activity record, recursively destroying the activity record to be destroyed, and executing the current execution code;
sub-step C-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
sub-step C-8, when the code type flag bit is the expression, skipping the current execution code if the function root node flag bit is false; if the flag bit of the function root node is true, calling the bound function;
And a sub-step C-9, when the code type flag bit is 'expression end', indicating that the expression of the last line of codes of the current execution code is ended, and skipping the current execution code.
The application also provides a compiling method of the programming language, which is realized based on a compiling system of the programming language, and concretely comprises the following steps:
s1, receiving a source code through an interaction module 1;
the source code refers to a code input by a user through an input port, and comprises a rule code disclosed by the application, and the rule code specifically refers to a problem constraint of a problem to be solved and a transformation rule used for solving the problem.
S2, preprocessing the source code through the compiling module 2 to obtain a primary code table;
firstly, preprocessing a source code through a preprocessing sub-module and generating a precompiled code; specifically comprises the following steps:
step 1, deleting source code annotation;
step 2, deleting the blank space and the line feed symbol in the source code;
step 3, merging source codes in a plurality of files;
step 4, sentence replacement;
step 5, deleting the invalid source codes;
step 6, replacing the non-ASCII code appearing in the source code identifier with an ASCII code character string;
Step 7, deforming the function statement and the call statement which are formed by the character strings and the parameters in the source code;
and compiling the pre-compiled code through a compiling sub-module to generate a character code with character code type flag bits, character code quaternion and character code quaternion parameter type flag bit arrays:
and finally, converting the character codes in the character code table into primary codes through a conversion sub-module, and generating a scope table, an attribute table and a function table.
S3, pre-executing the primary code table through a pre-executing module 3 to obtain a secondary code table;
wherein, the execution process comprises the following steps:
step a: for codes with code executable flag bits being abandoned or not executed, directly skipping over the currently executed codes;
step b: for codes with code executable flag bits of 'executing under certain conditions', and when the current condition is not function call or conditional statement execution, directly skipping codes in the whole scope;
step c: setting an execution process according to a code type flag bit when the code executable flag bit is a code executed under a certain condition and when the current condition is a function call or a conditional statement execution or when the code executable flag bit is a code executed directly; specifically, any one or more of the following sub-steps are performed:
C-1, skipping the current execution code when the code type flag bit is skip;
c-2, skipping the current execution code when the code type flag bit is the tag;
c-3, skipping the current execution code when the code type flag bit is the return operation;
c-4, skipping the current execution code when the code type flag bit is "function operation";
c-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing additional information of the activity record, and marking the created activity record as the current activity record;
c-6, destroying and leaving the current active record when the code type flag bit is 'domain end', and marking the return active record as the current active record;
c-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
substep c-8, when the "code type flag bit" is satisfied as an "expression", specifically executing any one or more of the following substeps:
Sub-step c-8-1, when the currently executing code has been bound to the function, i.e. the matching function address is not empty,
if the flag bit of the function root node is false, skipping the current execution code;
if the flag bit of the function root node is true, calling the bound function;
sub-step c-8-2, when the current execution code is not bound with the function, i.e. the matching function address is empty, performing code replacement and function binding on the current execution code;
when the current code bin is not empty, popping up a code segment and an accumulated weight value thereof from the tail end of the code bin, and matching all local code segments corresponding to grammar tree branches meeting the condition that any node is not bound with the function in the code segment with all accessible functions;
when the local code segment is successfully matched with the function and the matched function is a function of a return expression, copying the code segment to be matched, replacing the local code segment matched with the function declaration expression in the copied code segment with the code segment corresponding to the expression returned by the function subjected to parameter replacement, adding the accumulated weight value of the code segment to be matched with the weight value of the function matched with the local code segment to obtain the accumulated weight value of the copied code segment, and adding a key value pair consisting of the accumulated weight value of the copied code segment and the copied code segment to a waiting code bin;
When the local code segment is successfully matched with the function and the bound function is a function returning an operation result, copying the code segment to be matched, binding each row of codes in the local code segment matched with the function in the copied code segment with the matched function, and setting the root node mark position of the root node code of the local code segment as true;
checking whether all codes in the copied code segment are bound with the function, if all codes are bound with the function, finishing the matching process, replacing the corresponding code segment of the longest expression of the current execution code in the code table by the copied code segment, marking the first row of codes of the replacement part in the code table as the current execution code after the replacement is finished, and executing the code;
if the code segments in the copied code segments are not bound with the functions, adding the accumulated weight value of the code segments to be matched with the weight value of the bound functions to obtain the accumulated weight value of the copied code segments, and adding a key value pair consisting of the weight value of the copied code segments and the copied code segments to a waiting code bin; .
When the current code bin is empty, marking the current code bin as a waiting code bin, marking the original waiting code bin as the current code bin, and re-executing the operation when the current code bin is not empty;
In the substep c-9, when the "code type flag bit" is "expression end", it is known that the longest expression in which the code of the last line of the currently executed code is located has ended, and the currently executed code is skipped.
S4, executing the secondary code table through the execution module 4 to obtain a solution of the problem.
The execution process of the execution module 4 comprises the following steps:
step one, for the code of which the code executable flag bit is abandoned or not executed, directly skipping the code;
step two, for the code of which the code executable zone bit is executed under a certain condition, and when the current condition is not function call or conditional statement execution, directly skipping the code in the whole scope;
step C, for the code with the code executable flag bit being "executed under a certain condition", and when the current condition is function call or conditional statement execution, or for the code with the code executable flag bit being "directly executed", specifically executing any one or more of the following sub-steps:
step C-1, when the code type flag bit is 'jump', setting the current execution code as the code of the next row of codes of the code where the jumped tag is located if the jump condition is true, otherwise, directly skipping the current execution code;
Sub-step C-2, when the code type flag bit is the tag, skipping the current execution code;
sub-step C-3, when the code type flag bit is return operation, ending executing the function and returning to the function calling position;
sub-step C-4, skipping the current execution code when the code type flag bit is "function operation";
sub-step C-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing activity record information, and setting the created activity record as the current activity record;
step C-6, when the code type flag bit is 'domain end', marking the current activity record as an activity record to be destroyed, if the returned activity record does not exist, destroying the current activity record, and ending the program execution; otherwise, marking the return address corresponding code of the current activity record as a current execution code, marking the return activity record of the current activity record as the current activity record, recursively destroying the activity record, and executing the current execution code;
sub-step C-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
Sub-step C-8, when the code type flag bit is the expression, skipping the current execution code if the function root node flag bit is false; if the flag bit of the function root node is true, calling the bound function; the skipping of the current execution code refers to setting the current execution code as the next line of codes of the current execution code and executing the current execution code.
And a sub-step C-9, when the code type flag bit is 'expression end', indicating that the expression of the last line of codes of the current execution code is ended, and skipping the current execution code.
Examples
Editing a source code to solve a value of x meeting a condition of 1 x x+2 x+ (pi-3) x= 100, wherein rules used in the solving process have multiplication combination law and multiplication division conversion, and in the solving process, the source code received by an interaction module of the programming language compiling system is as follows:
/>
in this source code, a parameter pi is created, whose value is 3.14."new" means that a new parameter is created, ":" is an attribute operator, indicating that the attribute "new" is assigned to pi.
Defining multiplication combination law a+b.c→ (a+b) c;
where @ (30) { a c+b c } indicates that this is a function for matching the expression satisfying the format a c+b c, "@" indicates that this is a function statement. "(30)" means that the weight of this function is 30.
re represents the function return; "$" indicates that the modified parameter b may be modified in value after the function is performed, or it may be understood that the expression a$b= c is b as the unknown to be solved.
x— >0 represents outputting parameter x in a default manner.
The source program is compiled in the compiling system of the programming language through the following processes:
receiving the source code through an interaction module;
preprocessing a source code through a compiling module to obtain a primary code table; the source code is preprocessed through the preprocessing sub-module, and a precompiled code is generated;
wherein, in the preprocessing process, the preprocessing submodule executes any one or more of the following steps:
step 1, deleting source code annotation;
step 2, deleting the blank space and the line feed symbol in the source code;
compiling the pre-compiled code through a compiling sub-module to generate a character code; converting the character code into a primary code through a conversion sub-module, and generating a scope table, an attribute table and a function table;
pre-executing the primary code table through a pre-executing module to obtain a secondary code table; the method comprises the following steps:
step a: for codes with code executable flag bits being abandoned or not executed, directly skipping over the currently executed codes; the current execution code is the code in the pre-execution process;
Step b: for codes with code executable flag bits of 'executing under certain conditions', and when the current condition is not a function call or the current condition is not a conditional statement execution, directly skipping codes in the whole scope;
step c: for codes with code executable flag bits of 'executing under certain conditions', and when the current condition is function call or conditional statement execution, or for codes with code executable flag bits of 'directly executing', setting an executing process according to the code type flag bits, executing any one or more sub-steps of the following sub-steps:
c-1, skipping the current execution code when the code type flag bit is skip;
c-2, skipping the current execution code when the code type flag bit is the tag;
c-3, skipping the current execution code when the code type flag bit is the return operation;
c-4, skipping the current execution code when the code type flag bit is "function operation";
c-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing additional information of the activity record, and marking the created activity record as the current activity record;
C-6, destroying and leaving the current active record when the code type flag bit is 'domain end', and marking the return active record as the current active record;
c-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
preferably, the method further comprises a substep c-8, namely, when the "code type flag bit" is "expression", any one or more of the following substeps are specifically executed:
sub-step c-8-1, when the currently executing code has been bound to the function, i.e. the matching function address is not empty,
if the flag bit of the function root node is false, skipping the current execution code;
if the flag bit of the function root node is true, calling the bound function; comparing the grammar tree taking the current execution code as a root node with the grammar tree corresponding to the function statement expression of the bound function to generate a shape parameter reference table, setting the current execution code as a function realization scope starting code of the bound function, and executing the function realization scope starting code under a function call condition;
sub-step c-8-2, when the current execution code is not bound with the function, i.e. the matching function address is empty, performing code replacement and function binding on the current execution code; copying the code segment corresponding to the longest expression where the current execution code is located, adding a key value pair taking an initial accumulated weight value 0 as a key and copying the code segment as a value to a current code bin, wherein the code bin is a two-dimensional table taking the accumulated weight value as a key and taking the code segment as a value, each key value pair in the code bin is arranged from front to back according to the accumulated weight value from small to large, the maximum number of storable key value pairs in the code bin is set by a user, when trying to add a new key value pair to a full code bin, if the accumulated weight value in the key value pair is larger than the minimum value of accumulated weight values in all keys in the code bin, the code bin firstly deletes the head key value pair and then adds the new key value pair, and if the accumulated weight value in the key value pair is smaller than or equal to the minimum value of accumulated weight values in all keys, the code bin does not perform any treatment on the added key value pair and does not add the new key value pair;
When the current code bin is not empty, popping up code segments and accumulated weight values thereof from the tail end of the code bin, and matching all local code segments corresponding to grammar tree branches meeting the condition that any node is not bound with the function in the code segments with all accessible functions;
when the local code segment is successfully matched with the function and the matched function is a function of a return expression, copying the code segment to be matched, replacing the local code segment matched with the function declaration expression in the copied code segment with the code segment corresponding to the expression returned by the function subjected to parameter replacement, adding the accumulated weight value of the code segment to be matched with the weight value of the function matched with the local code segment to obtain the accumulated weight value of the copied code segment, and adding a key value pair consisting of the accumulated weight value of the copied code segment and the copied code segment to a waiting code bin;
when the local code segment is successfully matched with the function and the bound function is a function returning an operation result, copying the code segment to be matched, binding each row of codes in the local code segment matched with the function in the copied code segment with the matched function, and setting the root node mark position of the root node code of the local code segment as true; at the moment, checking whether all codes in the copied code segment are bound with the function, if all codes are bound with the function, finishing the matching process, replacing the corresponding code segment of the longest expression of the current execution code in the code table by the copied code segment, marking the first row of codes of the replacement part in the code table as the current execution code after the replacement is finished, and executing the code;
If the code segments which are not bound with the function exist in the copied code segments, adding the accumulated weight value of the code segments to be matched with the weight value of the bound function to obtain the accumulated weight value of the copied code segments, and adding a key value pair consisting of the weight value of the copied code segments and the copied code segments to a waiting code bin;
when the current code bin is empty, marking the current code bin as a waiting code bin, marking the original waiting code bin as the current code bin, and re-executing the operation when the current code bin is not empty;
preferably, substep c-9 is also included, namely skipping the currently executing code when the "code type flag bit" is "end of expression".
Executing the secondary code table through an execution module to obtain a solution of the problem; the method comprises the following steps:
step one, for the code of which the code executable flag bit is abandoned or not executed, directly skipping the code;
step two, for the code of which the code executable zone bit is executed under a certain condition, and when the current condition is not function call or conditional statement execution, directly skipping the code in the whole scope;
step C, for the code with the code executable flag bit being "executed under a certain condition", and when the current condition is function call or conditional statement execution, or for the code with the code executable flag bit being "directly executed", specifically executing any one or more of the following sub-steps:
Step C-1, when the code type flag bit is 'jump', setting the current execution code as the code of the next row of codes of the code where the jumped tag is located if the jump condition is true, otherwise, directly skipping the current execution code;
sub-step C-2, when the code type flag bit is the tag, skipping the current execution code;
sub-step C-3, when the code type flag bit is return operation, ending executing the function and returning to the function calling position; specifically, the returned operation value is assigned to an actual return parameter corresponding to a return parameter in the form of the 'shape parameter reference table', and if the actual return parameter does not exist, the value is not assigned;
marking the current activity record as an activity record to be destroyed, marking a return address corresponding code of the current activity record as a current execution code, marking the return activity record of the current activity record as the current activity record, recursively destroying the activity record to be destroyed, and executing the current execution code;
sub-step C-4, skipping the current execution code when the code type flag bit is "function operation";
sub-step C-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing activity record information, and setting the created activity record as the current activity record;
Step C-6, when the code type flag bit is 'domain end', marking the current activity record as an activity record to be destroyed, if the returned activity record does not exist, destroying the current activity record, and ending the program execution; otherwise, marking the return address corresponding code of the current activity record as a current execution code, marking the return activity record of the current activity record as the current activity record, recursively destroying the activity record, and executing the current execution code;
sub-step C-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
sub-step C-8, when the code type flag bit is the expression, skipping the current execution code if the function root node flag bit is false; if the flag bit of the function root node is true, calling the bound function;
and a sub-step C-9, when the code type flag bit is 'expression end', indicating that the expression of the last line of codes of the current execution code is ended, and skipping the current execution code.
The output result finally obtained is:
debug output:
Data:[dataFlagBit:1addrFlagBit:0content_i:31.8471
content_s:content_a:]
from the result, the value of x is 31.8471, and the value obtained by the calculation is accurate.
According to the embodiment, the compiling system of the programming language can obtain an accurate solution of the problem under the condition that the input source program only contains the problem constraint of the problem to be solved and the transformation rule used for solving the problem, and can further reduce the occurrence rate of errors in the programming process on the basis of reducing the workload of a user.
The invention has been described above in connection with preferred embodiments, which are, however, exemplary only and for illustrative purposes. On this basis, the invention can be subjected to various substitutions and improvements, and all fall within the protection scope of the invention.

Claims (10)

1. A compilation system for a programming language, the system comprising:
-an interaction module (1) for receiving source code;
the compiling module (2) is used for preprocessing and compiling the source code to obtain a primary code table;
a pre-execution module (3) for pre-executing the primary code table to obtain a secondary code table;
an execution module (4) for executing the secondary code table to obtain a solution to the problem;
the pre-execution process of the pre-execution module (3) comprises the following steps:
step a: for codes with code executable flag bits being abandoned or not executed, directly skipping over the currently executed codes; the current execution code is the code in the pre-execution process;
Step b: for codes with code executable flag bits of 'executing under certain conditions', and when the current condition is not a function call or the current condition is not a conditional statement execution, directly skipping codes in the whole scope;
step c: for codes with code executable flag bits of 'executing under certain conditions', and when the current condition is function call or conditional statement execution, or for codes with code executable flag bits of 'directly executing', setting an executing process according to the code type flag bits, and specifically executing any one or more sub-steps:
the substep comprises substeps c-8, namely, when the "code type flag bit" is satisfied as an "expression", any one or more of the following substeps are specifically executed:
sub-step c-8-1, when the currently executing code has been bound to the function, i.e. the matching function address of the currently executing code is not null,
if the flag bit of the function root node is false, skipping the current execution code;
if the flag bit of the function root node is true, calling the bound function; comparing the grammar tree taking the current execution code as a root node with the grammar tree corresponding to the function statement expression of the bound function to generate a shape parameter reference table, setting the current execution code as a function realization scope starting code of the bound function, and executing the function realization scope starting code under a function call condition;
Sub-step c-8-2, when the current execution code is not bound with the function, i.e. the matching function address is empty, performing code replacement and function binding on the current execution code; copying the code segment corresponding to the longest expression where the current execution code is located, adding a key value pair taking an initial accumulated weight value 0 as a key and copying the code segment as a value to a current code bin, wherein the code bin is a two-dimensional table taking the accumulated weight value as a key and taking the code segment as a value, each key value pair in the code bin is arranged from front to back according to the accumulated weight value from small to large, the maximum number of storable key value pairs in the code bin is set by a user, when trying to add a new key value pair to a full code bin, if the accumulated weight value in the key value pair is larger than the minimum value of accumulated weight values in all keys in the code bin, the code bin firstly deletes the head key value pair and then adds the new key value pair, and if the accumulated weight value in the key value pair is smaller than or equal to the minimum value of accumulated weight values in all keys, the code bin does not perform any treatment on the added key value pair and does not add the new key value pair;
when the current code bin is not empty, popping up code segments and accumulated weight values thereof from the tail end of the code bin, and matching all local code segments corresponding to grammar tree branches meeting the condition that any node is not bound with the function in the code segments with all accessible functions;
When the local code segment is successfully matched with the function and the matched function is a function of a return expression, copying the code segment to be matched, replacing the local code segment matched with the function declaration expression in the copied code segment with the code segment corresponding to the expression returned by the function subjected to parameter replacement, adding the accumulated weight value of the code segment to be matched with the weight value of the function matched with the local code segment to obtain the accumulated weight value of the copied code segment, and adding a key value pair consisting of the accumulated weight value of the copied code segment and the copied code segment to a waiting code bin;
when the local code segment is successfully matched with the function and the bound function is a function returning an operation result, copying the code segment to be matched, binding each row of codes in the local code segment matched with the function in the copied code segment with the matched function, and setting the root node mark position of the root node code of the local code segment as true; at the moment, checking whether all codes in the copied code segment are bound with the function, if all codes are bound with the function, finishing the matching process, replacing the corresponding code segment of the longest expression of the current execution code in the code table by the copied code segment, marking the first row of codes of the replacement part in the code table as the current execution code after the replacement is finished, and executing the code;
If the code segments which are not bound with the function exist in the copied code segments, adding the accumulated weight value of the code segments to be matched with the weight value of the bound function to obtain the accumulated weight value of the copied code segments, and adding a key value pair consisting of the weight value of the copied code segments and the copied code segments to a waiting code bin;
when the current code bin is empty, marking the current code bin as a waiting code bin, marking the original waiting code bin as the current code bin, and re-executing the operation when the current code bin is not empty.
2. A compiling system for a programming language according to claim 1, wherein,
the source code includes problem constraints for the problem to be solved and transformation rules used to solve the problem.
3. A compiling system for a programming language according to claim 1, wherein,
the compiling module (2) comprises a preprocessing sub-module, a compiling sub-module and a converting sub-module;
the preprocessing sub-module is used for preprocessing the source code and generating a precompiled code;
the compiling sub-module is used for compiling the pre-compiled codes, generating character codes and storing the character codes in a character code table;
the conversion sub-module is used for converting the character codes in the character code table into primary codes and generating a scope table, an attribute table and a function table.
4. A compiling system for a programming language according to claim 3, wherein,
during the preprocessing, the preprocessing sub-module performs any one or more of the following steps:
step 1, deleting source code annotation;
step 2, deleting the blank space and the line feed symbol in the source code;
step 3, merging source codes in a plurality of files;
step 4, sentence replacement;
step 5, deleting the invalid source codes;
step 6, replacing the non-ASCII code appearing in the source code identifier with an ASCII code character string;
and 7, deforming function statement and call statement which are composed of character strings and parameters in the source code.
5. A compiling system for a programming language according to claim 4, wherein,
in step 7, all function parameters which are not behind the function name character string are moved to the rear of the character string, and the sequence of the function parameters is kept unchanged; at the same time, the character string of the new function name is formed by replacing the specific character string at the original position of the function parameter.
6. A compiling system for a programming language according to claim 3, wherein,
and in the compiling submodule, generating character codes with character code type flag bits, character code quaternion and character code quaternion parameter type flag bit arrays through a lexical analysis algorithm and a grammar analysis algorithm.
7. A compiling system for a programming language according to claim 3, wherein,
the conversion sub-module reads the character codes line by line from the character code table, performs preliminary analysis on the character codes to generate primary codes, and stores the primary codes in the primary code table; parsing generates a scope table, an attribute table and a function table simultaneously.
8. A compiling system for a programming language according to claim 1, wherein,
in step c, any one or more of the following sub-steps may also be specifically performed:
c-1, skipping the current execution code when the code type flag bit is skip;
c-2, skipping the current execution code when the code type flag bit is the tag;
c-3, skipping the current execution code when the code type flag bit is the return operation;
c-4, skipping the current execution code when the code type flag bit is "function operation";
c-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing additional information of the activity record, and marking the created activity record as the current activity record;
C-6, destroying and leaving the current active record when the code type flag bit is 'domain end', and marking the return active record as the current active record;
c-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
substep c-9, i.e. skipping the currently executing code when the "code type flag bit" is "end of expression".
9. A compiling system for a programming language according to claim 1, wherein,
the execution process of the execution module (4) comprises the following steps:
step one, for the code of which the code executable flag bit is abandoned or not executed, directly skipping the code;
step two, for the code of which the code executable zone bit is executed under a certain condition, and when the current condition is not function call or conditional statement execution, directly skipping the code in the whole scope;
step C, for the code with the code executable flag bit being "executed under a certain condition", and when the current condition is function call or conditional statement execution, or for the code with the code executable flag bit being "directly executed", specifically executing any one or more of the following sub-steps:
Step C-1, when the code type flag bit is 'jump', setting the current execution code as the code of the next row of codes of the code where the jumped tag is located if the jump condition is true, otherwise, directly skipping the current execution code;
sub-step C-2, when the code type flag bit is the tag, skipping the current execution code;
sub-step C-3, when the code type flag bit is return operation, ending executing the function and returning to the function calling position; specifically, the returned operation value is assigned to an actual return parameter corresponding to a return parameter in the form of the 'shape parameter reference table', and if the actual return parameter does not exist, the value is not assigned;
marking the current activity record as an activity record to be destroyed, marking a return address corresponding code of the current activity record as a current execution code, marking the return activity record of the current activity record as the current activity record, recursively destroying the activity record to be destroyed, and executing the current execution code;
sub-step C-4, skipping the current execution code when the code type flag bit is "function operation";
sub-step C-5, when the code type flag bit is 'domain start', creating an empty activity record for the scope starting from the currently executed code in the current activity record and initializing activity record information, and setting the created activity record as the current activity record;
Step C-6, when the code type flag bit is 'domain end', marking the current activity record as an activity record to be destroyed, if the returned activity record does not exist, destroying the current activity record, and ending the program execution; otherwise, marking the return address corresponding code of the current activity record as a current execution code, marking the return activity record of the current activity record as the current activity record, recursively destroying the activity record, and executing the current execution code;
sub-step C-7, when the code type flag bit is variable declaration, adding a key value pair taking a parameter identifier as a key and taking a parameter default value as a value into a data table of the current active record;
sub-step C-8, when the code type flag bit is the expression, skipping the current execution code if the function root node flag bit is false; if the flag bit of the function root node is true, calling the bound function;
and a sub-step C-9, when the code type flag bit is 'expression end', indicating that the expression of the last line of codes of the current execution code is ended, and skipping the current execution code.
10. A compiling method of programming language is characterized in that,
The method comprises the following steps:
s1, receiving a source code through an interaction module (1);
s2, preprocessing and compiling the source code through a compiling module (2) to obtain a primary code table;
s3, pre-executing the primary code table through a pre-executing module (3) to obtain a secondary code table;
s4, executing a secondary code table through an execution module (4) to obtain a solution of the problem;
in S3, the pre-execution process of the pre-execution module (3) includes the following steps:
step a: for codes with code executable flag bits being abandoned or not executed, directly skipping over the currently executed codes; the current execution code is the code in the pre-execution process;
step b: for codes with code executable flag bits of 'executing under certain conditions', and when the current condition is not a function call or the current condition is not a conditional statement execution, directly skipping codes in the whole scope;
step c: for codes with code executable flag bits of 'executing under certain conditions', and when the current condition is function call or conditional statement execution, or for codes with code executable flag bits of 'directly executing', setting an executing process according to the code type flag bits, and specifically executing any one or more sub-steps:
The substep comprises substeps c-8, namely, when the "code type flag bit" is satisfied as an "expression", any one or more of the following substeps are specifically executed:
sub-step c-8-1, when the currently executing code has been bound to the function, i.e. the matching function address of the currently executing code is not null,
if the flag bit of the function root node is false, skipping the current execution code;
if the flag bit of the function root node is true, calling the bound function; comparing the grammar tree taking the current execution code as a root node with the grammar tree corresponding to the function statement expression of the bound function to generate a shape parameter reference table, setting the current execution code as a function realization scope starting code of the bound function, and executing the function realization scope starting code under a function call condition;
sub-step c-8-2, when the current execution code is not bound with the function, i.e. the matching function address is empty, performing code replacement and function binding on the current execution code; copying the code segment corresponding to the longest expression where the current execution code is located, adding a key value pair taking an initial accumulated weight value 0 as a key and copying the code segment as a value to a current code bin, wherein the code bin is a two-dimensional table taking the accumulated weight value as a key and taking the code segment as a value, each key value pair in the code bin is arranged from front to back according to the accumulated weight value from small to large, the maximum number of storable key value pairs in the code bin is set by a user, when trying to add a new key value pair to a full code bin, if the accumulated weight value in the key value pair is larger than the minimum value of accumulated weight values in all keys in the code bin, the code bin firstly deletes the head key value pair and then adds the new key value pair, and if the accumulated weight value in the key value pair is smaller than or equal to the minimum value of accumulated weight values in all keys, the code bin does not perform any treatment on the added key value pair and does not add the new key value pair;
When the current code bin is not empty, popping up code segments and accumulated weight values thereof from the tail end of the code bin, and matching all local code segments corresponding to grammar tree branches meeting the condition that any node is not bound with the function in the code segments with all accessible functions;
when the local code segment is successfully matched with the function and the matched function is a function of a return expression, copying the code segment to be matched, replacing the local code segment matched with the function declaration expression in the copied code segment with the code segment corresponding to the expression returned by the function subjected to parameter replacement, adding the accumulated weight value of the code segment to be matched with the weight value of the function matched with the local code segment to obtain the accumulated weight value of the copied code segment, and adding a key value pair consisting of the accumulated weight value of the copied code segment and the copied code segment to a waiting code bin;
when the local code segment is successfully matched with the function and the bound function is a function returning an operation result, copying the code segment to be matched, binding each row of codes in the local code segment matched with the function in the copied code segment with the matched function, and setting the root node mark position of the root node code of the local code segment as true; at the moment, checking whether all codes in the copied code segment are bound with the function, if all codes are bound with the function, finishing the matching process, replacing the corresponding code segment of the longest expression of the current execution code in the code table by the copied code segment, marking the first row of codes of the replacement part in the code table as the current execution code after the replacement is finished, and executing the code;
If the code segments which are not bound with the function exist in the copied code segments, adding the accumulated weight value of the code segments to be matched with the weight value of the bound function to obtain the accumulated weight value of the copied code segments, and adding a key value pair consisting of the weight value of the copied code segments and the copied code segments to a waiting code bin;
when the current code bin is empty, marking the current code bin as a waiting code bin, marking the original waiting code bin as the current code bin, and re-executing the operation when the current code bin is not empty.
CN202210232360.9A 2022-03-09 2022-03-09 Compiling system and method for programming language Active CN114675831B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210232360.9A CN114675831B (en) 2022-03-09 2022-03-09 Compiling system and method for programming language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210232360.9A CN114675831B (en) 2022-03-09 2022-03-09 Compiling system and method for programming language

Publications (2)

Publication Number Publication Date
CN114675831A CN114675831A (en) 2022-06-28
CN114675831B true CN114675831B (en) 2023-10-31

Family

ID=82073441

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210232360.9A Active CN114675831B (en) 2022-03-09 2022-03-09 Compiling system and method for programming language

Country Status (1)

Country Link
CN (1) CN114675831B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5835771A (en) * 1995-06-07 1998-11-10 Rogue Wave Software, Inc. Method and apparatus for generating inline code using template metaprograms
US6212672B1 (en) * 1997-03-07 2001-04-03 Dynamics Research Corporation Software development system with an executable working model in an interpretable intermediate modeling language
US6529865B1 (en) * 1999-10-18 2003-03-04 Sony Corporation System and method to compile instructions to manipulate linguistic structures into separate functions
CN102779044A (en) * 2012-06-28 2012-11-14 用友软件股份有限公司 Analysis processing system and analysis processing method of expression
CN104281096A (en) * 2013-07-08 2015-01-14 广州中国科学院先进技术研究所 Construction method of numerical-control code compiler
CN104391730A (en) * 2014-08-03 2015-03-04 浙江网新恒天软件有限公司 Software source code language translation system and method
CN108509772A (en) * 2018-02-12 2018-09-07 北京梆梆安全科技有限公司 Source code reinforcement means and device based on execution sequence and single-point logic
CN110428054A (en) * 2019-08-07 2019-11-08 浪潮云信息技术有限公司 Business Rule Engine pattern matching system and implementation method based on technique of compiling
CN110597501A (en) * 2019-08-09 2019-12-20 苏宁金融科技(南京)有限公司 Natural language programming method and device based on strong static scripting language
CN113608746A (en) * 2021-08-16 2021-11-05 北京字节跳动网络技术有限公司 Code conversion processing method and device, computer equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8813047B2 (en) * 2005-09-08 2014-08-19 Alcatel Lucent Yet another transformation language (YATL)
US8171453B2 (en) * 2007-05-21 2012-05-01 Microsoft Corporation Explicit delimitation of semantic scope
US8250544B2 (en) * 2008-03-05 2012-08-21 Microsoft Corporation Annotating exception information in a computer program
US20120072886A1 (en) * 2010-09-16 2012-03-22 Starview Technology, Inc. Domain specific language creation
US8843907B2 (en) * 2011-08-25 2014-09-23 Myezapp Inc. Compiler with error handling
US20140306964A1 (en) * 2013-04-12 2014-10-16 Microsoft Corporation Incremental compiling of a declarative program

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5835771A (en) * 1995-06-07 1998-11-10 Rogue Wave Software, Inc. Method and apparatus for generating inline code using template metaprograms
US6212672B1 (en) * 1997-03-07 2001-04-03 Dynamics Research Corporation Software development system with an executable working model in an interpretable intermediate modeling language
US6529865B1 (en) * 1999-10-18 2003-03-04 Sony Corporation System and method to compile instructions to manipulate linguistic structures into separate functions
CN102779044A (en) * 2012-06-28 2012-11-14 用友软件股份有限公司 Analysis processing system and analysis processing method of expression
CN104281096A (en) * 2013-07-08 2015-01-14 广州中国科学院先进技术研究所 Construction method of numerical-control code compiler
CN104391730A (en) * 2014-08-03 2015-03-04 浙江网新恒天软件有限公司 Software source code language translation system and method
CN108509772A (en) * 2018-02-12 2018-09-07 北京梆梆安全科技有限公司 Source code reinforcement means and device based on execution sequence and single-point logic
CN110428054A (en) * 2019-08-07 2019-11-08 浪潮云信息技术有限公司 Business Rule Engine pattern matching system and implementation method based on technique of compiling
CN110597501A (en) * 2019-08-09 2019-12-20 苏宁金融科技(南京)有限公司 Natural language programming method and device based on strong static scripting language
CN113608746A (en) * 2021-08-16 2021-11-05 北京字节跳动网络技术有限公司 Code conversion processing method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
可逆编程语言R-JAVA及其语言处理系统的设计;朱鹏程;管致锦;卫丽华;;计算机工程与设计(10);全文 *
约束程序设计语言COPS的设计与实现;廖乐健, 董国增;计算机工程(第08期);14-15 *

Also Published As

Publication number Publication date
CN114675831A (en) 2022-06-28

Similar Documents

Publication Publication Date Title
CN104662513B (en) The automatic method and its system for improving the parallel processing in program compiling
US7962904B2 (en) Dynamic parser
TW308676B (en) Incremental compilation of C++ programs
US5142681A (en) APL-to-Fortran translators
US7571427B2 (en) Methods for comparing versions of a program
US5367683A (en) Smart recompilation of performing matchup/difference after code generation
WO1996013784A2 (en) Method and apparatus for tree data structure manipulation and translating source code from one high-level computer language to another
WO1996013784A9 (en) Method and apparatus for tree data structure manipulation and translating source code from one high-level computer language to another
JP2001166949A (en) Method and device for compiling source code by using symbolic execution
Blomer et al. The GrGen .NET user manual
US5625822A (en) Using sorting to do matchup in smart recompilation
Lano et al. Agile specification of code generators for model-driven engineering
Schröer The GENTLE Compiler Construction System
US5446899A (en) Hint generation in smart recompilation
Rosen A compiler-building system developed by Brooker and Morris: including a comprehensive discussion of the major features of the system
US8914782B2 (en) Optimization of declarative queries
CN114675831B (en) Compiling system and method for programming language
Koskimies et al. The design of a language processor generator
KR102614967B1 (en) Automation system and method for extracting intermediate representation based semantics of javascript
CN115935943A (en) Analysis framework supporting natural language structure calculation
CN115185526B (en) Compiling system and method for programming language capable of reverse reasoning
CN113811849A (en) System and method for computer-aided computer programming
Wang et al. Ompparser: A standalone and unified OpenMP parser
Maliavko et al. The functionally-imperative programming language El and its translator
WO2018182454A1 (en) Method for developing, storing, and using programs compiled in database tables in binary representation

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