CN106227531B - A method of realizing mother tongue programming on computers - Google Patents

A method of realizing mother tongue programming on computers Download PDF

Info

Publication number
CN106227531B
CN106227531B CN201610581217.5A CN201610581217A CN106227531B CN 106227531 B CN106227531 B CN 106227531B CN 201610581217 A CN201610581217 A CN 201610581217A CN 106227531 B CN106227531 B CN 106227531B
Authority
CN
China
Prior art keywords
statement
alias
title
keyword
programming
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
CN201610581217.5A
Other languages
Chinese (zh)
Other versions
CN106227531A (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.)
Zhou Dengxiang
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 CN201610581217.5A priority Critical patent/CN106227531B/en
Publication of CN106227531A publication Critical patent/CN106227531A/en
Application granted granted Critical
Publication of CN106227531B publication Critical patent/CN106227531B/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/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding

Abstract

The invention belongs to computer application fields, and in particular to a method of mother tongue programming is realized on computers.A method of it realizing mother tongue programming on computers, includes the following steps: (1), the keyword for the programming language being arranged under different human languages and precompile instruction;(2) alias of the title for the code bank interface statement that setting relies on.

Description

A method of realizing mother tongue programming on computers
Technical field
The invention belongs to computer application fields, and in particular to a method of mother tongue programming is realized on computers.
Background technique
The computer programming languages such as present C/C++ are based on English, although its support uses Unicode as mark Symbol, but its keyword is English, the base library programming interface provided is English, and the people for being unfamiliar with English for many comes It says, to write C/C++ code, these English names have obstruction for them.
Summary of the invention
Goal of the invention: the present invention has made improvements in view of the above-mentioned problems of the prior art, i.e., the invention discloses one kind The method for realizing mother tongue programming on computers allows the computer programming languages such as C/C++ to realize mother tongue programming, different by setting The alias that the keyword of programming language under human language and precompile instruction and setting program bank interface are stated, allows people can be with It communicates in one's mother tongue to program.
Technical solution: a method of it realizing mother tongue programming on computers, includes the following steps:
(1), keyword and the precompile instruction of the programming language under different human languages are set;
(11) human language precompile instruction is increased newly, for stating what the programming language keyword used and precompile instructed Human language;
(12) it in the code beginning write, is used using human language precompile increased in step (11) instruction statement Program human language type set;
(13) stage for making morphological analysis to the code for writing completion in compiler, the statement being resolved in step (12) are used When the programming human language type set arrived, the programming language of the specified human language of creation human language precompile instruction is crucial The hash table of word identifier set and programming language precompile instruction identifier set hash table, programming language keyword identifier collection Closing includes keyword strings and key word type in hash table, is wrapped in programming language precompile instruction identifier set hash table The string of instruction character containing precompile and precompile instruction type;
(14) when whether judge identifier is keyword, first judged using the type of identifier of default, if not inquiring To the identifier, then the programming language keyword identifier set hash table created in query steps (13) judges whether it is pass Key word then inquires the key word type if it is keyword;
(15) when judging precompile instruction type, first judged using the precompile instruction type of default, if judgement Failure, then the programming language precompile instruction identifier set hash table created in query steps (13), and judge that precompile refers to The type of order;
(2) alias of the title for the code bank interface statement that setting relies on;
(21) alias definition keyword is increased newly, for defining the alias of statement title;
(22) using the alias of the alias definition keyword definition code bank interface statement title in step (21), the sound The content of the alias of bright title includes the name path of alias name, primitive name title and primitive name title;
(23) when programming is needed using code bank interface, the title comprising definition code bank interface statement in step (22) The code of alias;
(24) when compiler is resolved to the alias of definition code bank interface statement title in step (22), according to primitive name The name path of title finds statement context belonging to primitive name title, above and below the statement belonging to primitive name statement record In text, inquires using primitive name as the set of the statement record of title, be that each is recorded by the statement of title of the primitive name An alias statement record is created with alias, alias statement record uses alias as title, and alias statement record is comprising corresponding to Original claim record reference, newly-built alias statement record is increased to statement context belonging to primitive name title;
(25) when compiler is recorded according to name query to statement, the type of first judgement statement record, if it is alias Statement record then records corresponding original claim with alias statement and records.
The utility model has the advantages that a kind of method for realizing mother tongue programming on computers disclosed by the invention has below beneficial to effect Fruit:
1, the support for increasing and programming to a certain human language can be facilitated, programmed when needing support new human language When, the keyword and precompile instruction, the base library that programming language is arranged for needing to be arranged the programming language under the human language connect The alias for the third party library interface that the alias of mouth and setting need;
2, using this method, known human language programming is can be used in developer;
3, the code that different human languages write out can be mutually general, provides the alias setting of different human languages, so that it may With the code library for calling different human languages to write out;
4, the code that other human language is developed can be used, can occur a variety of human languages simultaneously in code and write Program;
5, existing code library can be reused.There is provided alias setting, so that it may existing code library be allowed to support a variety of mankind Language.
Detailed description of the invention
Fig. 1 is the dendrogram of the name path of statement;
Fig. 2 is the dendrogram that statement is recorded in compiler;
Fig. 3 is to increase the dendrogram for stating to be recorded in compiler after alias statement record.
Specific embodiment
Detailed description of specific embodiments of the present invention below.
A method of it realizing mother tongue programming on computers, includes the following steps:
(1), keyword and the precompile instruction of the programming language under different human languages are set;
(11) human language precompile instruction is increased newly, for stating what the programming language keyword used and precompile instructed Human language;
(12) it in the code beginning write, is used using human language precompile increased in step (11) instruction statement Program human language type set;
(13) stage for making morphological analysis to the code for writing completion in compiler, the statement being resolved in step (12) are used When the programming human language type set arrived, the programming language of the specified human language of creation human language precompile instruction is crucial The hash table of word identifier set and programming language precompile instruction identifier set hash table, programming language keyword identifier collection Closing includes keyword strings and key word type in hash table, is wrapped in programming language precompile instruction identifier set hash table The string of instruction character containing precompile and precompile instruction type;
(14) when whether judge identifier is keyword, first judged using the type of identifier of default, if not inquiring To the identifier, then the programming language keyword identifier set hash table created in query steps (13) judges whether it is pass Key word then inquires the key word type if it is keyword;
(15) when judging precompile instruction type, first judged using the precompile instruction type of default, if judgement Failure, then the programming language precompile instruction identifier set hash table created in query steps (13), and judge that precompile refers to The type of order;
Increase precompile instruction _ _ 0__, which is used to the programming human language type in addition to English for stating to use Set.Such as 1 for Chinese.
#__0__1//statement is instructed using Chinese programming language keyword and precompile
# defines size 12345
Adjusting method 1 ()
Whole first=10;
Whole second=size;
Whole third=first+second;
Return to third;
}
The cmi code is equivalent to English code:
#define size 12345
Int method 1 ()
First=10 int;
Int second=size;
Third=first of int+second;
Return third;
}
(2) alias of the title for the code bank interface statement that setting relies on;
(21) alias definition keyword is increased newly, for defining the alias of statement title;
(22) using the alias of the alias definition keyword definition code bank interface statement title in step (21), the sound The content of the alias of bright title includes the name path of alias name, primitive name title and primitive name title;
(23) when programming is needed using code bank interface, the title comprising definition code bank interface statement in step (22) The code of alias;
(24) when compiler is resolved to the alias of definition code bank interface statement title in step (22), according to primitive name The name path of title finds statement context belonging to primitive name title, above and below the statement belonging to primitive name statement record In text, inquires using primitive name as the set of the statement record of title, be that each is recorded by the statement of title of the primitive name An alias statement record is created with alias, alias statement record uses alias as title, and alias statement record is comprising corresponding to Original claim record reference, newly-built alias statement record is increased to statement context belonging to primitive name title;
(25) when compiler is recorded according to name query to statement, the type of first judgement statement record, if it is alias Statement record then records corresponding original claim with alias statement and records.
The name path of one statement primitive name title refers in code logic, since global scope, reaches this The path of a statement can be indicated with arborescence.Such as: there is code:
Const int A=10;
struct SS{int a;int b;};
namesapce NN{class CC{int a;int b;};
class DD{void f();void f(int i);};}
The dendrogram of the name path of the statement of these codes as shown in Figure 1,
Statement record refers to that in compiler, compiler is the data segment of each statement creation, which includes statement Title, the contents such as statement type.
Statement context belonging to primitive name title refers to that in compiler, compiler is tree-like to statement and statement path The expression of structure.It for stating the root in path, is indicated with overall situation statement context, the node table in other statement tree structures Show.The dendrogram that the statement of above code is recorded in compiler is as shown in Figure 2.
Increase new key _ _ 1__, for defining the alias of statement title.
Call the aliased codes of statement title defined below:
_ _ 1__ first=A;
_ _ 1__ second=SS;
_ _ 1__ fourth=SS::a;
Penta=SS::b of _ _ 1__;
Third=NN of _ _ 1__;
_ _ 1__ oneself=NN::CC;
_ _ 1__ fourth=NN::CC::a;
Penta=NN::CC::b of _ _ 1__;
_ _ 1__ heptan=NN::DD;
_ _ 1__ is ugly=NN::DD::f;
It is as shown in Figure 3 to the dendrogram of the expression of statement record in compiler.
After the aliased codes comprising definition statement title, following Chinese can be used to call these statements:
#__0__1
Third:: oneself certain;
Certain fourth=first;
Certain penta=first of;
Heptan 2;
Certain 2. ugly ();
Certain 2. ugly (certain fourth);
Embodiments of the present invention are elaborated above.But present invention is not limited to the embodiments described above, Technical field those of ordinary skill within the scope of knowledge, can also do without departing from the purpose of the present invention Various change out.

