aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/README
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/README')
-rw-r--r--LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/README122
1 files changed, 0 insertions, 122 deletions
diff --git a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/README b/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/README
deleted file mode 100644
index b6a65d2..0000000
--- a/LuaSL/testLua/yueliang-0.4.1/nat-5.0.3/README
+++ /dev/null
@@ -1,122 +0,0 @@
1nat-5.0.3
2
3This directory contains versions of front end files that are rewritten
4to be more "native" to Lua. These files should be considered as
5exercises in exploring ways to write the front end, for example, to
6write a front end that is optimized for size, etc. See also file size
7data further below.
8
9The following are the different versions available (mk2 == "mark 2",
10this is commonly used in the UK, e.g. for aeroplanes during WWII):
11
12Lexers
13------
14
15WARNING: Theses lexer may or may not exhibit exact behaviour when lexing
16strings or long strings with embedded CRLF newlines. The CRLF sequence
17may be translated into LF (the reference manual is unclear on this.) The
18user is advised to stick to LF line endings exclusively.
19
20llex_mk2 Rewritten from original ported code to become more
21 Lua-like. Still uses a stream-based input interface.
22 MK2 still scans using a per-character function that
23 is pretty inefficient.
24
25 Status: TESTED
26
27llex_mk3 A rewritten version of MK2 that needs input to be
28 entered as a single string. Unless an application's
29 need is very unusual, this should not be a problem.
30 It will not work for per-line interaction, though.
31 MK3 no longer needs stream input functions. This
32 version is also heavily optimized for size. MK3 scans
33 using find functions and doesn't create many strings.
34
35 Status: TESTED
36
37llex_mk4 A rewritten version of MK3 that is line-oriented.
38 This allows a command-line version that works in the
39 usual way to be written.
40
41 Status: TESTED
42
43The following is a comparison of file sizes (as of 20061111):
44
45 lzio llex TOTAL Speed (2)
46 (bytes) (bytes) (bytes) (KB/s)
47----------------------------------------------
48Binary (Mingw) 416 5312 5728 N/A
49----------------------------------------------
50(in orig-5.0.3:)
51----------------------------------------------
52normal 2219 12639 14585 404.9
53stripped 1292 7618 8910
54----------------------------------------------
55(in nat-5.0.3:)
56----------------------------------------------
57mk2 1995 7628 9623 469.5
58mk2-stripped 1195 4003 5298
59----------------------------------------------
60mk3 (1) - 6552 6552 1870.8
61mk3-stripped - 3286 3286
62----------------------------------------------
63mk4 1337 6956 8293 802.9
64mk4-stripped 798 3457 4225
65----------------------------------------------
66
67(1) mk3 does not have a file input streaming function
68
69(2) Speed was benchmarked using a Sempron 3000+. Benchmark scripts are
70in the test directories. Best of first three figures quoted. This is a
71measurement of raw lexer speed, i.e. tokens are read but no processing
72is done. All files are read in entirely before running the lexer.
73
74The performance of the orig-5.0.3 parser is probably a whole magnitude
75less than the orig-5.0.3 lexer performance.
76
77Parsers
78-------
79
80lparser_mk3 Written for the simplified lexer interface of llex_mk3+.
81 (Should be compatible with llex_mk4 too, but untested.)
82 This is a lexer skeleton, stripped of codegen code. See
83 the comments in the source code for more information.
84 Without logging messages and comments, it's under 600 LOC.
85
86 Sample output of the parser message logger can be found
87 in the test/parser_log subdirectory.
88
89 Tested with test_parser-5.0.lua, the Lua 5.0.x parser test
90 cases in the test_lua/ directory, appears to be fine.
91
92 Status: SNIPPETS APPEAR TO WORK
93
94lparser_mk3b As above, with variable management code added. In order
95 to use the parser usefully, variable management code is
96 a big step forward, allowing the parser to differentiate
97 locals, upvalues and globals. The number of added lines
98 is around 100 LOC. A binary chunk of lparser_mk3b
99 (stripped) is 18076 bytes.
100
101 Sample output of the parser message logger can be found
102 in the test/parser_log subdirectory.
103
104 Tested with test_parser-5.0.lua, the Lua 5.0.x parser test
105 cases in the test_lua/ directory, appears to be fine.
106
107 Status: SNIPPETS APPEAR TO WORK
108
109There will be no further development beyond lparser_mk3b. Further work
110will focus on a 5.1.x equivalent, for which both a parser skeleton and a
111parser with full code generation using nicely commented code is planned.
112
113Other notes:
114------------
115
116For Lua 5.0.2, see Yueliang 0.1.3, which was the last release of Lua
1175.0.2 material.
118
119Test scripts for the lexer should probably be consolidated, but it's a
120little difficult because not all lexers give the same error messages or
121use the same token names or format.
122