Irmen de Jong
efd41260f2
added %jmptable
2025-02-09 15:02:59 +01:00
Irmen de Jong
ca9422bbe9
be able to parse multiple return values (sub + return)
2025-01-07 01:51:54 +01:00
Irmen de Jong
5482ac0302
simplify grammar of @tags, also improving their error message
2024-12-21 01:44:58 +01:00
Irmen de Jong
b01555d75e
cx16.set_screen_mode() no longer returns anything.
...
tweak when codegen slightly.
allow trailing comma in array literals.
set_screen_mode failure status is really uncommon and still returned by the real kernal routine screen_mode().
2024-12-19 20:56:07 +01:00
Irmen de Jong
3804fba0f1
moved jdk version config back to main gradle build file, version consistency
2024-12-19 13:39:27 +01:00
Irmen de Jong
e7a0cb636c
add $< and $> operators to get the lsb and msb addresses of a @split array respectively.
...
document the new split array things.
2024-12-16 17:45:54 +01:00
Irmen de Jong
80d88b3c61
fix many split array issues
2024-12-15 17:08:07 +01:00
Irmen de Jong
8f799567cf
make word arrays split by default (w.i.p.)
2024-12-15 08:12:34 +01:00
Irmen de Jong
cc59069876
allow goto to take any expression, not only an integer or an identifier (part 1)
2024-12-14 01:01:32 +01:00
Irmen de Jong
181f3e9eb1
remove the unary/prefix operators ^ and << again
2024-12-01 20:50:33 +01:00
Irmen de Jong
5c6bd9c091
register params support for normal subroutines
2024-11-24 15:56:54 +01:00
Irmen de Jong
cb86206698
added unary ^ and << operators (experimental) (gets bank and address of a long integer)
2024-11-24 03:07:18 +01:00
Irmen de Jong
844c97930f
fix Antlr grammar build and convert final build.gradle to build.gradle.kts (kotlin DSL)
2024-11-20 23:23:26 +01:00
Irmen de Jong
5c09dc10ae
convert build.gradle to build.gradle.kts (kotlin DSL)
2024-11-20 23:23:26 +01:00
Irmen de Jong
35c477b5a6
Make extsub address a (constant) expression instead of a numeric literal
...
this makes it easier to define API jump tables
2024-11-20 23:23:26 +01:00
Irmen de Jong
a874aec6a1
implementing const long
2024-11-20 23:22:56 +01:00
Irmen de Jong
fb0d9b46b0
remove 'romsub' as a recognised alternative for 'extsub'
2024-11-20 23:22:56 +01:00
Irmen de Jong
64164c1c72
changed @initonce to @dirty and meaning is now: not initialized at all.
2024-11-08 22:05:31 +01:00
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
453e8bd0a0
update kotlin and antlr libs
2024-08-19 12:47:18 +02:00
Irmen de Jong
0dc50a93a4
added @nozp variable flag
2024-05-21 21:53:58 +02:00
Irmen de Jong
c719e274d5
java version tweaks
2024-05-18 20:25:44 +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