PAWN Scanner - Scan PAWN files for information. -
Slice - 14.07.2012
This is mainly meant for automatically creating syntax-highlighting based on your own code.
Quick example:
Code:
<?php
include 'PAWNScanner.php';
$scanner = new PAWNScanner\Scanner();
$scanner->scan_dir('include', 'a_npc.inc');
// Most things can be casted to strings
echo $scanner->functions['SetPlayerPos'] . "\n";
// They're split into pieces, however.
echo $scanner->functions['SetPlayerPos']->name . "\n";
echo $scanner->functions['SetPlayerPos']->arguments . "\n";
// Argument lists are subclasses of VariableList.
echo $scanner->functions['SetPlayerPos']->arguments->variables[1] . "\n";
echo $scanner->functions['SetPlayerPos']->arguments->variables[1]->tags . "\n";
?>
Output:
Code:
native SetPlayerPos(playerid, Float:x, Float:y, Float:z)
SetPlayerPos
playerid, Float:x, Float:y, Float:z
Float:x
Float
The code is well-documented, go have a look.
Hosted on GitHub, get it
here.
Re: PAWN Scanner - Scan PAWN files for information. -
Niko_boy - 14.07.2012
Another great working code from you Slice

le* me tries it :d
Edit:err, how to use it o.o , i created two documents one PAWNScanner.php and testsyntax.php in Xamp>HTDocs
and i get following error
->
Fatal error: Class 'PAWNScannerScanner' not found in C:\xampp\htdocs\testsyntax.php on line 4
mm
Re: PAWN Scanner - Scan PAWN files for information. -
Flyfishes - 14.07.2012
Quote:
Originally Posted by Niko_boy
Another great working code from you Slice

le* me tries it :d
Edit:err, how to use it o.o , i created two documents one PAWNScanner.php and testsyntax.php in Xamp>HTDocs
and i get following error
->
Fatal error: Class 'PAWNScannerScanner' not found in C:\xampp\htdocs\testsyntax.php on line 4
mm 
|
Include the source of the page that gives you the error please.
Re: PAWN Scanner - Scan PAWN files for information. -
dowster - 14.07.2012
Would you be okay with me using this to pretty up one of my projects. I was just going to have it dump the plain code in the browser for copy and paste but I'm thinking it would look alot nicer if it was interactive.
The project: Download center for FilterScripts, Mapps, and Tools
Re: PAWN Scanner - Scan PAWN files for information. -
Slice - 14.07.2012
Quote:
Originally Posted by Niko_boy
Another great working code from you Slice

le* me tries it :d
Edit:err, how to use it o.o , i created two documents one PAWNScanner.php and testsyntax.php in Xamp>HTDocs
and i get following error
->
Fatal error: Class 'PAWNScannerScanner' not found in C:\xampp\htdocs\testsyntax.php on line 4
mm 
|
The PHP tags hodes backslashes.. Try again with the updated example.
@dowster: Go right ahead.
Re: PAWN Scanner - Scan PAWN files for information. -
dowster - 14.07.2012
Thanks slice, I'll be sure to credit you somewhere relevant.
Re: PAWN Scanner - Scan PAWN files for information. -
Slice - 14.07.2012
Here's how you'd create a Notepad++ configuration!
https://gist.github.com/3113705
Re: PAWN Scanner - Scan PAWN files for information. -
$mooth - 15.07.2012
So easy to make if you know what you wanna do, but so damn sweet

great work!
Re : PAWN Scanner - Scan PAWN files for information. -
ipsBruno - 15.07.2012
Good Work Slice?
Ah,
Quote:
This is mainly meant for automatically creating syntax-highlighting based on your own code.
|
Good work

_
You know Geshi?
DracoBlue made include Pawn to geshi, to implement:
Print with
syntax-highlighting:
PHP Code:
include_once("geshi/geshi.php");
$geshi = new GeSHi($codigo, "Pawn");
$fp = fopen("codeSINTAX.html", "a");
fwrite($fp, $geshi-> parse_code($codigo));
fclose($fp);
Now goto "codeSINTAX.HTML" and look the code with colors
-----
~~ >
http://sourceforge.net/projects/geshi/files/
~~ >
https://bitbucket.org/eckstasy/paste...geshi/pawn.php (put in Geshi/Pawn.php)
Re: PAWN Scanner - Scan PAWN files for information. -
Slice - 15.07.2012
Cool. Wouldn't be too hard to make an automatic GeSHi config.
Re : PAWN Scanner - Scan PAWN files for information. -
ipsBruno - 15.07.2012
Yes, because to load the syntax is very easy

Just using a string ..
Congratulations by the Project, Slice