25 -- * Please read technotes.txt for more technical details. |
25 -- * Please read technotes.txt for more technical details. |
26 ----------------------------------------------------------------------]] |
26 ----------------------------------------------------------------------]] |
27 |
27 |
28 local base = _G |
28 local base = _G |
29 local string = require "string" |
29 local string = require "string" |
30 module "llex" |
30 --module "llex" |
31 |
31 |
32 local find = string.find |
32 local find = string.find |
33 local match = string.match |
33 local match = string.match |
34 local sub = string.sub |
34 local sub = string.sub |
35 |
35 |
45 end |
45 end |
46 |
46 |
47 -- NOTE: see init() for module variables (externally visible): |
47 -- NOTE: see init() for module variables (externally visible): |
48 -- tok, seminfo, tokln |
48 -- tok, seminfo, tokln |
49 |
49 |
50 local z, -- source stream |
50 local z = '', -- source |
51 sourceid, -- name of source |
51 sourceid = '', -- name of source |
52 I, -- position of lexer |
52 I = 1, -- lexer's position in source |
53 buff, -- buffer for strings |
53 buff = '', |
54 ln -- line number |
54 ln = 1, -- line number |
|
55 tok = {}, -- lexed token list* |
|
56 seminfo = {}, -- lexed semantic information list* |
|
57 tokln = {}, -- line numbers for messages* |
55 |
58 |
56 ---------------------------------------------------------------------- |
59 ---------------------------------------------------------------------- |
57 -- add information to token listing |
60 -- add information to token listing |
58 ---------------------------------------------------------------------- |
61 ---------------------------------------------------------------------- |
59 |
62 |