My favorites | Sign in
Project Logo
       
Feeds:
People details
Project owners:
  eugeny.grishul

AST builder for Objective-C++ language.

Features:

NOTE: Source files must be previously preprocessed

Useful and bugfixing patches are welcomed!

Sources currently resides in NObjective so you should checkout it from:

svn checkout http://objcmapper.googlecode.com/svn/trunk/NObjectiveAST/ NObjectiveAST

Usage

// use lexer to produce lexems
// than use parser to produce AST
var translationUnit = new Parser( new Lexer( File.ReadAllText( "..\\..\\test.cpp" ) ) ).TranslationUnit;

Example of dumped AST

<TranslationUnit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Body>
    <Statement xsi:type="TypedefStatement">
      <DeclarationExpression Modifiers="None">
        <TypeReference TypeName="char" TypeKind="Normal" Operator="Invalid" Modifiers="None" />
        <Declarations>
          <DeclarationNode Name="__int8_t">
            <TypeReference TypeName="char" TypeKind="Normal" Operator="Invalid" Modifiers="None" />
          </DeclarationNode>
        </Declarations>
      </DeclarationExpression>
    </Statement>
    <Statement xsi:type="TypedefStatement">
      <DeclarationExpression Modifiers="None">
        <TypeReference TypeName="unsigned char" TypeKind="Normal" Operator="Invalid" Modifiers="None" />
        <Declarations>
          <DeclarationNode Name="__uint8_t">
            <TypeReference TypeName="unsigned char" TypeKind="Normal" Operator="Invalid" Modifiers="None" />
          </DeclarationNode>
        </Declarations>
      </DeclarationExpression>
    </Statement>








Hosted by Google Code