Use JS to upload a Chinese Javascript

Source: Internet
Author: User

During the holidays, JavaScript has been used to implement a set of js Word Analyzer, graphic analyzer, analyzer, interpreter, and a very
Simple ide, now has the function and writing package. In addition, the traditional analyzer of the Word Analyzer in Chinese has been used.
A typical example of Chinese programming language.

------------------------------

(Example ):

+-*/^ & | ~ = And so on
Exam available: ==>=? For example, 1 =? 2. For example, change the sequence type of the orders table to>? <? <=? <=? (Not implemented here)
Variable description
Yuan a = expr
Description
Function Name (numeric, numeric): [[generation segment]
Function Name (numeric, numeric )::
[[
Generation segment
]
Anonymous email count
Data Group # Sort (_ (number 1, number 2): [[return number 1-Number 2])
Implicit reference
Object # modularity
Object # method (photo number, photo number)

Direct object volume
Yuan o = [[attention: value 1, attention 2: Value 2, attention 3: Value 3];
Yuan o = [[
Adequacy: value 1,
Adequacy 2: Value 2,
Adequacy 3: Value 3
];
Yuan o = [[:];
O # adequacy
Direct data volume
Yuan o = [[value 1, value 2, value 3];
Data Group Standard
Data Group # [1]

Return sentence
Return;
Returns 1;
Returns [[atomicity: value, atomicity 2: Value 2, atomicity 3: Value 3];

Zookeeper
Returns a [[token: value, token 2: Value 2, Token 3: Value 3];
Generate a new sequence ("variable a is not fixed ");

Judgement
If a = 1 [// the end must be followed by a sentence, that is, if (cond) aa is not allowed; if cond {aa ;}
Dadada
] No [[
Dididi
]

Cycle
If a = 1 anti-leech [[
Dadada
]

Anti-leech [[
Dadada
] If a = 1;

Break
Jump out
Continue
Zookeeper

Standard sentence:
Standard recycling resource: // js standard a: it is easy to confuse with the immediate value of the object in the sentence else {}, and there is a difference

Branch
If a [[// do not use =, avoid and = abrupt
1:
Xxx;
Jump out;
2:
Yyy;
Jump out;
Others:
Zzz;
]

Cycle
Make a = 1; a <10; a ++ [[
Zzz;
]

All a values for o [[
Zzz;
]
In
Due
Instanceof
Yes
Try
Rows [[
Xxx;
] Capture volume e [[
Yyy;
[[
Zzz;
]

-----------------------------------
:

// ----------------------- Create a letter data ------------------------
Person ()::[[
I # name = 'employee 3 ';
I # renew = 22;
I # Say = _()::[[
Console # log ('Hello everyone, my name '+ me # name + ", me this year" + me # renew
+ 'Terminated ');
]
]

RMB 3 = new person ();

Statement 3 ();

Log (category 3 # Name );

// ----------------------- Sort orders ----------------------------

Yuan a = [[4, 6, 7, 2, 1, 3];
A # sort (_ (a, B )::[[
Returns a-B;
]);
Log ();

// ---------------------- Cons ------------------------
Cons (a, B )::[[
Return _ (o )::[[
If o = 1 [[return a;] No [return B;]
]
]

Car (o): [[return o (1);]
Cdr (o): [[return o (2);]

Yuan s = cons (7, 8 );
Log (car (s ));
Log (cdr (s ));


Bonding (1, 2 )::[[
Return Value )::[[
If the = 1 [[returns 1;] [returns 2;]
]
]

Headers (molecules): [[return molecules (1);]
Tail removal (molecular): [[return molecular (2);]

Small RMB = bonding (7, 8 );
Log (small ));
Log (tail (small ));

// ======================================
Person ()::[[
I # name = 'employee 3 ';
I # renew = 22;
I # Say = _ (urname )::[[
Console # log (urname + ', hello, my name is' + me # name + ", me this year" + me
# Yearly renewal + 'renewal out ');
Returns 2;
]
]

RMB 3 = [[:];
Person # apply (employee 3, [[]);
Yuan s = generation 3 # say # call (generation 3, 'wang 3 ');
Yuan s = Jun 3 # say # apply (Jun 3, ['wang 3']);
Log (s );

// ----------------------------------- Prototype & instanceof -------------------
----
Person ()::[[
I # name = 'employee 3 ';
]
Person # prototype # = _()::[[
Log ('Hello, I am '+ I # Name );
];

MAN ()::[[
]

Man # prototype = new man ();

Man # prototype # = _()::[[
Log ('Hello, I am '+ I # name + 'Mr ');
];

Yuan a = new man ();
Log (a is a man );
Log (a is a person );
Log (Object );

// ------------------------- Begin package ------------------------
F ()::[[
Return _ (): [[return a;]
]

Yuan a1 = f (1 );
Yuan a2 = f (2 );

A1 () + a2 ()

// ---------------------- Data Group --------------------------
// Whether the group is constant
Person ()::[[
I # people I like = [[];
I # name = 'employee 3 ';
]

Yuan p1 = new person ();
Yuan p2 = new person ();

P1 # name = 'Lee Shimin ';
P1 # people who like it # push ('cheng Zhijin ');

Log (p2 # Name );
Log (p2 # people you like );

-------------------

Enjoy it ~~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.