jievro-parser 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +30 -0
- data/README.md +1 -0
- data/Rakefile +7 -0
- data/lib/parser/binary_operator.rb +64 -0
- data/lib/parser/grammar/code_block.treetop +46 -0
- data/lib/parser/grammar/declaration/constant_declaration.treetop +38 -0
- data/lib/parser/grammar/declaration/declaration.treetop +16 -0
- data/lib/parser/grammar/declaration/function_declaration.treetop +302 -0
- data/lib/parser/grammar/declaration/variable_declaration.treetop +38 -0
- data/lib/parser/grammar/expression/binary_expression.treetop +75 -0
- data/lib/parser/grammar/expression/closure_expression.treetop +188 -0
- data/lib/parser/grammar/expression/expression.treetop +83 -0
- data/lib/parser/grammar/expression/function_call_expression.treetop +32 -0
- data/lib/parser/grammar/expression/literal_expression.treetop +8 -0
- data/lib/parser/grammar/expression/parenthesized_expression.treetop +146 -0
- data/lib/parser/grammar/expression/postfix_expression.treetop +8 -0
- data/lib/parser/grammar/expression/prefix_expression.treetop +29 -0
- data/lib/parser/grammar/expression/primary_expression.treetop +8 -0
- data/lib/parser/grammar/expression/range_expression.treetop +53 -0
- data/lib/parser/grammar/expression/self_expression.treetop +25 -0
- data/lib/parser/grammar/expression/super_expression.treetop +25 -0
- data/lib/parser/grammar/expression/wildcard_expression.treetop +8 -0
- data/lib/parser/grammar/generics/generic_argument_clause.treetop +89 -0
- data/lib/parser/grammar/generics/generics.treetop +9 -0
- data/lib/parser/grammar/grammar.treetop +76 -0
- data/lib/parser/grammar/identifier.treetop +56 -0
- data/lib/parser/grammar/implicit_parameter_name.treetop +26 -0
- data/lib/parser/grammar/literal/literal.treetop +45 -0
- data/lib/parser/grammar/literal/literal_array.treetop +98 -0
- data/lib/parser/grammar/literal/literal_boolean.treetop +50 -0
- data/lib/parser/grammar/literal/literal_decimal_floating_point.treetop +49 -0
- data/lib/parser/grammar/literal/literal_dictionary.treetop +157 -0
- data/lib/parser/grammar/literal/literal_hexadecimal_floating_point.treetop +47 -0
- data/lib/parser/grammar/literal/literal_integer_binary.treetop +47 -0
- data/lib/parser/grammar/literal/literal_integer_decimal.treetop +47 -0
- data/lib/parser/grammar/literal/literal_integer_hexadecimal.treetop +47 -0
- data/lib/parser/grammar/literal/literal_integer_octal.treetop +47 -0
- data/lib/parser/grammar/literal/literal_nil.treetop +25 -0
- data/lib/parser/grammar/literal/literal_numeric.treetop +69 -0
- data/lib/parser/grammar/literal/literal_string.treetop +207 -0
- data/lib/parser/grammar/operator.treetop +35 -0
- data/lib/parser/grammar/pattern/pattern.treetop +16 -0
- data/lib/parser/grammar/pattern/pattern_identifier.treetop +8 -0
- data/lib/parser/grammar/pattern/pattern_initializer.treetop +189 -0
- data/lib/parser/grammar/pattern/pattern_wildcard.treetop +8 -0
- data/lib/parser/grammar/statement/branch/branch.treetop +16 -0
- data/lib/parser/grammar/statement/branch/if.treetop +63 -0
- data/lib/parser/grammar/statement/loop/do_while.treetop +32 -0
- data/lib/parser/grammar/statement/loop/for.treetop +127 -0
- data/lib/parser/grammar/statement/loop/for_in.treetop +35 -0
- data/lib/parser/grammar/statement/loop/loop.treetop +22 -0
- data/lib/parser/grammar/statement/loop/while.treetop +34 -0
- data/lib/parser/grammar/statement/statement.treetop +97 -0
- data/lib/parser/grammar/type/type.treetop +18 -0
- data/lib/parser/grammar/type/type_annotation.treetop +29 -0
- data/lib/parser/grammar/type/type_array.treetop +43 -0
- data/lib/parser/grammar/type/type_dictionary.treetop +59 -0
- data/lib/parser/grammar/type/type_identifier.treetop +39 -0
- data/lib/parser/grammar/whitespace.treetop +40 -0
- data/lib/parser/grammar/wildcard.treetop +25 -0
- data/lib/parser/parse_result.rb +17 -0
- data/lib/parser/parser.rb +34 -0
- data/lib/parser/tools/converter/binary_string_to_int_converter.rb +20 -0
- data/lib/parser/tools/converter/converter.rb +12 -0
- data/lib/parser/tools/converter/decimal_float_string_to_float_converter.rb +22 -0
- data/lib/parser/tools/converter/decimal_string_to_int_converter.rb +20 -0
- data/lib/parser/tools/converter/hexadecimal_float_string_to_float_converter.rb +42 -0
- data/lib/parser/tools/converter/hexadecimal_string_to_int_converter.rb +20 -0
- data/lib/parser/tools/converter/octal_string_to_int_converter.rb +20 -0
- data/lib/parser/tools/quote_stripper.rb +18 -0
- data/lib/parser/tools/shunting_yard.rb +80 -0
- data/lib/parser/tools/tokens.rb +112 -0
- data/lib/parser/version.rb +5 -0
- data/lib/parser.rb +2 -0
- data/parser.gemspec +25 -0
- metadata +163 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'treetop'
|
2
|
+
require 'polyglot'
|
3
|
+
require 'parser/grammar/grammar'
|
4
|
+
require 'parser/parse_result'
|
5
|
+
|
6
|
+
module Jievro
|
7
|
+
class Parser
|
8
|
+
|
9
|
+
@@parser = Jievro::SwiftParser.new
|
10
|
+
|
11
|
+
def self.parse(source)
|
12
|
+
|
13
|
+
tokens = []
|
14
|
+
ast = {
|
15
|
+
block_type: 'program',
|
16
|
+
body: []
|
17
|
+
}
|
18
|
+
|
19
|
+
unless source.empty?
|
20
|
+
|
21
|
+
parsed = @@parser.parse(source)
|
22
|
+
|
23
|
+
if parsed.nil?
|
24
|
+
raise Exception, @@parser.failure_reason
|
25
|
+
end
|
26
|
+
|
27
|
+
tokens = parsed.tokens
|
28
|
+
ast = parsed.ast
|
29
|
+
end
|
30
|
+
|
31
|
+
Jievro::ParseResult.new(tokens, ast)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Kauri
|
2
|
+
module Tools
|
3
|
+
module Converter
|
4
|
+
class BinaryStringToIntConverter
|
5
|
+
def convert(binary_string)
|
6
|
+
|
7
|
+
raise Exception, 'Cannot convert non `String\' values' \
|
8
|
+
unless binary_string.kind_of?(String)
|
9
|
+
|
10
|
+
raise Exception, 'String to convert do not match the regular format' \
|
11
|
+
unless binary_string =~ /^0b[01_]+$/i
|
12
|
+
|
13
|
+
clean_string = binary_string.gsub! /0b|_*/, ''
|
14
|
+
|
15
|
+
clean_string.to_i(base=2)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Kauri
|
2
|
+
module Tools
|
3
|
+
module Converter
|
4
|
+
require 'parser/tools/converter/binary_string_to_int_converter'
|
5
|
+
require 'parser/tools/converter/decimal_float_string_to_float_converter'
|
6
|
+
require 'parser/tools/converter/decimal_string_to_int_converter'
|
7
|
+
require 'parser/tools/converter/hexadecimal_float_string_to_float_converter'
|
8
|
+
require 'parser/tools/converter/hexadecimal_string_to_int_converter'
|
9
|
+
require 'parser/tools/converter/octal_string_to_int_converter'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Kauri
|
2
|
+
module Tools
|
3
|
+
module Converter
|
4
|
+
class DecimalFloatStringToFloatConverter
|
5
|
+
def convert(decimal_float_string)
|
6
|
+
|
7
|
+
raise Exception, 'Cannot convert non `String\' values' \
|
8
|
+
unless decimal_float_string.kind_of?(String)
|
9
|
+
|
10
|
+
# the regex that match a decimal floating number is not exact
|
11
|
+
# but for this purpose should be fine
|
12
|
+
raise Exception, 'String do not match the regular format' \
|
13
|
+
unless decimal_float_string =~ /^[0-9_]+.?[0-9_]*e?[+-]?[0-9_]*$/i
|
14
|
+
|
15
|
+
clean_string = decimal_float_string.gsub! /_*/, ''
|
16
|
+
|
17
|
+
clean_string.to_f
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Kauri
|
2
|
+
module Tools
|
3
|
+
module Converter
|
4
|
+
class DecimalStringToIntConverter
|
5
|
+
def convert(decimal_string)
|
6
|
+
|
7
|
+
raise Exception, 'Cannot convert non `String\' values' \
|
8
|
+
unless decimal_string.kind_of?(String)
|
9
|
+
|
10
|
+
raise Exception, 'String to convert do not match the regular format' \
|
11
|
+
unless decimal_string =~ /^[0-9_]+$/i
|
12
|
+
|
13
|
+
clean_string = decimal_string.gsub! /_*/, ''
|
14
|
+
|
15
|
+
clean_string.to_i
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Kauri
|
2
|
+
module Tools
|
3
|
+
module Converter
|
4
|
+
class HexadecimalFloatStringToFloatConverter
|
5
|
+
def convert(hexadecimal_float_string)
|
6
|
+
|
7
|
+
raise Exception, 'Cannot convert non `String\' values' \
|
8
|
+
unless hexadecimal_float_string.kind_of?(String)
|
9
|
+
|
10
|
+
clean_string = hexadecimal_float_string.gsub! /_*/, ''
|
11
|
+
|
12
|
+
match = clean_string.match(/^0x([0-9a-f]+).?([0-9a-f]*)p([+-]?)([0-9]+)$/i)
|
13
|
+
|
14
|
+
raise Exception, 'String to convert do not match the regular format' \
|
15
|
+
unless match
|
16
|
+
|
17
|
+
captures = match.captures
|
18
|
+
|
19
|
+
integer = captures[0].to_i(base=16).to_f
|
20
|
+
mantissa_hexadecimal = captures[1]
|
21
|
+
negative_exponent = captures[2] == '-'
|
22
|
+
exponent = captures[3].to_i
|
23
|
+
|
24
|
+
mantissa = 0.0
|
25
|
+
|
26
|
+
if negative_exponent
|
27
|
+
exponent = -exponent
|
28
|
+
end
|
29
|
+
|
30
|
+
mantissa_current_bit_value = 16
|
31
|
+
|
32
|
+
mantissa_hexadecimal.each_byte do |mantissa_hexadecimal_char|
|
33
|
+
mantissa += mantissa_hexadecimal_char.chr.to_i(base=16).to_f / mantissa_current_bit_value
|
34
|
+
mantissa_current_bit_value <<= 4
|
35
|
+
end
|
36
|
+
|
37
|
+
(integer + mantissa) * (2 ** exponent)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Kauri
|
2
|
+
module Tools
|
3
|
+
module Converter
|
4
|
+
class HexadecimalStringToIntConverter
|
5
|
+
def convert(hexadecimal_string)
|
6
|
+
|
7
|
+
raise Exception, 'Cannot convert non `String\' values' \
|
8
|
+
unless hexadecimal_string.kind_of?(String)
|
9
|
+
|
10
|
+
raise Exception, 'String to convert do not match the regular format' \
|
11
|
+
unless hexadecimal_string =~ /^0x[0-9a-f_]+$/i
|
12
|
+
|
13
|
+
clean_string = hexadecimal_string.gsub!(/0x|_*/, '')
|
14
|
+
|
15
|
+
clean_string.to_i(base=16)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Kauri
|
2
|
+
module Tools
|
3
|
+
module Converter
|
4
|
+
class OctalStringToIntConverter
|
5
|
+
def convert(octal_string)
|
6
|
+
|
7
|
+
raise Exception, 'Cannot convert non `String\' values' \
|
8
|
+
unless octal_string.kind_of?(String)
|
9
|
+
|
10
|
+
raise Exception, 'String to convert do not match the regular format' \
|
11
|
+
unless octal_string =~ /^0o[0-7_]+$/i
|
12
|
+
|
13
|
+
clean_string = octal_string.gsub!(/_*/, '')
|
14
|
+
|
15
|
+
clean_string.to_i(base=8)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Kauri
|
2
|
+
module Tools
|
3
|
+
class QuoteStripper
|
4
|
+
def strip(string)
|
5
|
+
|
6
|
+
string.gsub!(/\\n/, "\n")
|
7
|
+
string.gsub!(/\\r/, "\r")
|
8
|
+
string.gsub!(/\\t/, "\t")
|
9
|
+
string.gsub!(/\\'/, "'")
|
10
|
+
string.gsub!(/\\0/, "\0")
|
11
|
+
string.gsub!(/\\"/, '"')
|
12
|
+
string.gsub!(/\\\\/, "\\")
|
13
|
+
|
14
|
+
string
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'parser/binary_operator'
|
2
|
+
|
3
|
+
module Kauri
|
4
|
+
module Tools
|
5
|
+
class ShuntingYard
|
6
|
+
|
7
|
+
def generate_ast(infix_tokens)
|
8
|
+
|
9
|
+
node_stack = []
|
10
|
+
rpn_tokens = generate_rpn(infix_tokens)
|
11
|
+
|
12
|
+
rpn_tokens.each { |token|
|
13
|
+
|
14
|
+
if BinaryOperator.is_operator(token)
|
15
|
+
right = node_stack.pop
|
16
|
+
left = node_stack.pop
|
17
|
+
|
18
|
+
node_stack.push({
|
19
|
+
block_type: 'binary-expression',
|
20
|
+
operator: token,
|
21
|
+
left: left,
|
22
|
+
right: right
|
23
|
+
})
|
24
|
+
|
25
|
+
else
|
26
|
+
node_stack.push(token)
|
27
|
+
end
|
28
|
+
}
|
29
|
+
|
30
|
+
node_stack
|
31
|
+
end
|
32
|
+
|
33
|
+
def generate_rpn(infix_tokens)
|
34
|
+
|
35
|
+
output_queue = []
|
36
|
+
operator_stack = []
|
37
|
+
|
38
|
+
infix_tokens.each { |token|
|
39
|
+
|
40
|
+
if BinaryOperator.is_operator(token)
|
41
|
+
|
42
|
+
current_operator = BinaryOperator.get(token)
|
43
|
+
|
44
|
+
until operator_stack.empty? do
|
45
|
+
|
46
|
+
stack_operator = operator_stack.last
|
47
|
+
|
48
|
+
move_operator_to_queue = false
|
49
|
+
|
50
|
+
if :left == current_operator.associativity and current_operator.precedence <= stack_operator.precedence
|
51
|
+
move_operator_to_queue = true
|
52
|
+
elsif :right == current_operator.associativity and current_operator.precedence < stack_operator.precedence
|
53
|
+
move_operator_to_queue = true
|
54
|
+
end
|
55
|
+
|
56
|
+
unless move_operator_to_queue
|
57
|
+
break
|
58
|
+
end
|
59
|
+
|
60
|
+
operator_stack.pop
|
61
|
+
output_queue.push stack_operator.sign
|
62
|
+
end
|
63
|
+
|
64
|
+
operator_stack.push(current_operator)
|
65
|
+
else
|
66
|
+
|
67
|
+
output_queue.push(token)
|
68
|
+
|
69
|
+
end
|
70
|
+
}
|
71
|
+
|
72
|
+
until operator_stack.empty?
|
73
|
+
output_queue.push(operator_stack.pop.sign)
|
74
|
+
end
|
75
|
+
|
76
|
+
output_queue
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
def T_WHITESPACES(value)
|
2
|
+
{
|
3
|
+
type: 'T_WHITESPACES',
|
4
|
+
value: value
|
5
|
+
}
|
6
|
+
end
|
7
|
+
|
8
|
+
T_COMMA = {
|
9
|
+
type: 'T_COMMA',
|
10
|
+
value: ','
|
11
|
+
}
|
12
|
+
|
13
|
+
T_COLON = {
|
14
|
+
type: 'T_COLON',
|
15
|
+
value: ':'
|
16
|
+
}
|
17
|
+
|
18
|
+
T_SEMICOLON = {
|
19
|
+
type: 'T_SEMICOLON',
|
20
|
+
value: ';'
|
21
|
+
}
|
22
|
+
|
23
|
+
T_OPEN_ROUND_BRACKET = {
|
24
|
+
type: 'T_OPEN_ROUND_BRACKET',
|
25
|
+
value: '('
|
26
|
+
}
|
27
|
+
|
28
|
+
T_CLOSE_ROUND_BRACKET = {
|
29
|
+
type: 'T_CLOSE_ROUND_BRACKET',
|
30
|
+
value: ')'
|
31
|
+
}
|
32
|
+
|
33
|
+
T_OPEN_CURLY_BRACKET = {
|
34
|
+
type: 'T_OPEN_CURLY_BRACKET',
|
35
|
+
value: '{'
|
36
|
+
}
|
37
|
+
|
38
|
+
T_CLOSE_CURLY_BRACKET = {
|
39
|
+
type: 'T_CLOSE_CURLY_BRACKET',
|
40
|
+
value: '}'
|
41
|
+
}
|
42
|
+
|
43
|
+
T_FALSE = {
|
44
|
+
type: 'T_FALSE',
|
45
|
+
value: 'false'
|
46
|
+
}
|
47
|
+
|
48
|
+
T_TRUE = {
|
49
|
+
type: 'T_TRUE',
|
50
|
+
value: 'true'
|
51
|
+
}
|
52
|
+
|
53
|
+
T_WILDCARD = {
|
54
|
+
type: 'T_WILDCARD',
|
55
|
+
value: '_'
|
56
|
+
}
|
57
|
+
|
58
|
+
def T_LITERAL_INTEGER_DECIMAL(value)
|
59
|
+
{
|
60
|
+
type: 'T_LITERAL_INTEGER_DECIMAL',
|
61
|
+
value: value
|
62
|
+
}
|
63
|
+
end
|
64
|
+
|
65
|
+
def T_IDENTIFIER(value)
|
66
|
+
{
|
67
|
+
type: 'T_IDENTIFIER',
|
68
|
+
value: value
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
def T_OPERATOR(value)
|
73
|
+
{
|
74
|
+
type: 'T_OPERATOR',
|
75
|
+
value: value
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
T_VAR = {
|
80
|
+
type: 'T_VAR',
|
81
|
+
value: 'var'
|
82
|
+
}
|
83
|
+
|
84
|
+
T_FOR = {
|
85
|
+
type: 'T_FOR',
|
86
|
+
value: 'for'
|
87
|
+
}
|
88
|
+
|
89
|
+
T_IN = {
|
90
|
+
type: 'T_IN',
|
91
|
+
value: 'in'
|
92
|
+
}
|
93
|
+
|
94
|
+
T_DO = {
|
95
|
+
type: 'T_DO',
|
96
|
+
value: 'do'
|
97
|
+
}
|
98
|
+
|
99
|
+
T_WHILE = {
|
100
|
+
type: 'T_WHILE',
|
101
|
+
value: 'while'
|
102
|
+
}
|
103
|
+
|
104
|
+
T_IF = {
|
105
|
+
type: 'T_IF',
|
106
|
+
value: 'if'
|
107
|
+
}
|
108
|
+
|
109
|
+
T_ELSE = {
|
110
|
+
type: 'T_ELSE',
|
111
|
+
value: 'else'
|
112
|
+
}
|
data/lib/parser.rb
ADDED
data/parser.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
require 'parser/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'jievro-parser'
|
8
|
+
spec.version = Jievro::Parser::VERSION
|
9
|
+
spec.authors = ['Stefano Azzalini']
|
10
|
+
spec.email = 'hi@jievro.io'
|
11
|
+
spec.homepage = 'http://jievro.io'
|
12
|
+
spec.summary = %q{Source code parser used internally by jievro}
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
17
|
+
spec.require_paths = ['lib']
|
18
|
+
|
19
|
+
spec.required_ruby_version = '~> 2.0'
|
20
|
+
|
21
|
+
spec.add_runtime_dependency 'treetop', '~> 1.6'
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.9'
|
24
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jievro-parser
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stefano Azzalini
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: treetop
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.9'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.9'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
description:
|
56
|
+
email: hi@jievro.io
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files: []
|
60
|
+
files:
|
61
|
+
- .gitignore
|
62
|
+
- .travis.yml
|
63
|
+
- Gemfile
|
64
|
+
- Gemfile.lock
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- lib/parser.rb
|
68
|
+
- lib/parser/binary_operator.rb
|
69
|
+
- lib/parser/grammar/code_block.treetop
|
70
|
+
- lib/parser/grammar/declaration/constant_declaration.treetop
|
71
|
+
- lib/parser/grammar/declaration/declaration.treetop
|
72
|
+
- lib/parser/grammar/declaration/function_declaration.treetop
|
73
|
+
- lib/parser/grammar/declaration/variable_declaration.treetop
|
74
|
+
- lib/parser/grammar/expression/binary_expression.treetop
|
75
|
+
- lib/parser/grammar/expression/closure_expression.treetop
|
76
|
+
- lib/parser/grammar/expression/expression.treetop
|
77
|
+
- lib/parser/grammar/expression/function_call_expression.treetop
|
78
|
+
- lib/parser/grammar/expression/literal_expression.treetop
|
79
|
+
- lib/parser/grammar/expression/parenthesized_expression.treetop
|
80
|
+
- lib/parser/grammar/expression/postfix_expression.treetop
|
81
|
+
- lib/parser/grammar/expression/prefix_expression.treetop
|
82
|
+
- lib/parser/grammar/expression/primary_expression.treetop
|
83
|
+
- lib/parser/grammar/expression/range_expression.treetop
|
84
|
+
- lib/parser/grammar/expression/self_expression.treetop
|
85
|
+
- lib/parser/grammar/expression/super_expression.treetop
|
86
|
+
- lib/parser/grammar/expression/wildcard_expression.treetop
|
87
|
+
- lib/parser/grammar/generics/generic_argument_clause.treetop
|
88
|
+
- lib/parser/grammar/generics/generics.treetop
|
89
|
+
- lib/parser/grammar/grammar.treetop
|
90
|
+
- lib/parser/grammar/identifier.treetop
|
91
|
+
- lib/parser/grammar/implicit_parameter_name.treetop
|
92
|
+
- lib/parser/grammar/literal/literal.treetop
|
93
|
+
- lib/parser/grammar/literal/literal_array.treetop
|
94
|
+
- lib/parser/grammar/literal/literal_boolean.treetop
|
95
|
+
- lib/parser/grammar/literal/literal_decimal_floating_point.treetop
|
96
|
+
- lib/parser/grammar/literal/literal_dictionary.treetop
|
97
|
+
- lib/parser/grammar/literal/literal_hexadecimal_floating_point.treetop
|
98
|
+
- lib/parser/grammar/literal/literal_integer_binary.treetop
|
99
|
+
- lib/parser/grammar/literal/literal_integer_decimal.treetop
|
100
|
+
- lib/parser/grammar/literal/literal_integer_hexadecimal.treetop
|
101
|
+
- lib/parser/grammar/literal/literal_integer_octal.treetop
|
102
|
+
- lib/parser/grammar/literal/literal_nil.treetop
|
103
|
+
- lib/parser/grammar/literal/literal_numeric.treetop
|
104
|
+
- lib/parser/grammar/literal/literal_string.treetop
|
105
|
+
- lib/parser/grammar/operator.treetop
|
106
|
+
- lib/parser/grammar/pattern/pattern.treetop
|
107
|
+
- lib/parser/grammar/pattern/pattern_identifier.treetop
|
108
|
+
- lib/parser/grammar/pattern/pattern_initializer.treetop
|
109
|
+
- lib/parser/grammar/pattern/pattern_wildcard.treetop
|
110
|
+
- lib/parser/grammar/statement/branch/branch.treetop
|
111
|
+
- lib/parser/grammar/statement/branch/if.treetop
|
112
|
+
- lib/parser/grammar/statement/loop/do_while.treetop
|
113
|
+
- lib/parser/grammar/statement/loop/for.treetop
|
114
|
+
- lib/parser/grammar/statement/loop/for_in.treetop
|
115
|
+
- lib/parser/grammar/statement/loop/loop.treetop
|
116
|
+
- lib/parser/grammar/statement/loop/while.treetop
|
117
|
+
- lib/parser/grammar/statement/statement.treetop
|
118
|
+
- lib/parser/grammar/type/type.treetop
|
119
|
+
- lib/parser/grammar/type/type_annotation.treetop
|
120
|
+
- lib/parser/grammar/type/type_array.treetop
|
121
|
+
- lib/parser/grammar/type/type_dictionary.treetop
|
122
|
+
- lib/parser/grammar/type/type_identifier.treetop
|
123
|
+
- lib/parser/grammar/whitespace.treetop
|
124
|
+
- lib/parser/grammar/wildcard.treetop
|
125
|
+
- lib/parser/parse_result.rb
|
126
|
+
- lib/parser/parser.rb
|
127
|
+
- lib/parser/tools/converter/binary_string_to_int_converter.rb
|
128
|
+
- lib/parser/tools/converter/converter.rb
|
129
|
+
- lib/parser/tools/converter/decimal_float_string_to_float_converter.rb
|
130
|
+
- lib/parser/tools/converter/decimal_string_to_int_converter.rb
|
131
|
+
- lib/parser/tools/converter/hexadecimal_float_string_to_float_converter.rb
|
132
|
+
- lib/parser/tools/converter/hexadecimal_string_to_int_converter.rb
|
133
|
+
- lib/parser/tools/converter/octal_string_to_int_converter.rb
|
134
|
+
- lib/parser/tools/quote_stripper.rb
|
135
|
+
- lib/parser/tools/shunting_yard.rb
|
136
|
+
- lib/parser/tools/tokens.rb
|
137
|
+
- lib/parser/version.rb
|
138
|
+
- parser.gemspec
|
139
|
+
homepage: http://jievro.io
|
140
|
+
licenses:
|
141
|
+
- MIT
|
142
|
+
metadata: {}
|
143
|
+
post_install_message:
|
144
|
+
rdoc_options: []
|
145
|
+
require_paths:
|
146
|
+
- lib
|
147
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ~>
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '2.0'
|
152
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - '>='
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
requirements: []
|
158
|
+
rubyforge_project:
|
159
|
+
rubygems_version: 2.0.14
|
160
|
+
signing_key:
|
161
|
+
specification_version: 4
|
162
|
+
summary: Source code parser used internally by jievro
|
163
|
+
test_files: []
|