Class: Code::Parser::Name

Inherits:
Language
  • Object
show all
Defined in:
lib/code/parser/name.rb

Instance Method Summary collapse

Instance Method Details

#ampersandObject



66
67
68
# File 'lib/code/parser/name.rb', line 66

def ampersand
  str("&")
end

#asteriskObject



78
79
80
# File 'lib/code/parser/name.rb', line 78

def asterisk
  str("*")
end

#characterObject



106
107
108
# File 'lib/code/parser/name.rb', line 106

def character
  special_character.absent << any
end

#closing_curly_bracketObject



30
31
32
# File 'lib/code/parser/name.rb', line 30

def closing_curly_bracket
  str("}")
end

#closing_parenthesisObject



46
47
48
# File 'lib/code/parser/name.rb', line 46

def closing_parenthesis
  str(")")
end

#closing_square_bracketObject



38
39
40
# File 'lib/code/parser/name.rb', line 38

def closing_square_bracket
  str("]")
end

#colonObject



22
23
24
# File 'lib/code/parser/name.rb', line 22

def colon
  str(":")
end

#commaObject



14
15
16
# File 'lib/code/parser/name.rb', line 14

def comma
  str(",")
end

#do_keywordObject



82
83
84
# File 'lib/code/parser/name.rb', line 82

def do_keyword
  str("do")
end

#dotObject



58
59
60
# File 'lib/code/parser/name.rb', line 58

def dot
  str(".")
end

#double_quoteObject



54
55
56
# File 'lib/code/parser/name.rb', line 54

def double_quote
  str('"')
end

#else_keywordObject



94
95
96
# File 'lib/code/parser/name.rb', line 94

def else_keyword
  str("else")
end

#elsif_keywordObject



90
91
92
# File 'lib/code/parser/name.rb', line 90

def elsif_keyword
  str("elsif")
end

#end_keywordObject



86
87
88
# File 'lib/code/parser/name.rb', line 86

def end_keyword
  str("end")
end

#equalObject



18
19
20
# File 'lib/code/parser/name.rb', line 18

def equal
  str("=")
end

#greaterObject



74
75
76
# File 'lib/code/parser/name.rb', line 74

def greater
  str(">")
end

#lesserObject



70
71
72
# File 'lib/code/parser/name.rb', line 70

def lesser
  str("<")
end

#newlineObject



10
11
12
# File 'lib/code/parser/name.rb', line 10

def newline
  str("\n")
end

#opening_curly_bracketObject



26
27
28
# File 'lib/code/parser/name.rb', line 26

def opening_curly_bracket
  str("{")
end

#opening_parenthesisObject



42
43
44
# File 'lib/code/parser/name.rb', line 42

def opening_parenthesis
  str("(")
end

#opening_square_bracketObject



34
35
36
# File 'lib/code/parser/name.rb', line 34

def opening_square_bracket
  str("[")
end

#pipeObject



62
63
64
# File 'lib/code/parser/name.rb', line 62

def pipe
  str("|")
end

#rootObject



114
115
116
117
118
119
# File 'lib/code/parser/name.rb', line 114

def root
  (do_keyword << separator).absent << (
    else_keyword << separator
  ).absent << (elsif_keyword << separator).absent <<
    (end_keyword << separator).absent << character.repeat(1)
end

#separatorObject



110
111
112
# File 'lib/code/parser/name.rb', line 110

def separator
  special_character | any.absent
end

#single_quoteObject



50
51
52
# File 'lib/code/parser/name.rb', line 50

def single_quote
  str("'")
end

#spaceObject



6
7
8
# File 'lib/code/parser/name.rb', line 6

def space
  str(" ")
end

#special_characterObject



98
99
100
101
102
103
104
# File 'lib/code/parser/name.rb', line 98

def special_character
  ampersand | equal | pipe | dot | colon | comma | space | newline |
    opening_curly_bracket | closing_curly_bracket | opening_parenthesis |
    closing_parenthesis | opening_square_bracket |
    closing_square_bracket | single_quote | double_quote | lesser |
    greater | asterisk
end