SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 14/07/2012, 01:34 PM   #1
Slice
High-roller
 
Join Date: Mar 2008
Location: Sweden
Posts: 1,899
Reputation: 1589
Default PAWN Scanner - Scan PAWN files for information.

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.

Last edited by Slice; 14/07/2012 at 03:45 PM.
Slice is offline   Reply With Quote
Old 14/07/2012, 03:29 PM   #2
Niko_boy
High-roller
 
Niko_boy's Avatar
 
Join Date: Aug 2010
Location: Somewhere i belong
Posts: 1,424
Reputation: 138
Default Re: PAWN Scanner - Scan PAWN files for information.

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
__________________
nope
•••[CLOSED]LCS•Freeroam•DM•Stunts•••AutoArena [0.3z][No SkinShot][sixtytiger.com]Want a decent Attack Defend Gamemode?
N/A176.31.229.148:7830Get This! Attack-Defend(v2.3.1)
Niko_boy is offline   Reply With Quote
Old 14/07/2012, 03:39 PM   #3
Flyfishes
Huge Clucker
 
Flyfishes's Avatar
 
Join Date: Jul 2010
Location: Stockholm, Sweden
Posts: 354
Reputation: 4
Default Re: PAWN Scanner - Scan PAWN files for information.

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.
__________________
Flyfishes is offline   Reply With Quote
Old 14/07/2012, 03:41 PM   #4
dowster
Gangsta
 
dowster's Avatar
 
Join Date: Jun 2010
Location: San Fierro
Posts: 642
Reputation: 69
Default Re: PAWN Scanner - Scan PAWN files for information.

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
__________________
dowster is offline   Reply With Quote
Old 14/07/2012, 03:46 PM   #5
Slice
High-roller
 
Join Date: Mar 2008
Location: Sweden
Posts: 1,899
Reputation: 1589
Default Re: PAWN Scanner - Scan PAWN files for information.

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.
Slice is offline   Reply With Quote
Old 14/07/2012, 04:42 PM   #6
dowster
Gangsta
 
dowster's Avatar
 
Join Date: Jun 2010
Location: San Fierro
Posts: 642
Reputation: 69
Default Re: PAWN Scanner - Scan PAWN files for information.

Thanks slice, I'll be sure to credit you somewhere relevant.
__________________
dowster is offline   Reply With Quote
Old 14/07/2012, 10:20 PM   #7
Slice
High-roller
 
Join Date: Mar 2008
Location: Sweden
Posts: 1,899
Reputation: 1589
Default Re: PAWN Scanner - Scan PAWN files for information.

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

https://gist.github.com/3113705
Slice is offline   Reply With Quote
Old 15/07/2012, 01:38 AM   #8
$mooth
Huge Clucker
 
$mooth's Avatar
 
Join Date: May 2012
Posts: 272
Reputation: 41
Default Re: PAWN Scanner - Scan PAWN files for information.

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

ProgramsDownloadVersion
MusicStreamer Mediafire 0.1
$mooth Browser Download 0.2
UT-Client-Win Download 0.01

$mooth is offline   Reply With Quote
Old 15/07/2012, 01:45 AM   #9
ipsBruno
Godfather
 
ipsBruno's Avatar
 
Join Date: Apr 2010
Location: Brazil, Caxias RS
Posts: 6,094
Reputation: 537
Default Re : PAWN Scanner - Scan PAWN files for information.

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)
__________________
Baixar Músicas Grátis
ipsBruno is offline   Reply With Quote
Old 15/07/2012, 10:07 AM   #10
Slice
High-roller
 
Join Date: Mar 2008
Location: Sweden
Posts: 1,899
Reputation: 1589
Default Re: PAWN Scanner - Scan PAWN files for information.

Cool. Wouldn't be too hard to make an automatic GeSHi config.
Slice is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Way to change .map (MTA Map) files to .pawn (SAMP Files)- luey41 Scripting Help 6 30/07/2012 11:26 PM
[Help With Pawn] Pawn and compiler is not working..... D_Less Client Support 3 09/03/2012 04:49 AM
Linking Pawn Files spd_sahil Scripting Help 15 25/01/2012 07:51 PM
[HELP] [pawn][/pawn] bbcode for phpbb3 Kasura Help Archive 4 20/11/2010 04:35 AM


All times are GMT. The time now is 07:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.