parameters: (self, node, env)
docstring: Preprocess a source file to obtain the dependencies, which are accumulated to :py:attr:`waflib.Tools.c_preproc.c_parser.nodes`
  		and :py:attr:`waflib.Tools.c_preproc.c_parser.names`.
  
  		:param node: source file
  		:type node: :py:class:`waflib.Node.Node`
  		:param env: config set containing additional defines to take into account
  		:type env: :py:class:`waflib.ConfigSet.ConfigSet`
docstring_summary: Preprocess a source file to obtain the dependencies, which are accumulated to :py:attr:`waflib.Tools.c_preproc.c_parser.nodes`
  		and :py:attr:`waflib.Tools.c_preproc.c_parser.names`.
docstring_tokens: Preprocess a source file to obtain the dependencies which are accumulated to : py : attr : waflib . Tools . c_preproc . c_parser . nodes and : py : attr : waflib . Tools . c_preproc . c_parser . names .
function: def start(self, node, env):
  		"""
  		Preprocess a source file to obtain the dependencies, which are accumulated to :py:attr:`waflib.Tools.c_preproc.c_parser.nodes`
  		and :py:attr:`waflib.Tools.c_preproc.c_parser.names`.
  
  		:param node: source file
  		:type node: :py:class:`waflib.Node.Node`
  		:param env: config set containing additional defines to take into account
  		:type env: :py:class:`waflib.ConfigSet.ConfigSet`
  		"""
  
  		debug('preproc: scanning %s (in %s)', node.name, node.parent.name)
  
  		bld = node.ctx
  		try:
  			self.parse_cache = bld.parse_cache
  		except AttributeError:
  			self.parse_cache = bld.parse_cache = {}
  
  		self.current_file = node
  		self.addlines(node)
  
  		# macros may be defined on the command-line, so they must be parsed as if they were part of the file
  		if env['DEFINES']:
  			try:
  				lst = ['%s %s' % (x[0], trimquotes('='.join(x[1:]))) for x in [y.split('=') for y in env['DEFINES']]]
  				lst.reverse()
  				self.lines.extend([('define', x) for x in lst])
  			except AttributeError:
  				# if the defines are invalid the compiler will tell the user
  				pass
  
  		while self.lines:
  			(token, line) = self.lines.pop()
  			if token == POPFILE:
  				self.count_files -= 1
  				self.currentnode_stack.pop()
  				continue
  
  			try:
  				ve = Logs.verbose
  				if ve: debug('preproc: line is %s - %s state is %s', token, line, self.state)
  				state = self.state
  
  				# make certain we define the state if we are about to enter in an if block
  				if token[:2] == 'if':
  					state.append(undefined)
  				elif token == 'endif':
  					state.pop()
  
  				# skip lines when in a dead 'if' branch, wait for the endif
  				if token[0] != 'e':
  					if skipped in self.state or ignored in self.state:
  						continue
  
  				if token == 'if':
  					ret = eval_macro(tokenize(line), self.defs)
  					if ret: state[-1] = accepted
  					else: state[-1] = ignored
  				elif token == 'ifdef':
  					m = re_mac.match(line)
  					if m and m.group(0) in self.defs: state[-1] = accepted
  					else: state[-1] = ignored
  				elif token == 'ifndef':
  					m = re_mac.match(line)
  					if m and m.group(0) in self.defs: state[-1] = ignored
  					else: state[-1] = accepted
  				elif token == 'include' or token == 'import':
  					(kind, inc) = extract_include(line, self.defs)
  					if ve: debug('preproc: include found %s    (%s) ', inc, kind)
  					if kind == '"' or not strict_quotes:
  						self.current_file = self.tryfind(inc)
  						if token == 'import':
  							self.ban_includes.add(self.current_file)
  				elif token == 'elif':
  					if state[-1] == accepted:
  						state[-1] = skipped
  					elif state[-1] == ignored:
  						if eval_macro(tokenize(line), self.defs):
  							state[-1] = accepted
  				elif token == 'else':
  					if state[-1] == accepted: state[-1] = skipped
  					elif state[-1] == ignored: state[-1] = accepted
  				elif token == 'define':
  					try:
  						self.defs[define_name(line)] = line
  					except Exception:
  						raise PreprocError("Invalid define line %s" % line)
  				elif token == 'undef':
  					m = re_mac.match(line)
  					if m and m.group(0) in self.defs:
  						self.defs.__delitem__(m.group(0))
  						#print "undef %s" % name
  				elif token == 'pragma':
  					if re_pragma_once.match(line.lower()):
  						self.ban_includes.add(self.current_file)
  			except Exception as e:
  				if Logs.verbose:
  					debug('preproc: line parsing failed (%s): %s %s', e, line, Utils.ex_stack())
