Commit Graph

133 Commits

Author SHA1 Message Date
Irmen de Jong
f89f1a84d0 @initonce variable tag to skip variable reinitialization 2024-11-08 19:03:48 +01:00
Irmen de Jong
9864abd393 romsub keyword is now extsub 2024-11-06 22:14:53 +01:00
Irmen de Jong
77e376f6bf romsub @bank now also accepts a variable so the bank can be dynamic 2024-11-06 00:02:36 +01:00
Irmen de Jong
85e87dfe2e consolidate @rombank and @rambank into just @bank 2024-11-03 21:15:11 +01:00
Irmen de Jong
155896c4c7 added @rombank and @rambank bank number tags on romsubs
on cx16 and c128 targets the compiler then automatically inserts a CALLFAR instead of a regular JSR to automatically do the bank switching.
2024-11-03 18:19:31 +01:00
Irmen de Jong
3b798097b9 added memtop to machine definition and asm source code check
added %memtop directive
2024-11-02 00:59:07 +01:00
Irmen de Jong
518e5a30c2 slight parser rule tweak 2024-10-29 23:18:17 +01:00
Irmen de Jong
a82f211f9a added alias statement 2024-10-28 00:36:10 +01:00
Irmen de Jong
504c80cddf fix parser rule for identifiers (void is a keyword, not an identifier) 2024-10-27 15:57:27 +01:00
Irmen de Jong
c9535049c8 %align directive and @align64 2024-10-26 20:58:35 +02:00
Irmen de Jong
1cd754f05d adding @alignword/page on individual variables 2024-10-26 17:00:38 +02:00
Irmen de Jong
9851d14fb9 added if expression: ubyte a = if b>0 44 else 55
it doesn't generate the best code yet, like regular ifs do.
2024-10-19 15:34:04 +02:00
Irmen de Jong
ce7d094adb Zig-like "defer" to clean up stuff when leaving the scope of the current routine. 2024-10-18 01:30:20 +02:00
Irmen de Jong
fff0d741c3 improved parsing of "not in" operator, and [] array signature (allow space) 2024-10-02 19:06:20 +02:00
Irmen de Jong
2da35fec17 remove requirement to end subroutine with an EOL, so oneliners are now possible
main { sub start() { cx16.r0++ cx16.r1++ } }
2024-09-01 20:55:43 +02:00
Irmen de Jong
0dc50a93a4 added @nozp variable flag 2024-05-21 21:53:58 +02:00
Irmen de Jong
f4b50368ba fix grammar: if_xx with else part 2024-04-09 22:35:30 +02:00
Irmen de Jong
641f6c05d8 allow 'void' as dummy assign target in multi-assignment statements 2024-03-31 23:43:26 +02:00
Irmen de Jong
788f6b44a6 antlr grammar now understands underscores in identifier names 2024-03-31 00:31:10 +01:00
Irmen de Jong
edc83305a4 allow multiple targets in AssignTarget 2024-03-22 21:51:08 +01:00
Irmen de Jong
d28c994ecd directive really needs to be listed out in the parser otherwise it confuses it with % modulo :-(
Also fix missing const fold pass in optimizer
2023-12-29 03:45:20 +01:00
Irmen de Jong
2b8f613a00 added %option ignore_unused to suppress warnings about unused vars and subs in that module/block.
Also improved error for invalid directive.
2023-12-26 23:37:59 +01:00
Irmen de Jong
b7279a3d9e fix 'not in' parsing error
fixes #115
2023-12-19 19:49:25 +01:00
Irmen de Jong
ef1c665b9a allow underscores for numerical grouping 2023-12-09 13:13:34 +01:00
Irmen de Jong
1bdc427d73 multi var declarations ubyte x,y,z 2023-12-08 22:18:21 +01:00
Irmen de Jong
6a639ce533 chained assignments x=y=z=42 2023-12-08 01:07:16 +01:00
Irmen de Jong
8e4319cd5a module directive %encoding to set the text encoding for that whole file (iso, petscii, etc.) 2023-12-06 23:54:08 +01:00
Irmen de Jong
f998888d6d fix some unicode identifier issues 2023-12-05 17:38:23 +01:00
Irmen de Jong
7d8b42d63e allow Unicode letters in identifiers: things like 'knäckebröd' and 'π' are now valid identifiers. Added floats.π constant. 2023-12-05 01:36:54 +01:00
Irmen de Jong
c45fbe6310 continue stmt added 2023-11-25 01:14:35 +01:00
Irmen de Jong
6a40f23578 cx16: added bmx library module and showbmx example 2023-11-24 23:39:05 +01:00
Irmen de Jong
d73709653d remove unused interned strings in the resulting code (for example from removed if/else blocks) 2023-11-12 05:28:24 +01:00
Irmen de Jong
f68b46fc60 add a %zpallowed option to specify the range of zeropage register that can be used 2023-11-03 00:19:25 +01:00
Irmen de Jong
880c0a5da8 allow taking address of array element 2023-09-18 04:37:41 +02:00
Irmen de Jong
95e4490a8a adding setlsb() and setmsb() builtin functions 2023-09-15 02:39:16 +02:00
Irmen de Jong
c15c10a94e fixed 'unroll CONSTANTEXPR' compiler errors 2023-09-05 01:03:35 +02:00
Irmen de Jong
525a9b5036 prepare parser to allow chained array indexing later 2023-09-03 19:06:47 +02:00
Irmen de Jong
66857ca477 prepare parser to be more flexible with array indexed expressions 2023-08-15 13:07:01 +02:00
Irmen de Jong
7c0bde7310 parser: allow curly brace on next line for asmsub too
downgrade antlr4 one version again to what is used in IntelliJ's antlr plugin, to avoid potential version conflicts
2023-08-09 20:01:12 +02:00
Irmen de Jong
5af1aeb092 added block comment /* ...... */ 2023-07-04 00:46:29 +02:00
Irmen de Jong
e7b631b087 allow comment lines inside array initializer value 2023-06-27 23:30:37 +02:00
Irmen de Jong
0a83b51e00 allow more curly brace styles 2023-06-27 01:59:22 +02:00
Irmen de Jong
eab63ecc6c allow curly brace on next line also after subroutine and when 2023-06-27 01:29:25 +02:00
Irmen de Jong
52a77db60f adding split array type 2023-05-26 19:11:07 +02:00
Irmen de Jong
f67d5faeb7 allow .123 as float literal syntax. Fixes #103 2023-03-26 21:09:15 +02:00
Irmen de Jong
fd25e85d59 added unroll loop construct 2023-03-14 23:37:49 +01:00
Irmen de Jong
25199dfb43 change tokenizer so that A,X,Y now are parsed correctly as identifiers as well 2023-03-08 22:57:19 +01:00
Irmen de Jong
1860f66de5 allow "x not in array" as equivalent to "not x in array"
update antlr parsing lib
2022-12-23 17:59:56 +01:00
Irmen de Jong
0d4dd385b8 added '%ir' to write inline IR code, '%asm' is now only for real 6502 assembly.
(%ir is probably only used in the library modules for the virtual machine target)
2022-09-30 15:12:26 +02:00
Irmen de Jong
bb5ffb24a8 add IDEA antlr parser build info to documentation 2022-08-21 13:32:31 +02:00