SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 29/05/2012, 07:18 PM   #1
Mauzen
High-roller
 
Mauzen's Avatar
 
Join Date: Jun 2007
Location: Western Germany
Posts: 4,322
Reputation: 1084
Default PAWN API Generator for Notepad++

Hi,

I want to release a small tool that I made for myself recently. Im using Notepad++ as default pawn editor, as it offers some really nice things that pawno cant do. The code completion is a quite nice feature. I once used Slice's tutorial to set everything up, but got tired of the "limited" code completion after a while, as im used to code completions that update themselves whenever you add a new function to your code. Notepad++ just completes what you tell it to complete in a xml file.

And what my tool does, is automatically creating those xml files from your code. It is still in an experimental stage and a bit buggy, but it works as it should.
Its written in Java (hit me for that shit if you like) without a real GUI and distributed as .jar. To launch it, double-clicking should work for most people. If it doesnt, enter the console, jump to the .jar's directory, and type
Code:
java -jar PawnAPIGenerator.jar
It scans the given directory recursively for all include files. PWNs like gamemodes arent processed yet.
If everything goes fine, it will create two files, PAWN.xml and userDefineLang.xml. You might need to merge the userDefineLang.xml with yours, if you got several user defined languages for notepad++. Copy and install the files as explained in Slice's tutorial, but dont take the uploaded ones, but the generated files. This way you got your own API in notepad++, containing all functions you wrote (stock, public, native, and non-modified), all defines and custom tags, just like with modern IDEs. Whenever you like, run it again and overwrite the xmls with the up to date files.

You can also specify the file targets as optional parameters:
Code:
java -jar PawnAPIGenerator.jar <path to pawn source directory> <target for PAWN.xml> <target for userDefineLang.xml>
e.g. to overwrite them directly. This way you can add it to your notepad++ execute script for compiling, so the api is updated on every compile (note that it takes a restart of n++ anyways to reload the files).


Bugs
Already way less. Some of the known bugs:

