Subversion Repositories Kolibri OS

Rev

Rev 8859 | Rev 9579 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8859 Rev 9177
Line 6... Line 6...
6
*)
6
*)
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
MODULE Compiler;
8
MODULE Compiler;
9
 
9
 
Line 10... Line 10...
10
IMPORT ST := STATEMENTS, PARS, UTILS, PATHS, PROG, C := CONSOLE,
10
IMPORT ST := STATEMENTS, PARS, UTILS, PATHS, PROG, C := CONSOLE,
Line 11... Line 11...
11
       ERRORS, STRINGS, WRITER, MSP430, THUMB, TARGETS, SCAN;
11
       ERRORS, STRINGS, WRITER, MSP430, THUMB, TARGETS, SCAN, TEXTDRV;
Line 28... Line 28...
28
    value: INTEGER;
28
    value: INTEGER;
29
    minor,
29
    minor,
30
    major: INTEGER;
30
    major: INTEGER;
31
    checking: SET;
31
    checking: SET;
Line -... Line 32...
-
 
32
 
-
 
33
 
-
 
34
    PROCEDURE getVal (VAR i: INTEGER; VAR value: INTEGER);
-
 
35
    VAR
-
 
36
        param: PARS.PATH;
-
 
37
        val: INTEGER;
-
 
38
    BEGIN
-
 
39
        INC(i);
-
 
40
        UTILS.GetArg(i, param);
-
 
41
        IF STRINGS.StrToInt(param, val) THEN
-
 
42
            value := val
-
 
43
        END;
-
 
44
        IF param[0] = "-" THEN
-
 
45
            DEC(i)
-
 
46
        END
-
 
47
    END getVal;
-
 
48
 
32
 
49
 
33
BEGIN
50
BEGIN
34
    out := "";
51
    out := "";
35
    checking := options.checking;
52
    checking := options.checking;
36
    _end := FALSE;
53
    _end := FALSE;
Line 55... Line 72...
55
                DEC(i)
72
                DEC(i)
56
            ELSE
73
            ELSE
57
                out := param
74
                out := param
58
            END
75
            END
Line -... Line 76...
-
 
76
 
-
 
77
        ELSIF param = "-tab" THEN
-
 
78
            getVal(i, options.tab)
59
 
79
 
60
        ELSIF param = "-ram" THEN
-
 
61
            INC(i);
-
 
62
            UTILS.GetArg(i, param);
-
 
63
            IF STRINGS.StrToInt(param, value) THEN
80
        ELSIF param = "-ram" THEN
64
                options.ram := value
-
 
65
            END;
-
 
66
            IF param[0] = "-" THEN
-
 
67
                DEC(i)
-
 
Line 68... Line 81...
68
            END
81
            getVal(i, options.ram)
69
 
-
 
70
        ELSIF param = "-rom" THEN
-
 
71
            INC(i);
-
 
72
            UTILS.GetArg(i, param);
82
 
73
            IF STRINGS.StrToInt(param, value) THEN
-
 
74
                options.rom := value
-
 
75
            END;
-
 
76
            IF param[0] = "-" THEN
-
 
Line 77... Line 83...
77
                DEC(i)
83
        ELSIF param = "-rom" THEN
78
            END
84
            getVal(i, options.rom)
79
 
85
 
Line 180... Line 186...
180
    time:       INTEGER;
186
    time:       INTEGER;
181
    options:    PROG.OPTIONS;
187
    options:    PROG.OPTIONS;
Line 182... Line 188...
182
 
188
 
183
BEGIN
189
BEGIN
-
 
190
    options.stack := 2;
184
    options.stack := 2;
191
    options.tab := TEXTDRV.defTabSize;
185
    options.version := 65536;
192
    options.version := 65536;
186
    options.pic := FALSE;
193
    options.pic := FALSE;
187
    options.lower := FALSE;
194
    options.lower := FALSE;
Line 235... Line 242...
235
        C.StringLn("  -lower                allow lower case for keywords"); C.Ln;
242
        C.StringLn("  -lower                allow lower case for keywords"); C.Ln;
236
        C.StringLn("  -def      define conditional compilation symbol"); C.Ln;
243
        C.StringLn("  -def      define conditional compilation symbol"); C.Ln;
237
        C.StringLn("  -ver     set version of program (KolibriOS DLL)"); C.Ln;
244
        C.StringLn("  -ver     set version of program (KolibriOS DLL)"); C.Ln;
238
        C.StringLn("  -ram            set size of RAM in bytes (MSP430) or Kbytes (STM32)"); C.Ln;
245
        C.StringLn("  -ram            set size of RAM in bytes (MSP430) or Kbytes (STM32)"); C.Ln;
239
        C.StringLn("  -rom            set size of ROM in bytes (MSP430) or Kbytes (STM32)"); C.Ln;
246
        C.StringLn("  -rom            set size of ROM in bytes (MSP430) or Kbytes (STM32)"); C.Ln;
-
 
247
        C.StringLn("  -tab           set width for tabs"); C.Ln;
240
        UTILS.Exit(0)
248
        UTILS.Exit(0)
241
    END;
249
    END;
Line 242... Line 250...
242
 
250
 
243
    C.Dashes;
251
    C.Dashes;
Line 283... Line 291...
283
    STRINGS.append(lib_path, UTILS.slash);
291
    STRINGS.append(lib_path, UTILS.slash);
284
    STRINGS.append(lib_path, TARGETS.LibDir);
292
    STRINGS.append(lib_path, TARGETS.LibDir);
285
    STRINGS.append(lib_path, UTILS.slash);
293
    STRINGS.append(lib_path, UTILS.slash);
Line 286... Line 294...
286
 
294
 
-
 
295
    keys(options, outname);
287
    keys(options, outname);
296
    TEXTDRV.setTabSize(options.tab);
288
    IF outname = "" THEN
297
    IF outname = "" THEN
289
        outname := path;
298
        outname := path;
290
        STRINGS.append(outname, modname);
299
        STRINGS.append(outname, modname);
291
        STRINGS.append(outname, TARGETS.FileExt)
300
        STRINGS.append(outname, TARGETS.FileExt)