Method: Crokus::Parser#parse

Defined in:
lib/crokus/parser.rb

#parse(str) ⇒ Object

.….….… parsing methods .….……



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/crokus/parser.rb', line 67

def parse str
  begin
    @str=str
    @tokens=Lexer.new.tokenize(str)
    #pp @tokens
    @tokens=@tokens.reject{|tok| tok==[nil,nil,nil]}
    @tokens=remove_comments()
    warnings=@tokens.select{|tok| tok.is? :lexer_warning}
    show_lexer_warnings(warnings)
    @tokens=@tokens.select{|tok| !tok.is? [:newline]}
    ast=design_unit()
  rescue Exception => e
    puts "PARSING ERROR : #{e}"
    puts "in C source at line/col #{showNext.pos}"
    puts e.backtrace
    abort
  end
end