org.anarres.cpp
Class Preprocessor

java.lang.Object
  extended by org.anarres.cpp.Preprocessor

public class Preprocessor
extends Object


Constructor Summary
Preprocessor(File file)
           
Preprocessor(Source initial)
           
 
Method Summary
 void addMacro(Macro m)
           
protected  void error(int level, Token tok, String msg)
           
 ErrorHandler getErrorHandler()
           
protected  Map<String,Macro> getMacros()
           
protected  Source getSource()
           
protected  void include(File parent, int line, String name, boolean quoted)
           
protected  void pop_source()
           
protected  void push_source(Source source, boolean autopop)
           
 void setErrorHandler(ErrorHandler h)
           
 void setIncludePath(List<String> path)
           
 Token token()
          Returns the next preprocessor token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Preprocessor

public Preprocessor(Source initial)

Preprocessor

public Preprocessor(File file)
             throws IOException
Throws:
IOException
Method Detail

error

protected void error(int level,
                     Token tok,
                     String msg)
              throws LexerException
Throws:
LexerException

setErrorHandler

public void setErrorHandler(ErrorHandler h)

getErrorHandler

public ErrorHandler getErrorHandler()

addMacro

public void addMacro(Macro m)
              throws LexerException
Throws:
LexerException

setIncludePath

public void setIncludePath(List<String> path)

getMacros

protected Map<String,Macro> getMacros()

getSource

protected Source getSource()

push_source

protected void push_source(Source source,
                           boolean autopop)

pop_source

protected void pop_source()

include

protected void include(File parent,
                       int line,
                       String name,
                       boolean quoted)
                throws IOException,
                       LexerException
Throws:
IOException
LexerException

token

public Token token()
            throws IOException,
                   LexerException
Returns the next preprocessor token.

Throws:
LexerException - if a preprocessing error occurs.
InternalException - if an unexpected error condition arises.
IOException
See Also:
Token


Copyright © 2007 Shevek, Anarres. All Rights Reserved.