Class: Rouge::Lexers::OCL

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



25
26
27
28
29
# File 'lib/rouge/lexers/ocl.rb', line 25

def self.builtins
  @builtins ||= Set.new %w(
    self null result true false invalid @pre
    )
end

.functionsObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rouge/lexers/ocl.rb', line 37

def self.functions
  @functions ||= Set.new %w(
    oclAsSet oclIsNew oclIsUndefined oclIsInvalid oclAsType oclIsTypeOf
    oclIsKindOf oclInState oclType oclLocale hasReturned result
    isSignalSent isOperationCallabs floor round max min toString div mod
    size substring concat toInteger toReal toUpperCase toLowerCase
    indexOf equalsIgnoreCase at characters toBoolean includes excludes
    count includesAll excludesAll isEmpty notEmpty sum product
    selectByKind selectByType asBag asSequence asOrderedSet asSet flatten
    union intersection including excluding symmetricDifferencecount
    append prepend insertAt subOrderedSet first last reverse subSequence
    any closure collect collectNested exists forAll isUnique iterate one
    reject select sortedBy allInstances average conformsTo
  )
end

.keywordsObject



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

def self.keywords
  @keywords ||= Set.new %w(
    context pre post inv init body def derive if then else endif import
    package endpackage let in
  )
end

.keywords_typeObject



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

def self.keywords_type
  @keywords_type ||= Set.new %w(
    Boolean Integer UnlimitedNatural Real String OrderedSet Tuple Bag Set
    Sequence OclInvalid OclVoid TupleType OclState Collection OclMessage
  )
end

.operatorsObject



31
32
33
34
35
# File 'lib/rouge/lexers/ocl.rb', line 31

def self.operators
  @operators ||= Set.new %w(
    or xor and not implies
  )
end