[Tool/Web/Other] PAWN Scanner - Scan PAWN files for information.
#1

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.
Reply
#2

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
Reply
#3

Quote:
Originally Posted by Niko_boy
View Post
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.
Reply
#4

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
Reply
#5

Quote:
Originally Posted by Niko_boy
View Post
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.
Reply
#6

Thanks slice, I'll be sure to credit you somewhere relevant.
Reply
#7

Here's how you'd create a Notepad++ configuration!

https://gist.github.com/3113705
Reply
#8

So easy to make if you know what you wanna do, but so damn sweet great work!
Reply
#9

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)
Reply
#10

Cool. Wouldn't be too hard to make an automatic GeSHi config.
Reply
#11

Yes, because to load the syntax is very easy Just using a string ..

Congratulations by the Project, Slice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)