Defines arent considered yet (#defines are added to the API, but not considered as replacements)
Functions with multitag parameters ( {_,Float}:... ) wont be detected correctly.
Some people got version problems with the jar, see the following:

Problems with running the jar?
Someone reported me a versioning problem with the jar. If you cant run the .jar file, try recompiling it. Therefore use this link to download the source, unzip it, and run build.bat to recompile it automatically. Note that you need the Java 7 SDK for that. If everything went fine, the new .jar should appear in the same directory and should work for your system.


Download
Github source (gonna be updated frequently)
.jar download

Feel free to give some feedback or suggestions.

Last edited by Mauzen; 02/06/2012 at 12:08 PM.
Mauzen is online now   Reply With Quote
Old 29/05/2012, 09:32 PM   #2
Shadow_
Gangsta
 
Shadow_'s Avatar
 
Join Date: Nov 2008
Location: Vatican City
Posts: 542
Reputation: 41
Default Re: PAWN API Generator for Notepad++

Really like it, great work. ( once you work out the kinks )
__________________
Shadow_ is offline   Reply With Quote
Old 01/06/2012, 11:18 AM   #3
Mauzen
High-roller
 
Mauzen's Avatar
 
Join Date: Jun 2007
Location: Western Germany
Posts: 4,322
Reputation: 1084
Default Re: PAWN API Generator for Notepad++

I rewrote parts of the scanning code, and now using new regexes. Scanning now takes some seconds, but should find all functions and natives, and parse them correctly. At this point the tool actually is useful

Defines still arent working, as interpreting them correctly isnt easy, but Im working on that.

Ill also add some code statistics, and some time maybe a GUI.
Mauzen is online now   Reply With Quote
Old 01/06/2012, 02:43 PM   #4
TheArcher
High-roller
 
TheArcher's Avatar
 
Join Date: Dec 2009
Location: Home
Posts: 2,509
Reputation: 233
Default Re: PAWN API Generator for Notepad++

How to compile, and good work...again
__________________
TheArcher is offline   Reply With Quote
Old 01/06/2012, 03:52 PM   #5
Mauzen
High-roller
 
Mauzen's Avatar
 
Join Date: Jun 2007
Location: Western Germany
Posts: 4,322
Reputation: 1084
Default Re: PAWN API Generator for Notepad++

I added a build.bat for automatic recompiling. Needs the java 7 sdk of course, but then the jar shouldnt make any versioning problems.

Edit: The generator now also adds defines to the API (but still not replaces them, the define parameters are an ugly thing to parse). Next thing Ill add will be tags I think.
Edit2: Tags are also detected and added to the syntax now.

Last edited by Mauzen; 02/06/2012 at 11:48 AM.
Mauzen is online now   Reply With Quote
Old 31/10/2012, 08:20 AM   #6
juraska
Huge Clucker
 
juraska's Avatar
 
Join Date: Apr 2011
Posts: 373
Reputation: 11
Default Re: PAWN API Generator for Notepad++

i got some weird erros:
Code:
C:\Program Files (x86)\PAWN Compiler\include\a_mysql.inc(1) : error 010: invalid function or declaration
C:\Program Files (x86)\PAWN Compiler\include\sscanf2.inc(1) : error 010: invalid function or declaration
C:\Program Files (x86)\PAWN Compiler\include\whirlpool.inc(1) : error 010: invalid function or declaration
dreamgame.pwn(1376) : error 017: undefined symbol "WP_Hash"
dreamgame.pwn(1376) : warning 202: number of arguments does not match definition
dreamgame.pwn(1376) : warning 202: numbments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright (er of arguments does not match definition
dreamgame.pwn(1394) : error 017: undefined symbol "WP_Hash"
dreamgame.pwn(1394) : warning 202: number of arguments does not match definition
dreamgame.pwn(1394) : warning 202: number of arguc) 1997-2006, ITB CompuPhase
probably syntax ain't generated correctly

EDIT: never mind, works as charm! thx!

Last edited by juraska; 31/10/2012 at 10:02 AM.
juraska is offline   Reply With Quote
Old 23/01/2013, 04:46 PM   #7
VIRUXE
Big Clucker
 
Join Date: Dec 2006
Location: Portugal
Posts: 151
Reputation: 0
Default Re: PAWN API Generator for Notepad++

Could you make it possible so that the program scans .pwn files also? In my gamemode I use "custom" includes which I gave the extension of .pwn.

Code:
#include "funcoes/utils.pwn"
#include "funcoes/geometry.pwn"
#include "funcoes/database.pwn"
#include "funcoes/game.pwn"
#include "funcoes/timers.pwn"
VIRUXE is offline   Reply With Quote
Old 05/02/2013, 04:31 AM   #8
T0pAz
Guest
 
Posts: n/a
Default Re: PAWN API Generator for Notepad++

I wish all of it could be done with a click of button. Nevertheless great work, will definitely come in handy.
  Reply With Quote
Old 03/03/2013, 10:11 PM   #9
LarzI
High-roller
 
LarzI's Avatar
 
Join Date: Apr 2007
Location: Norway
Posts: 3,554
Reputation: 130
Default Re: PAWN API Generator for Notepad++

Does this still work? I'd really like this for adding all the YSI functions for auto-completion
__________________


NEW: [FS] Simple Cellphones

if( strfind( title, "REP", true ) != -1 )
{________________________________________
Sigh();__________________________
}________________________________________


LarzI is offline   Reply With Quote
Old 03/03/2013, 11:01 PM   #10
Mauzen
High-roller
 
Mauzen's Avatar
 
Join Date: Jun 2007
Location: Western Germany
Posts: 4,322
Reputation: 1084
Default Re: PAWN API Generator for Notepad++

It should still do the job, as its all independent from the samp version. Just try it, theres nothing to lose.
Mauzen is online now   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
[Tutorial] PAWN for SA-MP in Notepad++ Slice Tutorials 389 21/11/2014 11:50 PM
[Tool/Web/Other] Pawn Color Generator [0.3c Colours, Hex.....] Naruto_Emilio Tools and Files 43 27/08/2014 07:24 PM
[Tutorial] PAWN in Notepad++ [QUICKSTEPS] LZLo Tutorials 19 23/02/2013 11:19 PM
PAWN plugin for Notepad++ ettans Help Archive 5 18/05/2011 04:23 PM
How to use pawn studio/Notepad++ to find a bracket? The_Gangstas Everything and Nothing 13 15/12/2010 03:27 AM


All times are GMT. The time now is 11:51 PM.


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