Claims (1)

1. a kind of method for realizing mother tongue programming on computers, which comprises the steps of:
(1), keyword and the precompile instruction of the programming language under different human languages are set;
(11) human language precompile instruction is increased newly, for stating the mankind of the programming language keyword used and precompile instruction Language;
(12) in the code beginning write, the programming used using human language precompile increased in step (11) instruction statement Human language type set;
(13) stage for making morphological analysis to the code for writing completion in compiler, what the statement being resolved in step (12) was used When programming human language type set, the programming language keyword mark of the specified human language of creation human language precompile instruction Know symbol set hash table and programming language precompile instruction identifier set hash table, programming language keyword identifier set dissipates Include keyword strings and key word type in list, includes pre- in programming language precompile instruction identifier set hash table Compile instruction character string and precompile instruction type;
(14) when whether judge identifier is keyword, first judged using the type of identifier of default, if not inquiring this Identifier, the then programming language keyword identifier set hash table created in query steps (13), judges whether it is keyword, If it is keyword, then the key word type is inquired;
(15) when judging precompile instruction type, first judged using the precompile instruction type of default, if judgement failure, The programming language precompile instruction identifier set hash table then created in query steps (13), and judge the class of precompile instruction Type;
(2) alias of the title for the code bank interface statement that setting relies on;
(21) alias definition keyword is increased newly, for defining the alias of statement title;
(22) using the alias of the alias definition keyword definition code bank interface statement title in step (21), the statement name The content of the alias of title includes the name path of alias name, primitive name title and primitive name title;
(23) when programming is needed using code bank interface, the title alias comprising definition code bank interface statement in step (22) Code;
(24) when compiler is resolved to the alias of definition code bank interface statement title in step (22), according to primitive name title Name path, find statement context belonging to primitive name title, primitive name statement record belonging to statement context in, It inquires using primitive name as the set of the statement record of title, is each using the primitive name as the statement record alias of title An alias statement record is created, alias statement record uses alias as title, and alias statement record is comprising corresponding original Newly-built alias statement record is increased to statement context belonging to primitive name title by the reference for stating record;
(25) when compiler is recorded according to name query to statement, the type of first judgement statement record, if it is alias statement Record then records corresponding original claim with alias statement and records.
CN201610581217.5A 2016-07-21 2016-07-21 A method of realizing mother tongue programming on computers Active CN106227531B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610581217.5A CN106227531B (en) 2016-07-21 2016-07-21 A method of realizing mother tongue programming on computers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610581217.5A CN106227531B (en) 2016-07-21 2016-07-21 A method of realizing mother tongue programming on computers

