diff python/c3/parser.py @ 293:6aa721e7b10b

Try to improve build sequence
author Windel Bouwman
date Thu, 28 Nov 2013 20:39:37 +0100
parents bd2593de3ff8
children 9417caea2eb3
line wrap: on
line diff
--- a/python/c3/parser.py	Wed Nov 27 08:06:42 2013 +0100
+++ b/python/c3/parser.py	Thu Nov 28 20:39:37 2013 +0100
@@ -1,5 +1,6 @@
 import logging
-from . import astnodes, lexer
+from .lexer import Lexer
+from . import astnodes
 from ppci import CompilerError
 
 
@@ -8,6 +9,7 @@
     def __init__(self, diag):
         self.logger = logging.getLogger('c3')
         self.diag = diag
+        self.lexer = Lexer(diag)
 
     def parseSource(self, source):
         self.logger.info('Parsing source')
@@ -49,7 +51,7 @@
         return t
 
     def initLex(self, source):
-        self.tokens = lexer.tokenize(source)   # Lexical stage
+        self.tokens = self.lexer.tokenize(source)
         self.token = self.tokens.__next__()
 
     def addDeclaration(self, decl):