diff --git a/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeModule.xtend b/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeModule.xtend new file mode 100644 index 0000000..340b9ca --- /dev/null +++ b/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeModule.xtend @@ -0,0 +1,11 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ide + + +/** + * Use this class to register ide components. + */ +class Z80IdeModule extends AbstractZ80IdeModule { +} diff --git a/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeSetup.xtend b/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeSetup.xtend new file mode 100644 index 0000000..396eea8 --- /dev/null +++ b/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeSetup.xtend @@ -0,0 +1,20 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ide + +import com.google.inject.Guice +import org.eclipse.xtext.util.Modules2 +import org.efry.z80editor.Z80RuntimeModule +import org.efry.z80editor.Z80StandaloneSetup + +/** + * Initialization support for running Xtext languages as language servers. + */ +class Z80IdeSetup extends Z80StandaloneSetup { + + override createInjector() { + Guice.createInjector(Modules2.mixin(new Z80RuntimeModule, new Z80IdeModule)) + } + +} diff --git a/org.efry.z80editor.target/org.efry.z80editor.target.target b/org.efry.z80editor.target/org.efry.z80editor.target.target new file mode 100644 index 0000000..e1e9580 --- /dev/null +++ b/org.efry.z80editor.target/org.efry.z80editor.target.target @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.efry.z80editor.target/pom.xml b/org.efry.z80editor.target/pom.xml new file mode 100644 index 0000000..d2db1f7 --- /dev/null +++ b/org.efry.z80editor.target/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + + org.efry.z80editor + org.efry.z80editor.parent + 1.0.0-SNAPSHOT + + org.efry.z80editor.target + eclipse-target-definition + + + + + diff --git a/org.efry.z80editor.ui.tests/META-INF/MANIFEST.MF b/org.efry.z80editor.ui.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000..000ae58 --- /dev/null +++ b/org.efry.z80editor.ui.tests/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Automatic-Module-Name: org.efry.z80editor.ui.tests +Bundle-ManifestVersion: 2 +Bundle-Name: org.efry.z80editor.ui.tests +Bundle-Vendor: My Company +Bundle-Version: 1.0.0.qualifier +Bundle-SymbolicName: org.efry.z80editor.ui.tests; singleton:=true +Bundle-ActivationPolicy: lazy +Require-Bundle: org.efry.z80editor.ui, + org.junit.jupiter.api;bundle-version="[5.0.0,6.0.0)", + org.eclipse.xtext.testing, + org.eclipse.xtext.xbase.testing, + org.eclipse.xtext.xbase.junit, + org.eclipse.core.runtime, + org.eclipse.xtext.ui.testing, + org.eclipse.ui.workbench;resolution:=optional +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: org.efry.z80editor.ui.tests;x-internal=true diff --git a/org.efry.z80editor.ui.tests/pom.xml b/org.efry.z80editor.ui.tests/pom.xml new file mode 100644 index 0000000..2600dcc --- /dev/null +++ b/org.efry.z80editor.ui.tests/pom.xml @@ -0,0 +1,28 @@ + + 4.0.0 + + org.efry.z80editor + org.efry.z80editor.parent + 1.0.0-SNAPSHOT + + org.efry.z80editor.ui.tests + eclipse-test-plugin + + + + + org.eclipse.xtend + xtend-maven-plugin + + + org.eclipse.tycho + tycho-surefire-plugin + + true + + + + + + diff --git a/org.efry.z80editor.ui/resources/z80opCodes/cp.html b/org.efry.z80editor.ui/resources/z80opCodes/cp.html index f8b29d1..63d624e 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/cp.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/cp.html @@ -20,6 +20,7 @@

Syntax

cp ixl cp iyh cp iyl +cp (hl) cp (ix+n) cp (iy+n) cp n ;8 bit constant diff --git a/org.efry.z80editor.ui/resources/z80opCodes/ex.html b/org.efry.z80editor.ui/resources/z80opCodes/ex.html index 0ab8a2a..ca551ce 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/ex.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/ex.html @@ -35,10 +35,10 @@

T-States

(sp),ix -19 +23 (sp),iy -19 +23 diff --git a/org.efry.z80editor.ui/resources/z80opCodes/exx.html b/org.efry.z80editor.ui/resources/z80opCodes/exx.html index 8f7e1a4..f55e995 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/exx.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/exx.html @@ -1,4 +1,4 @@ -

EXX exchanges BC, DE, and HL with shadow registers with BC', DE', and HL'.

+

EXX exchanges BC, DE, and HL with shadow registers BC', DE', and HL'.

Syntax

diff --git a/org.efry.z80editor.ui/resources/z80opCodes/jr.html b/org.efry.z80editor.ui/resources/z80opCodes/jr.html
index aca7054..a1fbe52 100644
--- a/org.efry.z80editor.ui/resources/z80opCodes/jr.html
+++ b/org.efry.z80editor.ui/resources/z80opCodes/jr.html
@@ -2,14 +2,14 @@
 

Syntax

-JP NN            ;unconditional jump
-JP cond.,NN        ;conditional jump
+JR NN            ;unconditional jump
+JR cond.,NN        ;conditional jump
 

Allowed Instructions

 ;Constants
-JP NN        ;no contition
+JR NN        ;no contition
 JR C,NN        ;jumps if C is set
 JR NC,NN        ;jumps if C is reset
 JR Z,NN        ;jumps if Z is set
@@ -19,7 +19,7 @@ 

Effects

All flags preserved.

Uses

T-States

-

cc is condition: NZ, Z, NC, C, PO, PE, P, M

+

cc is condition: NZ, Z, NC, C

diff --git a/org.efry.z80editor.ui/resources/z80opCodes/ld.html b/org.efry.z80editor.ui/resources/z80opCodes/ld.html index 937bafa..c769389 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/ld.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/ld.html @@ -735,7 +735,7 @@

Syntax

- + @@ -765,7 +765,7 @@

Syntax

- + @@ -801,16 +801,16 @@

Syntax

X x
x

Effects

-

No flags are altered except in the cases of the I or R registers.

+

No flags are altered except in the cases of loading the I or R registers into A.

In those cases, C is preserved, H and N are reset, and alters Z and S. P/V is set if interrupts are enabled, reset otherwise.

Uses

Use to load numbers into operands. They can either be numbers used in the code (usually 8-bits), or labels (usually 16-bits).

-ld b,$05    ;Counter
+ld b,$05     ;Counter
 
 ld hl,var    ;Variable label
-ld a,(var)    ;Write data to var
+ld (var),a   ;Write data to var
 

T-States

r denotes 8-bit register.
@@ -821,20 +821,20 @@

T-States

4 -r,X +r, X 7 -r,(hl) +r, (hl) 7 -r,(ix+X) -19 +(hl), r +7 -r,(iy+X) -19 +(hl), X +10 a, (bc) @@ -853,31 +853,7 @@

T-States

7 -(de),a -7 - - -(XX),a -13 - - -a, i -9 - - -a, r -9 - - -i, a -9 - - -r, a -9 - - -a, (BC) +(de), a 7 @@ -885,7 +861,7 @@

T-States

13 -rr,XX +rr, XX 10 @@ -898,7 +874,7 @@

T-States

hl, (XX) -20 +16 ix, (XX) @@ -910,7 +886,7 @@

T-States

(XX), hl -20 +16 (XX), rr @@ -925,6 +901,46 @@

T-States

20 +r, (ix+X) +19 + + +r, (iy+X) +19 + + +(ix+X), r +19 + + +(iy+X), r +19 + + +(ix+X), X +19 + + +(iy+X), X +19 + + +a, I +9 + + +a, R +9 + + +I, a +9 + + +R, a +9 + + sp, hl 6 @@ -936,4 +952,17 @@

T-States

sp, iy 10 + +sp, XX +10 + + +sp, (XX) +20 + + +(XX), sp +20 + + diff --git a/org.efry.z80editor.ui/resources/z80opCodes/rl.html b/org.efry.z80editor.ui/resources/z80opCodes/rl.html index da7a1d2..1ae398d 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/rl.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/rl.html @@ -11,6 +11,7 @@

Allowed Instructions

RL B RL C RL D +RL E RL H RL L RL (HL) diff --git a/org.efry.z80editor.ui/src/org/efry/z80editor/ui/Z80UiModule.xtend b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/Z80UiModule.xtend new file mode 100644 index 0000000..e696a40 --- /dev/null +++ b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/Z80UiModule.xtend @@ -0,0 +1,13 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ui + +import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor + +/** + * Use this class to register components to be used within the Eclipse IDE. + */ +@FinalFieldsConstructor +class Z80UiModule extends AbstractZ80UiModule { +} diff --git a/org.efry.z80editor.ui/src/org/efry/z80editor/ui/contentassist/Z80ProposalProvider.xtend b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/contentassist/Z80ProposalProvider.xtend new file mode 100644 index 0000000..792c9ea --- /dev/null +++ b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/contentassist/Z80ProposalProvider.xtend @@ -0,0 +1,12 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ui.contentassist + + +/** + * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#content-assist + * on how to customize the content assistant. + */ +class Z80ProposalProvider extends AbstractZ80ProposalProvider { +} diff --git a/org.efry.z80editor.ui/src/org/efry/z80editor/ui/labeling/Z80DescriptionLabelProvider.xtend b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/labeling/Z80DescriptionLabelProvider.xtend new file mode 100644 index 0000000..c639968 --- /dev/null +++ b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/labeling/Z80DescriptionLabelProvider.xtend @@ -0,0 +1,24 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ui.labeling + +import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider + +/** + * Provides labels for IEObjectDescriptions and IResourceDescriptions. + * + * https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#label-provider + */ +class Z80DescriptionLabelProvider extends DefaultDescriptionLabelProvider { + + // Labels and icons can be computed like this: + +// override text(IEObjectDescription ele) { +// ele.name.toString +// } +// +// override image(IEObjectDescription ele) { +// ele.EClass.name + '.gif' +// } +} diff --git a/org.efry.z80editor.ui/src/org/efry/z80editor/ui/quickfix/Z80QuickfixProvider.xtend b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/quickfix/Z80QuickfixProvider.xtend new file mode 100644 index 0000000..b1cea62 --- /dev/null +++ b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/quickfix/Z80QuickfixProvider.xtend @@ -0,0 +1,24 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ui.quickfix + +import org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider + +/** + * Custom quickfixes. + * + * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#quick-fixes + */ +class Z80QuickfixProvider extends DefaultQuickfixProvider { + +// @Fix(Z80Validator.INVALID_NAME) +// def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) { +// acceptor.accept(issue, 'Capitalize name', 'Capitalize the name.', 'upcase.png') [ +// context | +// val xtextDocument = context.xtextDocument +// val firstLetter = xtextDocument.get(issue.offset, 1) +// xtextDocument.replace(issue.offset, 1, firstLetter.toUpperCase) +// ] +// } +} diff --git a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext index f095134..a277d12 100644 --- a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext +++ b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext @@ -28,15 +28,15 @@ Z80Model: REGISTER_IXL: 'ixl'; REGISTER_IYH: 'iyh'; REGISTER_IYL: 'iyl'; - + DOT: '.'; terminal NEWLINE: // New line on DOS or Unix '\r'? '\n'; - - -VarName: '_sizeof_' | 'a' | 'adc' | 'add' | 'af' | 'align' | 'and' | 'args' | 'asc' | 'asciitable' | 'asctable' | 'asm' | 'b' | 'bank' | 'banks' | 'banksize' | 'bankstotal' | 'bc' | 'bit' | 'byt' | 'c' | 'call' | 'ccf' | 'cp' | 'cpd' | 'cpdr' | 'cpi' | 'cpir' | 'cpl' | 'd' | 'daa' | 'db' | 'de' | 'dec' | 'def' | 'defaultslot' | 'define' | 'desc' | 'di' | 'djnz' | 'ds' | 'dsb' | 'dsw' | 'dw' | 'e' | 'ei' | 'else' | 'emptyfill' | 'enda' | 'endasm' | 'ende' | 'endif' | 'endm' | 'endme' | 'endr' | 'endro' | 'ends' | 'endst' | 'enum' | 'equ' | 'ex' | 'export' | 'exx' | 'filter' | 'force' | 'free' | 'fsize' | 'h' | 'halt' | 'hl' | 'i' | 'if' | 'ifdef' | 'ifdefm' | 'ifeq' | 'ifexists' | 'ifgr' | 'ifgreq' | 'ifle' | 'ifleeq' | 'ifndef' | 'ifndefm' | 'ifneq' | 'im' | 'in' | 'inc' | 'incbin' | 'include' | 'ind' | 'indr' | 'ini' | 'inir' | 'instanceof' | 'ix' | 'iy' | 'jp' | 'jr' | 'l' | 'ld' | 'ldd' | 'lddr' | 'ldi' | 'ldir' | 'm' | 'macro' | 'map' | 'memorymap' | 'nargs' | 'nc' | 'neg' | 'nop' | 'nz' | 'or' | 'org' | 'otdr' | 'otir' | 'out' | 'outd' | 'outi' | 'overwrite' | 'p' | 'pe' | 'po' | 'pop' | 'push' | 'r' | 'ramsection' | 'read' | 'redef' | 'redefine' | 'repeat' | 'rept' | 'res' | 'ret' | 'reti' | 'retn' | 'rl' | 'rla' | 'rlc' | 'rlca' | 'rld' | 'rombankmap' | 'rr' | 'rra' | 'rrc' | 'rrca' | 'rrd' | 'rst' | 'sbc' | 'scf' | 'sdsctag' | 'section' | 'semifree' | 'set' | 'skip' | 'sla' | 'slot' | 'slotsize' | 'smstag' | 'sp' | 'sra' | 'srl' | 'struct' | 'sub' | 'superfree' | 'swap' | 'to' | 'undef' | 'undefine' | 'xor' | 'z' | ID; + + +VarName: '_sizeof_' | 'a' | 'adc' | 'add' | 'af' | 'align' | 'and' | 'args' | 'asc' | 'asciitable' | 'asctable' | 'asm' | 'b' | 'bank' | 'banks' | 'banksize' | 'bankstotal' | 'bc' | 'bit' | 'byt' | 'c' | 'call' | 'ccf' | 'cp' | 'cpd' | 'cpdr' | 'cpi' | 'cpir' | 'cpl' | 'd' | 'daa' | 'db' | 'de' | 'dec' | 'def' | 'defaultslot' | 'define' | 'desc' | 'di' | 'djnz' | 'ds' | 'dsb' | 'dstruct' | 'dsw' | 'dw' | 'e' | 'ei' | 'else' | 'emptyfill' | 'enda' | 'endasm' | 'ende' | 'endif' | 'endm' | 'endme' | 'endr' | 'endro' | 'ends' | 'endst' | 'enum' | 'equ' | 'ex' | 'export' | 'exx' | 'filter' | 'force' | 'free' | 'fsize' | 'h' | 'halt' | 'hl' | 'i' | 'if' | 'ifdef' | 'ifdefm' | 'ifeq' | 'ifexists' | 'ifgr' | 'ifgreq' | 'ifle' | 'ifleeq' | 'ifndef' | 'ifndefm' | 'ifneq' | 'im' | 'in' | 'inc' | 'incbin' | 'include' | 'ind' | 'indr' | 'ini' | 'inir' | 'instanceof' | 'ix' | 'iy' | 'jp' | 'jr' | 'l' | 'ld' | 'ldd' | 'lddr' | 'ldi' | 'ldir' | 'm' | 'macro' | 'map' | 'memorymap' | 'nargs' | 'nc' | 'neg' | 'nop' | 'nz' | 'or' | 'org' | 'otdr' | 'otir' | 'out' | 'outd' | 'outi' | 'overwrite' | 'p' | 'pe' | 'po' | 'pop' | 'push' | 'r' | 'ramsection' | 'read' | 'redef' | 'redefine' | 'repeat' | 'rept' | 'res' | 'ret' | 'reti' | 'retn' | 'rl' | 'rla' | 'rlc' | 'rlca' | 'rld' | 'rombankmap' | 'rr' | 'rra' | 'rrc' | 'rrca' | 'rrd' | 'rst' | 'sbc' | 'scf' | 'sdsctag' | 'section' | 'semifree' | 'set' | 'skip' | 'sla' | 'slot' | 'slotsize' | 'smstag' | 'sp' | 'sra' | 'srl' | 'struct' | 'sub' | 'superfree' | 'swap' | 'to' | 'undef' | 'undefine' | 'xor' | 'z' | ID; AsciiTableTag hidden(): DOT 'asciitable'; AscTableTag hidden(): DOT 'asctable'; @@ -49,6 +49,7 @@ DefineTag hidden(): DOT 'define'; DefTag hidden(): DOT 'def'; DsbTag hidden(): DOT 'dsb'; DsTag hidden(): DOT 'ds'; +DstructTag hidden(): DOT 'dstruct'; DswTag hidden(): DOT 'dsw'; DwTag hidden(): DOT 'dw'; ElseTag hidden(): DOT 'else'; @@ -100,10 +101,10 @@ UndefineTag hidden(): DOT 'undefine'; UndefTag hidden(): DOT 'undef'; Line: - (Macro | MacroUsage | Sms | EmptyFill | Asm | EndAsm | Define | Redefine | Undefine | MemoryMap | RomBankMap | SdscTagCmd | Bank | Org | Orga | Section | Slot | Struct | EnumCmd | RamSection | Rept | Asc | Dsb | Dsw | Db | Dw | IncludeType | - IfCommands | Label | Asciitable | Command) NEWLINE - | (Labels (c=(Command | Asc | Dsb | Dsw | Db | Dw)) NEWLINE) - | {EmptyLine} NEWLINE; + (Macro | MacroUsage | Sms | EmptyFill | Asm | EndAsm | Define | Redefine | Undefine | MemoryMap | RomBankMap | SdscTagCmd | Bank | Org | Orga | Section | Slot | Struct | Dstruct | EnumCmd | RamSection | Rept | Asc | Dsb | Dsw | Db | Dw | IncludeType | + IfCommands | Label | Asciitable | Command) NEWLINE + | (Labels (c=(Command | Asc | Dsb | Dsw | Db | Dw)) NEWLINE) + | {EmptyLine} NEWLINE; IfCommands: IfCmd | IfDefCmd | IfnDefCmd | IfDefMCmd | IfnDefMCmd | IExistsCmd | IfEqCmd | IfnEqCmd | IfLeCmd | IfLeeqCmd | IfGrCmd | IfGreqCmd; Labels: labels+=Label+; @@ -143,32 +144,33 @@ IfGreqCmd: IfGreqTag lhs=Expression rhs=NumericLiteral NEWLINE block+=Line* else MemoryMap: MemoryMapTag NEWLINE cmds+=MemoryMapCommands+ END_ME_TAG; MemoryMapCommands: {MemoryMapCommands} ('defaultslot' defaultSlot=INT NEWLINE) | - ('slotsize' size=NUMBER NEWLINE) | - ('slot' slotNumber=INT startKeyword=ID? startAddress=NUMBER 'size'? size=NUMBER? NEWLINE) + ('slotsize' size=NUMBER NEWLINE) | + ('slot' slotNumber=INT startKeyword=ID? startAddress=NUMBER 'size'? size=NUMBER? NEWLINE) ; RomBankMap: RomBankMapTag NEWLINE cmds+=RomBankCommands+ EndRoTag; RomBankCommands: ('bankstotal' (INT|HEX) NEWLINE) | - ('banksize' (INT|HEX) NEWLINE) | - ('banks' (INT|HEX) NEWLINE) + ('banksize' (INT|HEX) NEWLINE) | + ('banks' (INT|HEX) NEWLINE) ; -Rept: (RepeatTag|ReptTag) repeatCount=NumericLiteral NEWLINE block+=Line+ EndRTag; +Rept: (RepeatTag|ReptTag) repeatCount=NumericLiteral ('index' index=LabelType)? NEWLINE block+=Line+ EndRTag; Bank: {BankCmd} BankTag INT ('slot' slot=INT)?; Org: OrgTag value=(NUMBER); Orga: OrgaTag value=(NUMBER); -Section: SectionTag sectionName=STRING? ('size' size=NUMBER)? ('align' align=NUMBER)? ('force'|'semifree'|'free'|'superfree'|'overwrite'|'semisubfree')? NEWLINE lines+=Line+ END_S_TAG; +Section: SectionTag sectionName=STRING? ('size' size=NUMBER)? ('align' align=NUMBER)? ('offset' offset=NUMBER)? ('force'|'semifree'|'free'|'superfree'|'overwrite'|'semisubfree')? NEWLINE lines+=Line+ END_S_TAG; Slot: SlotTag value=(NUMBER); Struct: StructTag name=LabelType definitions+=VarDefinitionStruct* NEWLINE END_ST_TAG; +Dstruct: DstructTag name=LabelType ('values')? definitions+=VarDefinitionDstruct* NEWLINE END_ST_TAG; EnumCmd: EnumTag startAddress=Expression order=('asc'|'desc')? 'export'? NEWLINE (definitions+=(VarDefinitionEnum)|NEWLINE)* EndETag; -RamSection: RamSectionTag sectionName=STRING ('bank' bank=NUMBER)? ('slot' slot=NUMBER)? ('align' align=NUMBER)? NEWLINE (definitions+=VarDefinition|NEWLINE)* END_S_TAG; +RamSection: RamSectionTag sectionName=STRING ('bank' bank=NUMBER)? ('slot' slot=NUMBER)? ('org'|'orga' addr=NUMBER)? ('returnorg')? ('priority' prio=NUMBER)? ('force')? ('align' align=NUMBER)? ('offset' offset=NUMBER)? ('appendto' appto=LabelType)? NEWLINE (definitions+=VarDefinition|NEWLINE)* END_S_TAG; //VarDefinitionEnum: {VarDef} (varName=VarName ':'? type=(EnumType))? NEWLINE; @@ -176,6 +178,7 @@ VarDefinitionEnum: EnumType NEWLINE; EnumType: (VarByte|VarWord|VarByteString|VarWordString|VarStruct); +VarDefinitionDstruct: {VarDefinitionDstruct} NEWLINE ( name=ID type=(VarTypeByte|VarTypeWord|VarTypeByteString|VarTypeWordString))?; VarDefinitionStruct: {VarDefinitionStruct} NEWLINE ( name=ID type=(VarTypeByte|VarTypeWord|VarTypeByteString|VarTypeWordString))?; VarDefinition: (VarByte|VarWord|VarByteString|VarWordString|VarStruct) NEWLINE; @@ -236,7 +239,7 @@ DotExpression returns Ref hidden(): EntityRef returns Ref hidden(): {EntityRef} entity=[LabelType] (DOT structArrayIndex=INT)? -; +; Expression returns Expr: BitwiseOp; @@ -244,7 +247,7 @@ Expression returns Expr: BitwiseOp returns Expr: BitshiftOp ({BinaryExpr.left=current} op1=('|' | '&' | '~') right=Addition)*; - + BitshiftOp returns Expr: Addition ({BinaryExpr.left=current} op1=('<<' | '>>') right=Addition)*; @@ -265,7 +268,7 @@ UnaryMinus returns Expr: PrimaryExpression returns Expr: '(' Expression ')' | {NumLiteral} nibbleOp=('<'|'>')? value=NumericLiteral; - + Command: (Adc|Add|And|Bit|Call|Ccf|Cp|Cpd|Cpdr|Cpi|Cpir|Cpl|Daa|Dec|Di|Djnz|Ei|Ex|Exx|Halt|Im|In|Inc|Ind|Indr|Ini|Inir|Jp|Jr|Ld|Ldd|Lddr|Ldi|Ldir|Neg|Nop|Or|Otdr|Otir|Out|Outi|Outd|Pop|Push|Res|Ret|Reti|Retn|Rl|Rla|Rlc|Rlca|Rld|RrCmd|Rra|Rrc|Rrca|Rrd|Rst|Sbc|Scf|Set|Sla|Sra|Srl|Sub|Xor) ; @@ -380,7 +383,7 @@ dst returns Operand: =>indirectOp=NumericLiteralIndirect|op=(s|ss)|indirectOp=(B e returns Operand: (expr=Expression|anonLabel=(PLUS|PLUSPLUS|MINUS|MINUSMINUS|'_b'|'_f')); //fixme -126 to +129 m returns Operand: op=(r)|indirectOp=(HLIndirect|IndexIndirectPlusOffset); -p returns Operand: intType=NUMBER; //FIXME need to restrict to $0000, $0008, $0010, $0018, $0020, $0028, $0030 or $0038 +p returns Operand: intType=NUMBER; //FIXME need to restrict to $0000, $0008, $0010, $0018, $0020, $0028, $0030 or $0038 pp returns Operand: reg=(REGISTER_BC|REGISTER_DE|REGISTER_IX|REGISTER_SP); r returns Operand: reg=(REGISTER_A|REGISTER_B|REGISTER_C|REGISTER_D|REGISTER_E|REGISTER_H|REGISTER_L); rr returns Operand: reg=(REGISTER_BC|REGISTER_DE|REGISTER_IY|REGISTER_SP); diff --git a/org.efry.z80editor/src/org/efry/z80editor/Z80RuntimeModule.xtend b/org.efry.z80editor/src/org/efry/z80editor/Z80RuntimeModule.xtend new file mode 100644 index 0000000..53559b5 --- /dev/null +++ b/org.efry.z80editor/src/org/efry/z80editor/Z80RuntimeModule.xtend @@ -0,0 +1,11 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor + + +/** + * Use this class to register components to be used at runtime / without the Equinox extension registry. + */ +class Z80RuntimeModule extends AbstractZ80RuntimeModule { +} diff --git a/org.efry.z80editor/src/org/efry/z80editor/Z80StandaloneSetup.xtend b/org.efry.z80editor/src/org/efry/z80editor/Z80StandaloneSetup.xtend new file mode 100644 index 0000000..fad2a77 --- /dev/null +++ b/org.efry.z80editor/src/org/efry/z80editor/Z80StandaloneSetup.xtend @@ -0,0 +1,15 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor + + +/** + * Initialization support for running Xtext languages without Equinox extension registry. + */ +class Z80StandaloneSetup extends Z80StandaloneSetupGenerated { + + def static void doSetup() { + new Z80StandaloneSetup().createInjectorAndDoEMFRegistration() + } +}