OpenCores
URL https://opencores.org/ocsvn/lattice6502/lattice6502/trunk

Subversion Repositories lattice6502

[/] [lattice6502/] [ghdl/] [crasm.lang] - Rev 2

Compare with Previous | Blame | View Log

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

Hacker: Ian Chapman hacked vhdl.lang to work with crasm.
        despite my hack it looks better than plain text.
        This supports the 6502 instruction not Z80 or others.
        Enjoy and improve

Author: Jürg Billeter <j@bitron.ch>
 Copyright (C) 2005 Jürg Billeter <j@bitron.ch>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Library General Public
 License as published by the Free Software Foundation; either
 version 2 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Library General Public License for more details.

 You should have received a copy of the GNU Library General Public
 License along with this library; if not, write to the
 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.

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

  <styles>
    <style id="comment" _name="Comment" map-to="def:comment"/>
    <style id="string" _name="String" map-to="def:string"/>
    <style id="character" _name="Character" map-to="def:character"/>
    <style id="keyword" _name="Keyword" map-to="def:keyword"/>
    <style id="type" _name="Type" map-to="def:type"/>
    <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
    <style id="base-n-number" _name="Base-N Integer" map-to="def:base-n-integer"/>
    <style id="real" _name="Real number" map-to="def:floating-point"/>
    <style id="number" _name="Number" map-to="def:number"/>
  </styles>

  <default-regex-options case-sensitive="false"/>

  <definitions>

    <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
      <start>;</start>
      <include>
        <context ref="def:in-line-comment"/>
      </include>
    </context>

    <context id="string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
      <start>"</start>
      <end>"</end>
    </context>

    <context id="character" style-ref="string">
      <match>'.'</match>
    </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>cpy</keyword>
      <keyword>cpx</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>
      <keyword>phx</keyword>
      <keyword>phy</keyword>
      <keyword>plx</keyword>
      <keyword>ply</keyword>
      <keyword>bbr0</keyword>
      <keyword>bbr1</keyword>
      <keyword>bbr2</keyword>
      <keyword>bbr3</keyword>
      <keyword>bbr4</keyword>
      <keyword>bbr5</keyword>
      <keyword>bbr6</keyword>
      <keyword>bbr7</keyword>
      <keyword>bbs0</keyword>
      <keyword>bbs1</keyword>
      <keyword>bbs2</keyword>
      <keyword>bbs3</keyword>
      <keyword>bbs4</keyword>
      <keyword>bbs5</keyword>
      <keyword>bbs6</keyword>
      <keyword>bbs7</keyword>
      <keyword>bra</keyword>
      <keyword>rmb</keyword>
      <keyword>smb</keyword>
      <keyword>stp</keyword>
      <keyword>stz</keyword>
      <keyword>trb</keyword>
      <keyword>tsb</keyword>
      <keyword>wai</keyword>
    </context>

    <context id="types" style-ref="type">
      <keyword>cpu</keyword>
      <keyword>page</keyword>
      <keyword>output</keyword>
      <keyword>dummy</keyword>
      <keyword>if</keyword>
      <keyword>else</keyword>
      <keyword>endc</keyword>
      <keyword>macro</keyword>
      <keyword>endm</keyword>
      <keyword>exitm</keyword>
      <keyword>include</keyword>
      <keyword>skip</keyword>
      <keyword>fail</keyword>
      <keyword>list</keyword>
      <keyword>clist</keyword>
      <keyword>mlist</keyword>
      <keyword>nam</keyword>
      <keyword>db</keyword>
      <keyword>dw</keyword>
      <keyword>asc</keyword>
      <keyword>equ</keyword>
      <keyword>integer</keyword>      
    </context>

    <context id="boolean" style-ref="boolean">
      <keyword>false</keyword>
      <keyword>true</keyword>
    </context>

    <define-regex id="hexnum">[0-9a-f][0-9a-f_]*</define-regex>
    <define-regex id="exponent">[Ee][+-]?[0-9][0-9_]*</define-regex>

    <context id="base-n-number" style-ref="base-n-number">
      <match extended="true">
        (?&lt;![\w\.])
        [0-9][0-9_]*\#\%{hexnum}(\.\%{hexnum})?\#\%{exponent}?
        (?![\w\.])
      </match>
    </context>

    <context id="real" style-ref="real">
      <match extended="true">
        (?&lt;![\w\.])
        [0-9][0-9_]*\.[0-9][0-9_]*\%{exponent}?
        (?![\w\.])
      </match>
    </context>

    <context id="number" style-ref="number">
      <match extended="true">
        (?&lt;![\w\.])
        [0-9][0-9_]*(E[+]?[0-9][0-9_]*)?
        (?![\w\.])
      </match>
    </context>

    <context id="crasm" class="no-spell-check">
      <include>
        <context ref="line-comment"/>
        <context ref="string"/>
        <context ref="character"/>
        <context ref="keywords"/>
        <context ref="types"/>
        <context ref="boolean"/>
        <context ref="base-n-number"/>
        <context ref="real"/>
        <context ref="number"/>
      </include>
    </context>

  </definitions>

</language>

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.