aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/testLua/yueliang-0.4.1/nat-5.1.3/README
blob: 215b5558185f817e0c74fb3ed19c3a9e6d02331e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
nat-5.1.3

This directory contains versions of front end files that are rewritten
to be more "native" to Lua. These files should be considered as
exercises in exploring ways to write the front end, for example, to
write a front end that is optimized for size, etc. See also file size
data further below.

The following are the different versions available (mk2 == "mark 2",
this is commonly used in the UK, e.g. for aeroplanes during WWII):

Lexers
------

NOTE: These lexers should behave mostly identically to the original C
lexer. Locale support for non-standard decimal points is missing. Also,
all strings and long strings have line endings normalized to LF.

llex_mk2	Rewritten from original ported code to become more
		Lua-like. Needs input to be entered as a single string.
		Unless an application's need is very unusual, this
		should not be a problem. It will not work for per-line
		interaction, though. This version is also somewhat
		optimized for size; its stripped binary chunk size is
		3716 bytes.

		Status: TESTED

Parsers
-------

lparser_mk2	Written for the simplified lexer interface of llex_mk2.
		This is a lexer skeleton, stripped of codegen code. Has
		a minimum of variable management code added, and tracks
		the is_vararg flag of a function. See the comments in
		the source code for more information. Without logging
		messages and comments, it should be under 600 LOC. A
		binary chunk of lparser_mk2 (stripped) is 15783 bytes.

		Sample output of the parser message logger can be found
		in the test/parser_log subdirectory.

		Tested with test_parser-5.1.lua, the Lua 5.1.x parser test
		cases in the test_lua/ directory, appears to be fine.

		Compared to the 5.0.x parser skeleton, the main changes
		are: (a) 'arg' not implemented, so it appears as a global,
		and (b) '...' recognized as the last function parameter.

		Status: SNIPPETS APPEAR TO WORK

Other notes:
------------

None.