Publications (2)

Publication Number Publication Date
CN106227531A CN106227531A (en) 2016-12-14
CN106227531B true CN106227531B (en) 2019-05-21

Family

ID=57531154

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610581217.5A Active CN106227531B (en) 2016-07-21 2016-07-21 A method of realizing mother tongue programming on computers

Country Status (1)

Country Link
CN (1) CN106227531B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110221825B (en) * 2019-06-10 2022-11-18 周登祥 Method for realizing native language programming on computer

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101174207A (en) * 2007-11-05 2008-05-07 马旭东 System and method for developing multiple high-level language programs using mother tongue
CN102479078A (en) * 2010-11-26 2012-05-30 苗玉水 Chinese programming method for computer by using Chinese phonetic codes

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8020145B2 (en) * 2005-08-18 2011-09-13 Wave Semiconductor Method and language for process expression

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101174207A (en) * 2007-11-05 2008-05-07 马旭东 System and method for developing multiple high-level language programs using mother tongue
CN102479078A (en) * 2010-11-26 2012-05-30 苗玉水 Chinese programming method for computer by using Chinese phonetic codes

Also Published As

Publication number Publication date
CN106227531A (en) 2016-12-14

Similar Documents

Publication Publication Date Title
US11036937B2 (en) Contraction aware parsing system for domain-specific languages
CN100489841C (en) Method and integrated development tool for building a natural language understanding application
CN112232074B (en) Entity relationship extraction method and device, electronic equipment and storage medium
Bharati et al. Ssf: Shakti standard format guide
US20160092178A1 (en) Method and system for model driven development
US11138506B2 (en) Abstraction and portability to intent recognition
CN104391837A (en) Intelligent grammatical analysis method based on case semantics
Abdelnabi et al. Generating uml class diagram from natural language requirements: A survey of approaches and techniques
Anderson Words and paradigms: Peter H. Matthews and the development of morphological theory
TW202121230A (en) Natural language processing method and computing apparatus thereof
Wintner Morphological processing of semitic languages
Dunham et al. LingSync & the Online Linguistic Database: New models for the collection and management of data for language communities, linguists and language learners
CN103927179A (en) Program readability analysis method based on WordNet
Pinter et al. NYTWIT: A dataset of novel words in the New York Times
CN106227531B (en) A method of realizing mother tongue programming on computers
CN109325217A (en) A kind of document conversion method, system, device and computer readable storage medium
CN103020311B (en) A kind of processing method of user search word and system
Stepanov et al. Language style and domain adaptation for cross-language SLU porting
CN105159931B (en) For generating the method and apparatus of synonym
CN103678607B (en) A kind of construction method of Emotion tagging system
Kilgarriff Putting the corpus into the dictionary
Wilcock The evolution of text annotation frameworks
WO2011047608A1 (en) Forming method of patterned bilingual sentence pair and forming device thereof
Li et al. Root and phrasal diminutive markers in Gan Chinese
Diffendaffer et al. A Comparative Study of Phonological Processes Between Canadian-French-Speaking and American-English-Speaking Children with Speech Sound Disorders

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20190329

Address after: 561300 No. 97 East Suburb Road, Huajiang Town, Guanling Buyi and Miao Autonomous County, Anshun City, Guizhou Province

Applicant after: Zhou Dengxiang

Address before: 100107 Beijing Chaoyang District Tianlangyuan C Block 3 Floor 03 Business (Harvest Incubator 2777)

Applicant before: Beijing Pu Hui Technology Co. Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant