Class: Rouge::Lexers::M68k

Inherits:
RegexLexer show all
Defined in:
lib/rouge/lexers/m68k.rb

Constant Summary

Constants inherited from RegexLexer

RegexLexer::MAX_NULL_SCANS

Constants included from Token::Tokens

Token::Tokens::Num, Token::Tokens::Str

Instance Attribute Summary

Attributes inherited from Rouge::Lexer

#options

Class Method Summary collapse

Methods inherited from RegexLexer

append, #delegate, get_state, #get_state, #goto, #group, #groups, #in_state?, #pop!, prepend, #push, #recurse, replace_state, #reset!, #reset_stack, #stack, start, start_procs, #state, state, #state?, state_definitions, states, #step, #stream_tokens, #token

Methods inherited from Rouge::Lexer

aliases, all, #as_bool, #as_lexer, #as_list, #as_string, #as_token, assert_utf8!, #bool_option, #continue_lex, continue_lex, debug_enabled?, demo, demo_file, desc, detect?, detectable?, disable_debug!, enable_debug!, filenames, find, find_fancy, guess, guess_by_filename, guess_by_mimetype, guess_by_source, guesses, #hash_option, #initialize, lex, #lex, #lexer_option, #list_option, lookup_fancy, mimetypes, option, option_docs, #reset!, #stream_tokens, #string_option, tag, #tag, title, #token_option, #with

Methods included from Token::Tokens

token

Constructor Details

This class inherits a constructor from Rouge::Lexer

Class Method Details

.builtinsObject



69
70
71
72
73
74
75
# File 'lib/rouge/lexers/m68k.rb', line 69

def self.builtins
  @builtins ||=Set.new %w(
    d0 d1 d2 d3 d4 d5 d6 d7
    a0 a1 a2 a3 a4 a5 a6 a7 a7'
    pc usp ssp ccr
  )
end

.keywordsObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rouge/lexers/m68k.rb', line 14

def self.keywords
  @keywords ||= Set.new %w(
    abcd add adda addi addq addx and andi asl asr

    bcc bcs beq bge bgt bhi ble bls blt bmi bne bpl bvc bvs bhs blo
    bchg bclr bfchg bfclr bfests bfextu bfffo bfins bfset bftst bkpt bra bse bsr btst

    callm cas cas2 chk chk2 clr cmp cmpa cmpi cmpm cmp2

    dbcc dbcs dbeq dbge dbgt dbhi dble dbls dblt dbmi dbne dbpl dbvc dbvs dbhs dblo
    dbra dbf dbt divs divsl divu divul

    eor eori exg ext extb

    illegal jmp jsr lea link lsl lsr

    move movea move16 movem movep moveq muls mulu

    nbcd neg negx nop not or ori

    pack pea rol ror roxl roxr rtd rtm rtr rts

    sbcd

    seq sne spl smi svc svs st sf sge sgt sle slt scc shi sls scs shs slo
    sub suba subi subq subx swap

    tas trap trapcc TODO trapv tst

    unlk unpk eori
  )
end

.keywords_typeObject



47
48
49
50
51
# File 'lib/rouge/lexers/m68k.rb', line 47

def self.keywords_type
  @keywords_type ||= Set.new %w(
    dc ds dcb
  )
end

.reservedObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/rouge/lexers/m68k.rb', line 53

def self.reserved
  @reserved ||= Set.new %w(
    include incdir incbin end endf endfunc endmain endproc fpu func machine main mmu opword proc set opt section
    rept endr
    ifeq ifne ifgt ifge iflt ifle iif ifd ifnd ifc ifnc elseif else endc
    even cnop fail machine
    output radix __G2 __LK
    list nolist plen llen ttl subttl spc page listchar format
    equ equenv equr set reg
    rsreset rsset offset
    cargs
    fequ.s fequ.d fequ.x fequ.p fequ.w fequ.l fopt
    macro endm mexit narg
  )
end