Class: CrossPlane::Lexer

Inherits:
Object
  • Object
show all
Defined in:
lib/crossplane/lexer.rb

Constant Summary collapse

EXTERNAL_LEXERS =
{}
NEWLINE =
"\n"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Lexer

Returns a new instance of Lexer.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/crossplane/lexer.rb', line 13

def initialize(*args)
	args = args[0] || {}

	required = ['filename']
	conflicts = []
	requires = {}
	valid = {
		'params' => [
			'filename',
		]
	}

	content = CrossPlane.utils.validate_constructor(client: self, args: args, required: required, conflicts: conflicts, requires: requires, valid: valid)
	self.filename = content[:filename]
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



12
13
14
# File 'lib/crossplane/lexer.rb', line 12

def filename
  @filename
end

Instance Method Details

#lex(*args) ⇒ Object



29
30
31
32
33
# File 'lib/crossplane/lexer.rb', line 29

def lex(*args)
	tokens = _lex_file()
	_balance_braces(tokens)
	tokens
end