Class: Rouge::Lexers::ArmAsm

Inherits:
RegexLexer show all
Defined in:
lib/rouge/lexers/armasm.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, #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, #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

.builtinObject



44
45
46
47
48
49
50
# File 'lib/rouge/lexers/armasm.rb', line 44

def self.builtin
  @builtin ||= %w(
    ARCHITECTURE AREANAME ARMASM_VERSION CODESIZE COMMANDLINE CONFIG CPU
    ENDIAN FALSE FPIC FPU INPUTFILE INTER LINENUM LINENUMUP LINENUMUPPER
    OBJASM_VERSION OPT PC PCSTOREOFFSET REENTRANT ROPI RWPI TRUE VAR
  )
end

.file_directiveObject



18
19
20
21
22
# File 'lib/rouge/lexers/armasm.rb', line 18

def self.file_directive
  @file_directive ||= %w(
    BIN GET INCBIN INCLUDE LNK
  )
end

.general_directiveObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/rouge/lexers/armasm.rb', line 24

def self.general_directive
  @general_directive ||= %w(
    ALIAS ALIGN AOF AOUT AREA ARM ASSERT ATTR CN CODE16 CODE32 COMMON CP
    DATA DCB DCD DCDO DCDU DCFD DCFDU DCFH DCFHU DCFS DCFSU DCI DCI.N DCI.W
    DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT
    EXPORTAS EXTERN FIELD FILL FN FRAME FUNCTION GBLA GBLL GBLS GLOBAL IF
    IMPORT INFO KEEP LCLA LCLL LCLS LEADR LEAF LTORG MACRO MAP MEND MEXIT
    NOFP OPT ORG PRESERVE8 PROC QN RELOC REQUIRE REQUIRE8 RLIST RN ROUT
    SETA SETL SETS SN SPACE STRONG SUBT THUMB THUMBX TTL WEND WHILE
    \[ \] [|!#*=%&^]
  )
end

.operatorObject



52
53
54
55
56
57
58
59
# File 'lib/rouge/lexers/armasm.rb', line 52

def self.operator
  @operator ||= %w(
    AND BASE CC CC_ENCODING CHR DEF EOR FATTR FEXEC FLOAD FSIZE INDEX LAND
    LEFT LEN LEOR LNOT LOR LOWERCASE MOD NOT OR RCONST REVERSE_CC RIGHT ROL
    ROR SHL SHR STR TARGET_ARCH_[0-9A-Z_]+ TARGET_FEATURE_[0-9A-Z_]+
    TARGET_FPU_[A-Z_] TARGET_PROFILE_[ARM] UAL UPPERCASE
  )
end

.preproc_keywordObject



12
13
14
15
16
# File 'lib/rouge/lexers/armasm.rb', line 12

def self.preproc_keyword
  @preproc_keyword ||= %w(
    define elif else endif error if ifdef ifndef include line pragma undef warning
  )
end

.shift_or_conditionObject



37
38
39
40
41
42
# File 'lib/rouge/lexers/armasm.rb', line 37

def self.shift_or_condition
  @shift_or_condition ||= %w(
    ASR LSL LSR ROR RRX AL CC CS EQ GE GT HI HS LE LO LS LT MI NE PL VC VS
    asr lsl lsr ror rrx al cc cs eq ge gt hi hs le lo ls lt mi ne pl vc vs
  )
end