function_tokens: def start ( self , node , env ) : debug ( 'preproc: scanning %s (in %s)' , node . name , node . parent . name ) bld = node . ctx try : self . parse_cache = bld . parse_cache except AttributeError : self . parse_cache = bld . parse_cache = { } self . current_file = node self . addlines ( node ) # macros may be defined on the command-line, so they must be parsed as if they were part of the file if env [ 'DEFINES' ] : try : lst = [ '%s %s' % ( x [ 0 ] , trimquotes ( '=' . join ( x [ 1 : ] ) ) ) for x in [ y . split ( '=' ) for y in env [ 'DEFINES' ] ] ] lst . reverse ( ) self . lines . extend ( [ ( 'define' , x ) for x in lst ] ) except AttributeError : # if the defines are invalid the compiler will tell the user pass while self . lines : ( token , line ) = self . lines . pop ( ) if token == POPFILE : self . count_files -= 1 self . currentnode_stack . pop ( ) continue try : ve = Logs . verbose if ve : debug ( 'preproc: line is %s - %s state is %s' , token , line , self . state ) state = self . state # make certain we define the state if we are about to enter in an if block if token [ : 2 ] == 'if' : state . append ( undefined ) elif token == 'endif' : state . pop ( ) # skip lines when in a dead 'if' branch, wait for the endif if token [ 0 ] != 'e' : if skipped in self . state or ignored in self . state : continue if token == 'if' : ret = eval_macro ( tokenize ( line ) , self . defs ) if ret : state [ - 1 ] = accepted else : state [ - 1 ] = ignored elif token == 'ifdef' : m = re_mac . match ( line ) if m and m . group ( 0 ) in self . defs : state [ - 1 ] = accepted else : state [ - 1 ] = ignored elif token == 'ifndef' : m = re_mac . match ( line ) if m and m . group ( 0 ) in self . defs : state [ - 1 ] = ignored else : state [ - 1 ] = accepted elif token == 'include' or token == 'import' : ( kind , inc ) = extract_include ( line , self . defs ) if ve : debug ( 'preproc: include found %s    (%s) ' , inc , kind ) if kind == '"' or not strict_quotes : self . current_file = self . tryfind ( inc ) if token == 'import' : self . ban_includes . add ( self . current_file ) elif token == 'elif' : if state [ - 1 ] == accepted : state [ - 1 ] = skipped elif state [ - 1 ] == ignored : if eval_macro ( tokenize ( line ) , self . defs ) : state [ - 1 ] = accepted elif token == 'else' : if state [ - 1 ] == accepted : state [ - 1 ] = skipped elif state [ - 1 ] == ignored : state [ - 1 ] = accepted elif token == 'define' : try : self . defs [ define_name ( line ) ] = line except Exception : raise PreprocError ( "Invalid define line %s" % line ) elif token == 'undef' : m = re_mac . match ( line ) if m and m . group ( 0 ) in self . defs : self . defs . __delitem__ ( m . group ( 0 ) ) #print "undef %s" % name elif token == 'pragma' : if re_pragma_once . match ( line . lower ( ) ) : self . ban_includes . add ( self . current_file ) except Exception as e : if Logs . verbose : debug ( 'preproc: line parsing failed (%s): %s %s' , e , line , Utils . ex_stack ( ) )