1: <?php
2:
3: namespace BN\Compiler\Scanner\Converter;
4:
5: use BN\Number;
6: use BN\Compiler\Scanner\LexemeConverter;
7:
8: class LexemeToBNNumber implements LexemeConverter
9: {
10: private $toNumber;
11:
12: public function __construct()
13: {
14: $this->toNumber = new LexemeToSignedNumber();
15: }
16:
17: public function canConvertLexeme($lexeme)
18: {
19: return $this->toNumber->canConvertLexeme($lexeme);
20: }
21:
22: public function convertLexeme($lexeme)
23: {
24: $token = $this->toNumber->convertLexeme($lexeme);
25: $token->value = new Number($token->value);
26: return $token;
27: }
28: }
29: