This project is not actively maintained anymore, please fork this
A parser written in PHP which is able to analyse sourcepawn's .inc files and comments (annotation syntax)
<?php
// This loads a very simple PHP class autoloader, doing the basics.
// You can use your own instead.
require_once "autoloader.php";
use Bcserv\SourcepawnIncParser\PawnParser;
function pawnParserCallback($pawnElement)
{
// This dumps the whole object for demonstration.
// You should call public getters defined in
// src/Bcserv/SourcepawnIncParser/PawnElement/*.php
var_dump($pawnElement);
}
$pawnParser = new PawnParser('pawnParserCallback');
$pawnParser->parseFile('/path/to/pawnfile.inc');
- PHP >= 5.3
- A PHP autoloader to autoload the used classes
This library follows the PHP standards psr-0 and psr-1.
Add this to the require section of your composer.json in the main folder of Symfony2:
"bcserv/sourcepawn-inc-parser": "1.0.x-dev"
You maybe also need to change "minimum-stability" to "dev" if it complains about this.
Then run php composer.phar update