CN1889043A - Method for using human natural language in computer programing - Google Patents
Method for using human natural language in computer programing Download PDFInfo
- Publication number
- CN1889043A CN1889043A CN 200610047249 CN200610047249A CN1889043A CN 1889043 A CN1889043 A CN 1889043A CN 200610047249 CN200610047249 CN 200610047249 CN 200610047249 A CN200610047249 A CN 200610047249A CN 1889043 A CN1889043 A CN 1889043A
- Authority
- CN
- China
- Prior art keywords
- statement
- class methods
- function
- natural
- source code
- 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.)
- Pending
Links
Images
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
The invention discloses a method to write the computer program by the human language. It includes the process of loading the programming software system into the computer, displaying the source code editing window and running it. Also it includes inputting the natural sentence, class methods sum or function statement and transferring the natural sentence, class methods sum or the function; scanning the source code to generate the sentence, the class methods sum or the function-statement summary sheet firstly; scanning the source code secondly to transform the sentence to the practically class methods or the function and editing the operating program. The user can transform the natural language into the high-level programming language according to the describing word and the parameter table of the statement sentence. It can use the signal or double byte of the English or Chinese word, the blank, the comma to describe.
Description
Technical field
The present invention relates to computer programming, relate in particular to the method that end user's natural language carries out program design in programming.
Background technology
In popular programming tool, major part is the higher level lanquage that can be compiled as machine language, but not the natural language that people use, as language such as VB, C, C++, PASCAL, JAVA, C#, its grammer progressively grows up like this from " machine language " → " assembly language " → " higher level lanquage ", with the natural language offshore company that programmes trial is arranged, but ends in failure eventually, trace it to its cause, nothing but 3 points: the one, from the resistance of the mindset of traditional programming language; The 2nd, because of nationality, language, culture, the different various conflicts that produce of tradition; The 3rd, technical realization is comparatively complicated and difficult.
In the high-level programming language of main flow, identifier (ID) all is restricted to " letter, numeral, underscore " usually, and this causes some " double byte literal " can not use as identifier as Chinese character; In addition, do not allow the regulation of space and punctuate in the identifier, greatly limit yet and hindered the application of natural language in program code, the particularly use of English programming.What use function or class methods were called in the high-level programming language generally is the form that adopts additional parameter table after function name or class methods title, often causes its word order and people's natural language far different again.Up to now, there are hundreds of nationalitys in the whole world, tens thousand of kinds of language, and the language that is widely used also has tens of kinds.Different nationalitys, different language, its different part is not only lip-deep form difference, also is from the cultural conflict on more profound.Therefore a comprehensive solution can't be proposed.Computerese should not be a kind of obstacle, and should be a kind of bridge as the channel of linking up between people and the computing machine.Modern programming is along with engineering becomes increasingly complex, and code line is more and more, and the implication of understanding code becomes a bigger cost expenditure of exploitation and maintenance software already, and separating reader has become current problem demanding prompt solution.
The outlet that addresses the above problem is, all people's natural languages are used as one on the whole, though every kind of language all has oneself grammer and tense, is relatively-stationary with respect to the grammer and the tense of certain concrete native language.On this basis, re-use in the programming after allowing the user define oneself natural language form voluntarily, parameter tags relevant in the natural language are come out, allow programmed environment remove to handle automatically these parameter lists, or directly be converted to the form of traditional higher level lanquage, just can ideally realize carrying out the target of program design, thereby make program code be easier to read, understand and safeguard, convenient programming user's use with natural language.
Summary of the invention
Proposition of the present invention is intended to introduce the expression way of similar people's natural language in the source code rule of computer programming language, designs a kind of program source code that makes and programming is waited the method for using natural language in the friendly more computer programming.
Technical solution of the present invention is achieved in that
The method of end user's natural language in a kind of computer programming is included in step, the demonstration source code editor of the programming software system of packing on the known computer and the step of moving, and it is characterized in that also comprising:
Input nature statement, class methods and/or function declaration item and call the step of nature statement, class methods and/or function;
Scan source code and generate the step of nature statement, class methods and/or function declaration item summary sheet for the first time;
Scan source code for the second time is converted to natural statement the step of actual class methods of calling or function;
With the step that is compiled into executable program;
Described first time, scan source code and generate the step of nature statement, class methods and/or function declaration item allowed to mate in the source scan process setting up a nature statement statement summary sheet or enter for the second time.
Described second time, the scan source code was converted to the step of actual class methods of calling or function with natural statement, allowed the nature statement is being converted to class methods or function and is mating in the direct compilation generator program process after treatment.
Compared with prior art, advantage of the present invention mainly shows:
1, compare with existing higher level lanquage, the present invention can adopt UNICODE code literal to carry out the definition of title, as English, Chinese, Japanese, Korean etc.The user can carry out the description of statement with people's natural language, has made full use of the advantage of mother tongue.
What 2, existing higher level lanquage adopted is the syntax rule of " function name or class method manes+parameter list ", and the present invention can be by people's natural language regular expression, and several parameters can be placed on the position of any needs.According to people's natural language rule definition sentence structure, realized the hommization of programmed environment, code easy to understand and maintenance.
When 3, stating, the order of people's natural language parameter and higher level lanquage corresponding parameters order can be inconsistent in the statement item, and realization is mated automatically when compiling.
4, the present invention can use all punctuation marks except that single quotation marks and angle brackets such as space, comma, meets the syntax rule of people's natural language.
Description of drawings
The present invention has 2 accompanying drawings, promptly
Fig. 1 carries out the process flow diagram of the method for program design for utilization people natural language in the computer programming of the present invention;
Fig. 2 is a virtual module block diagram of the present invention;
Fig. 1 is a specification digest accompanying drawing of the present invention.
Embodiment
As shown in Figure 1, the method of end user's natural language in a kind of computer programming, be included in the programming software system of packing on the known computer step, show and it is characterized in that the step of source code editor and operation also comprising: input nature statement, class methods and/or function declaration item and call the step of nature statement, class methods and/or function; Scan source code and generate the step of nature statement, class methods and/or function declaration item summary sheet for the first time; Scan source code for the second time is converted to natural statement the step of actual class methods of calling or function; With the step that is compiled into executable program.
1, statement nature statement or class methods
The user uses natural language to write code will state that a statement rule is as follows before earlier in advance:
When importing user-defined statement, the key word of a natural statement statement should be arranged, as " FRINDNAME " or " friendly name ", after connect the space; Be the natural statement of descriptive text and parameter set behind the space, the centre can press from both sides slotting several parameters; Connect equal sign "=" again; Be by the actual class methods of calling or function and parameter behind the equal sign; At last with branch "; " end delegation.
The statement item of built-in corresponding predefine natural language uses for the user among the class libraries of programming tool.
When calling " class methods ", the user also needs natural statement is wherein stated, " natural statement statement item " should be placed on the back of " class methods statement item ", with a pair of angle brackets "<" and "〉" draw together, interior is leading with a natural statement keyword, as " FRIENDNAME " or " friendly name "; After connect equal sign "=", the equal sign back is with two single quotation marks " ' " draw together the nature statement; Parameter in the parameter list of aforementioned " class methods statement " then by from left to right order with<1,<2〉... expression is filled out in natural statement.
Also by above-mentioned regular predefine nature statement, use in the built-in class libraries of programming tool for the user.
Assertion format 1:
Nature statement keyword ' natural statement '=class methods or function and parameter;
For example:
Friendly name ' at<drawing board 1〉on<position X 〉,<position Y〉locate demonstration<text〉'=drawing board 1. shows (position X, position Y, text);
Also stipulated the using method of label symbol in the above-mentioned statement item:
When 1) stating, a pair of single quotation marks " ' " is as drawing together whole natural statement.
2) a pair of angle brackets "<" and "〉" be used for flag parameters.
3) can use all Chinese and English characters, symbol except that half-angle single quotation marks " ' " and left angle brackets "<" in the natural statement.
And for example:
Friendly name ' at<drawing board〉on<position X 〉,<position Y〉locate to show<my text '=drawing board. show by (position X, position Y, my text);
The order of the corresponding parameter in described equal sign both sides can be inconsistent, and last example also can be write as:
Friendly name ' demonstration<my text〉<drawing board〉on<position X 〉,<position Y〉locate '=drawing board. show by (position X, position Y, my text);
Assertion format 2:
Class methods, function and parameter<natural statement keyword=' natural statement '
For example:
Class class 1
{
Integer type addition (integer type parameter 1, integer type parameter 2)<friendly name='<1〉and<2〉addition '
{
……
}
}
2, natural statement or the class methods after the use statement
Directly use the nature statement to describe the part form when calling, real data be filled in the parameter position, with former and later two single quotation marks " ' " draw together and use the end mark branch "; " the end statement row.
For example:
'<drawing board 1〉last 10,12 places demonstration " abc ;
During optional calling, if in natural statement, do not indicate parameter value, after in the bracket that connects the supplementary notes parameter value also can.
For example:
' at<drawing board 1 in write<text ' (text=" ABC ");
' at<drawing board in write<" ABC " ' (drawing board=drawing board 1);
' at<drawing board in write<text ' (drawing board=drawing board 1, text=" ABC ");
When calling the nature statement, also can nesting allocation.
For example:
' printing<text〉n time ' (text='<n2〉be transformed into text ' (n2=123), n=3);
In the above-mentioned code, " printing<text〉<n〉inferior " be a natural statement, "<n2〉be transformed into text " also is a natural statement, first natural statement calls second natural statement by nested mode.
When calling class methods, every nature statement that uses in program must use two single quotation marks " ' " draw together.The natural statement that " class methods " were stated is write in the back that connects fullstop after object name.
For example:
Class 1 object 1;
Integer type n=object 1. ' 1 and 2 additions ';
During optional calling, if in natural statement, do not indicate parameter value, only need after in the bracket that connects the supplementary notes parameter value get final product, for example:
Integer type n=object 1. ' 1 and<j addition ' (j=2);
3, in English, use the nature statement
In English or other languages, though the difference of tense or syntax format is arranged, so that the position of parameter is different with order, because the content when using is one to one in when statement, and the therefore use of natural statement and accessible.
For example:
‘Print<Text>for<n>times(Text=Convert<n2>to?string(n2=123),n=3);’
Perhaps, as the natural statement of following Chinese:
;
In English, then may represent with following natural statement:
‘Display″Hello?world!″in<Painter>at?10,10;’
4, program compiler source code
When compilation of source code is executable file, as follows to the treatment step of source code:
1) after the user assigns compiler directive, at first the source code after finishing is carried out lining by line scan the first time, mate the key word whether nature statement statement item is arranged in every line code, as " friendly name " or " FRIENDNAME ", if have, so just extract a whole sentence statement content before the end mark in internal memory, and with the programming language class libraries in predefined " natural statement " statement gather, generate one " a natural statement statement summary sheet ", be kept in internal memory or the file.The process of " a natural statement statement summary sheet " of generating can be in the code input process be finished after whether importing line code immediately by checking.
2) source code of lining by line scan for the second time, whether the character string in the coupling source code is described consistent with the natural statement in " a natural statement statement summary sheet ", if coupling is consistent, then call the class methods or the function in when statement, the one-to-one relationship of parameter transmits the relevant parameters value to actual class methods of calling or function during simultaneously according to statement.
3) through above processing, the natural statement code in the program has been converted to the actual class methods of calling or function and parameter code.Next pattern compiler compiles this code and gets final product routinely.
Claims (3)
1, the method for end user's natural language in a kind of computer programming is included in step, the demonstration source code editor of the programming software system of packing on the known computer and the step of moving, and it is characterized in that also comprising:
Input nature statement, class methods and/or function declaration item and call the step of nature statement, class methods and/or function;
Scan source code and generate the step of nature statement, class methods and/or function declaration item summary sheet for the first time;
Scan source code for the second time is converted to natural statement the step of actual class methods of calling or function;
With the step that is compiled into executable program.
2, the method for end user's natural language in the computer programming according to claim 1, it is characterized in that described first time of scan source code and generate the step of nature statement, class methods and/or function declaration item, allow to mate in the source scan process setting up a nature statement statement summary sheet or enter for the second time.
3, the method for end user's natural language in the computer programming according to claim 1, it is characterized in that described second time of scan source code, natural statement is converted to the step of actual class methods of calling or function, allows the nature statement is being converted to class methods or function and is mating in the direct compilation generator program process after treatment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200610047249 CN1889043A (en) | 2006-07-17 | 2006-07-17 | Method for using human natural language in computer programing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200610047249 CN1889043A (en) | 2006-07-17 | 2006-07-17 | Method for using human natural language in computer programing |
Publications (1)
Publication Number | Publication Date |
---|---|
CN1889043A true CN1889043A (en) | 2007-01-03 |
Family
ID=37578321
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200610047249 Pending CN1889043A (en) | 2006-07-17 | 2006-07-17 | Method for using human natural language in computer programing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1889043A (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103294470A (en) * | 2013-05-27 | 2013-09-11 | 上海华兴数字科技有限公司 | Programming language system with built-in natural language |
CN103543997A (en) * | 2012-07-17 | 2014-01-29 | 于丙超 | Three-word programming method |
CN104484156A (en) * | 2014-12-16 | 2015-04-01 | 用友软件股份有限公司 | Editing method for multilingual formula, editing system for multilingual formula and editor for multilingual formula |
CN104778071A (en) * | 2015-04-02 | 2015-07-15 | 谢玮琦 | Intelligent rule multi-language type interpretation system and creation method for same |
CN106250161A (en) * | 2016-08-04 | 2016-12-21 | 深圳市微我科技有限公司 | A kind of natural language hybrid programming method based on tables of data |
CN106250159A (en) * | 2016-08-04 | 2016-12-21 | 深圳市微我科技有限公司 | A kind of hybrid programming method utilizing natural language |
CN107247612A (en) * | 2017-04-25 | 2017-10-13 | 北京航天飞行控制中心 | job description method and device |
CN107329796A (en) * | 2017-06-30 | 2017-11-07 | 海南职业技术学院 | A kind of game development device and system based on natural language |
CN110221825A (en) * | 2019-06-10 | 2019-09-10 | 周登祥 | A method of realizing mother tongue programming on computers |
CN110727428A (en) * | 2019-12-19 | 2020-01-24 | 杭州健戎潜渊科技有限公司 | Method and device for converting service logic layer codes and electronic equipment |
CN113366430A (en) * | 2019-01-10 | 2021-09-07 | 布莱恩认知私人有限公司 | Natural solution language |
-
2006
- 2006-07-17 CN CN 200610047249 patent/CN1889043A/en active Pending
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103543997A (en) * | 2012-07-17 | 2014-01-29 | 于丙超 | Three-word programming method |
CN103294470A (en) * | 2013-05-27 | 2013-09-11 | 上海华兴数字科技有限公司 | Programming language system with built-in natural language |
CN104484156B (en) * | 2014-12-16 | 2017-04-05 | 用友网络科技股份有限公司 | The edit methods of multilingual formula, editing system and multilingual formula editors |
CN104484156A (en) * | 2014-12-16 | 2015-04-01 | 用友软件股份有限公司 | Editing method for multilingual formula, editing system for multilingual formula and editor for multilingual formula |
CN104778071A (en) * | 2015-04-02 | 2015-07-15 | 谢玮琦 | Intelligent rule multi-language type interpretation system and creation method for same |
CN106250159A (en) * | 2016-08-04 | 2016-12-21 | 深圳市微我科技有限公司 | A kind of hybrid programming method utilizing natural language |
CN106250161A (en) * | 2016-08-04 | 2016-12-21 | 深圳市微我科技有限公司 | A kind of natural language hybrid programming method based on tables of data |
CN106250159B (en) * | 2016-08-04 | 2020-12-22 | 深圳市微我科技有限公司 | Mixed programming method using natural language |
CN107247612A (en) * | 2017-04-25 | 2017-10-13 | 北京航天飞行控制中心 | job description method and device |
CN107247612B (en) * | 2017-04-25 | 2024-05-31 | 北京航天飞行控制中心 | Operation description method and device |
CN107329796A (en) * | 2017-06-30 | 2017-11-07 | 海南职业技术学院 | A kind of game development device and system based on natural language |
CN113366430A (en) * | 2019-01-10 | 2021-09-07 | 布莱恩认知私人有限公司 | Natural solution language |
CN117149163A (en) * | 2019-01-10 | 2023-12-01 | 布莱恩认知私人有限公司 | Natural solution language |
CN110221825A (en) * | 2019-06-10 | 2019-09-10 | 周登祥 | A method of realizing mother tongue programming on computers |
CN110727428A (en) * | 2019-12-19 | 2020-01-24 | 杭州健戎潜渊科技有限公司 | Method and device for converting service logic layer codes and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1889043A (en) | Method for using human natural language in computer programing | |
CN1181428C (en) | Introspective editor system, program, and method for software translation | |
CN104461484B (en) | The implementation method and device of front-end template | |
CN108399064B (en) | Multilingual entry generation method based on Qt development | |
CN1371499A (en) | Object property meta model emulator for legacy data structures | |
CN1261867C (en) | Method for implementing language resource localization of software | |
CN104063635B (en) | The guard method of file destination and protection system | |
CN1823323A (en) | Method and apparatus for performing native binding | |
CN1842081A (en) | ABNF character string mode matching and analyzing method and device | |
US20080244541A1 (en) | Code translator and method of automatically translating modeling language code to hardware language code | |
CN1808377A (en) | Application-generic sequence diagram generator driven by a non-proprietary language | |
CN1652106A (en) | Machine translation method and apparatus based on language knowledge base | |
CN1908931A (en) | Literal data variable typesetting method | |
CN1932802A (en) | Host device having extraction function of text and extraction method thereof | |
CN1855053A (en) | Method and device for implementing java virtual machine command | |
CN108595171A (en) | Object model generation method, device, equipment and storage medium | |
CN1265307C (en) | Characteristic character string extracting and substituting method in language localization | |
CN1313926C (en) | Template compilation method | |
CN1858717A (en) | Data coding and decoding method and its coding and decoding device | |
CN1949169A (en) | TV software upgrading method | |
CN1877531A (en) | Embedded compiled system scanner accomplishing method | |
CN1869926A (en) | Method and system for generating artificial equipment panel | |
CN1108572C (en) | Mechanical Chinese to japanese two-way translating machine | |
CN1855052A (en) | Method for generating target source code from tree structural data and a set of fragment structure | |
CN103886095B (en) | Cross-platform file destination multiplexing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |