gedit Syntax-Highlighting für ACME
Suche
Index
FAQ
Kontakt
Zurück
/usr/share/gtksourceview-2.0/language-specs/6502.lang

<?xml version="1.0" encoding="UTF-8"?>
<!--
k2src.lang

Syntax File for Highlighting, for gedit

Just copy it into e.g. /usr/share/gtksourceview-2.0/language-specs

Is especially suited for k2asm (e.g. dnc,python,ifdef) but should
be ok for any sane 6502 assembler.

[/] 2008 by Zed Yago/K2
Partly based on c.lang

[/] 2009 modified by cbmhardware/pol for ACME

-->
<language id="6502" _name="6502" version="2.0" _section="Sources">
  <metadata>
    <property name="mimetypes">text/x-k2src</property>
    <property name="globs">*.asm;*.inc;*.a</property>
    <property name="line-comment-start">;</property>
  </metadata>

  <styles>
    <style id="comment" _name="Comment" map-to="def:comment"/>
    <style id="doc" _name="Documentation" map-to="def:doc-comment-element"/>
    <style id="function" _name="Function" map-to="def:function"/>
    <style id="string" _name="String" map-to="def:string"/>
    <style id="keyword" _name="Keyword" map-to="def:keyword"/>
    <style id="base-n-integer" _name="Base-N Integer" map-to="def:base-n-integer"/>
    <style id="decimal" _name="Decimal" map-to="def:decimal"/>
    <style id="data-type" _name="Data Type" map-to="def:type"/>
    <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
  </styles>

  <definitions>

    <context id="line-comment-docstyle" style-ref="doc" end-at-line-end="true">
      <start>;;</start>
      <include>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/>
      </include>
    </context>

    <context id="line-comment" style-ref="comment" end-at-line-end="true">
      <start>;</start>
      <include>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/>
      </include>
    </context>


    <context id="ifzero-comment" style-ref="comment">
      <start>^[ t]*#[ t]*if[ t]*0</start>
      <end>[ t]*#[ t]*(endif|else)</end>
      <include>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/>
      </include>
    </context>
<!--
    <context id="python-block" style-ref="function">
      <start>^#pybegin</start>
      <end>^#pyend</end>
      <include>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/> 
      </include>
    </context>
-->

        <context id="python-block">
            <start>^#pybegin</start>
            <end>^;pyend</end>

            <include>
                <context sub-pattern="0" where="start" style-ref="function"/>
                <context ref="python:python"/>
                <context sub-pattern="0" where="end" style-ref="function"/>
            </include>
        </context>

    <context id="shell-exec" end-at-line-end="true" style-ref="preprocessor">
      <start>#system</start>
            <include>
                <context ref="sh:sh"/>
            </include>
        </context>
         
    <context id="string" style-ref="string" end-at-line-end="true">
      <start>"</start>
      <end>"</end>
      <include>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/>
      </include>
    </context>
    <context id="include-pragma" style-ref="preprocessor" end-at-line-end="true">
      <start>^#[ t]*(include|pragma)</start>
      <include>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/>
      </include>
    </context>
    <context id="keywords" style-ref="keyword">
      <keyword>adc</keyword>
      <keyword>and</keyword>
      <keyword>asl</keyword>
      <keyword>bcc</keyword>
      <keyword>bcs</keyword>
      <keyword>beq</keyword>
      <keyword>bit</keyword>
      <keyword>bmi</keyword>
      <keyword>bne</keyword>
      <keyword>bpl</keyword>
      <keyword>brk</keyword>
      <keyword>bvc</keyword>
      <keyword>bvs</keyword>
      <keyword>clc</keyword>
      <keyword>cld</keyword>
      <keyword>cli</keyword>
      <keyword>clv</keyword>
      <keyword>cmp</keyword>
      <keyword>cpx</keyword>
      <keyword>cpy</keyword>
      <keyword>dec</keyword>
      <keyword>dex</keyword>
      <keyword>dey</keyword>
      <keyword>eor</keyword>
      <keyword>inc</keyword>
      <keyword>inx</keyword>
      <keyword>iny</keyword>
      <keyword>jmp</keyword>
      <keyword>jsr</keyword>
      <keyword>lda</keyword>
      <keyword>ldx</keyword>
      <keyword>ldy</keyword>
      <keyword>lsr</keyword>
      <keyword>nop</keyword>
      <keyword>ora</keyword>
      <keyword>pha</keyword>
      <keyword>php</keyword>
      <keyword>pla</keyword>
      <keyword>plp</keyword>
      <keyword>rol</keyword>
      <keyword>ror</keyword>
      <keyword>rti</keyword>
      <keyword>rts</keyword>
      <keyword>sbc</keyword>
      <keyword>sec</keyword>
      <keyword>sed</keyword>
      <keyword>sei</keyword>
      <keyword>sta</keyword>
      <keyword>stx</keyword>
      <keyword>sty</keyword>
      <keyword>tax</keyword>
      <keyword>tay</keyword>
      <keyword>tsx</keyword>
      <keyword>txa</keyword>
      <keyword>txs</keyword>
      <keyword>tya</keyword>
    </context>
    <context id="types" style-ref="data-type">
      <prefix>!</prefix>
      <suffix></suffix>
      <keyword>to</keyword>
      <keyword>org</keyword>
      <keyword>byte</keyword>
      <keyword>word</keyword>
      <keyword>pet</keyword>
      <keyword>scr</keyword>
      <keyword>cpu</keyword>
      <keyword>bin</keyword>
    </context>

    <context id="mem" style-ref="data-type">
      <prefix>*</prefix>
      <suffix></suffix>
      <keyword>=</keyword>
    </context>





    <context id="character-constant" style-ref="string" end-at-line-end="true">
      <start>'</start>
      <end>'</end>
      <include>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/>
      </include>
    </context>
    <context id="decimal" style-ref="decimal">
      <match>#[0-9?]+</match>
    </context>
    <context id="binary-number" style-ref="base-n-integer">
      <match>%[01?#.]+</match>
    </context>
    <context id="hex-number" style-ref="base-n-integer">
      <match>$[0-9a-fA-F?]+</match>
    </context>
    <context id="common-macro" style-ref="preprocessor">
      <keyword>NULL</keyword>
      <keyword>TRUE</keyword>
      <keyword>FALSE</keyword>
      <keyword>MAX</keyword>
      <keyword>MIN</keyword>
      <keyword>__LINE__</keyword>
      <keyword>__DATA__</keyword>
      <keyword>__FILE__</keyword>
      <keyword>__func__</keyword>
      <keyword>__TIME__</keyword>
      <keyword>__STDC__</keyword>
    </context>
    <context id="preprocessor-definitions" style-ref="preprocessor">
      <prefix>^[ t]*#[ t]*</prefix>
      <keyword>if</keyword>
      <keyword>ifdef</keyword>
      <keyword>ifndef</keyword>
      <keyword>else</keyword>
      <keyword>elif</keyword>
      <keyword>define</keyword>
      <keyword>endif</keyword>
      <keyword>undef</keyword>
      <keyword>error</keyword>
      <keyword>pragma</keyword>
      <keyword>line</keyword>
    </context>
    <context id="label" style-ref="function">
     <match>[ t]*[_a-zA-Z][_a-zA-Z0-9]+:</match>
    </context>
    <context id="6502">
      <include>
        <context ref="line-comment-docstyle"/>
        <context ref="line-comment"/>
        <context ref="ifzero-comment"/>
        <context ref="python-block"/>
        <context ref="shell-exec"/>
        <context ref="string"/>
        <context ref="include-pragma"/>
        <context ref="keywords"/>
        <context ref="types"/>
        <context ref="mem"/>
        <context ref="character-constant"/>
        <context ref="decimal"/>
        <context ref="binary-number"/>
        <context ref="hex-number"/>
        <context ref="common-macro"/>
        <context ref="preprocessor-definitions"/>
	<context ref="label"/>
      </include>
    </context>
  </definitions>
</language>

 

Letzte Änderung: 2019-01-04 10:04:14
  Rubrik:  CBM PET
Rubriken-Übersicht
 7 Besucher online 

Valid XHTML 1.0 Transitional Valid CSS!