Class: Code::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/code/parser.rb,
lib/code/parser/if.rb,
lib/code/parser/call.rb,
lib/code/parser/code.rb,
lib/code/parser/list.rb,
lib/code/parser/name.rb,
lib/code/parser/class.rb,
lib/code/parser/equal.rb,
lib/code/parser/group.rb,
lib/code/parser/power.rb,
lib/code/parser/range.rb,
lib/code/parser/shift.rb,
lib/code/parser/splat.rb,
lib/code/parser/while.rb,
lib/code/parser/number.rb,
lib/code/parser/rescue.rb,
lib/code/parser/string.rb,
lib/code/parser/boolean.rb,
lib/code/parser/greater.rb,
lib/code/parser/nothing.rb,
lib/code/parser/ternary.rb,
lib/code/parser/addition.rb,
lib/code/parser/equality.rb,
lib/code/parser/function.rb,
lib/code/parser/negation.rb,
lib/code/parser/operation.rb,
lib/code/parser/statement.rb,
lib/code/parser/bitwise_or.rb,
lib/code/parser/or_keyword.rb,
lib/code/parser/whitespace.rb,
lib/code/parser/bitwise_and.rb,
lib/code/parser/dictionnary.rb,
lib/code/parser/if_modifier.rb,
lib/code/parser/not_keyword.rb,
lib/code/parser/or_operator.rb,
lib/code/parser/unary_minus.rb,
lib/code/parser/and_operator.rb,
lib/code/parser/chained_call.rb,
lib/code/parser/equality_lower.rb,
lib/code/parser/multiplication.rb

Defined Under Namespace

Classes: Addition, AndOperator, BitwiseAnd, BitwiseOr, Boolean, Call, ChainedCall, Class, Code, Dictionnary, Equal, Equality, EqualityLower, Function, Greater, Group, If, IfModifier, List, Multiplication, Name, Negation, NotKeyword, Nothing, Number, Operation, OrKeyword, OrOperator, Power, Range, Rescue, Shift, Splat, Statement, String, Ternary, UnaryMinus, While, Whitespace

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ Parser

Returns a new instance of Parser.



3
4
5
# File 'lib/code/parser.rb', line 3

def initialize(input)
  @input = input
end

Class Method Details

.parse(input) ⇒ Object



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

def self.parse(input)
  new(input).parse
end

Instance Method Details

#parseObject



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

def parse
  ::Code::Parser::Code.parse(input)
end