Raised This Month: $ Target: $400
 0% 

TOGs SourcePawn Syntax Converter [MS Excel Based for now]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 05-14-2017 , 06:09   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #1

Quote:
Originally Posted by nergal View Post
I meant a python transcompiler that converts old sp to new syntax.
Well, if such a thing is out there, it would be nice to be made available to others. If you're proposing I develop it, again, I dont know python (yet), and would encourage you to develop it if that is your idea. I'm still leaning towards php with the code made open source, as then it can be utilized on the web by anyone, anywhere, with no need to install anything to run the tool.

Side Note: Perhaps someone can get me started with the right setup for coding/compiling scripts in Python. I've installed python 3.5 in the past and read several tutorials to learn the language....seems pretty straight forward....but I couldnt figure out what I was doing in the software and wasnt committed enough to spend forever looking for tutorials on how to compile, etc. Every tutorial I did find looked nothing like what I was looking at on my screen or had options that I was missing, etc. So, I dropped it for the time.
__________________
ThatOneGuy is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 05-15-2017 , 02:35   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #2

Quote:
Originally Posted by ThatOneGuy View Post
Well, if such a thing is out there, it would be nice to be made available to others. If you're proposing I develop it, again, I dont know python (yet), and would encourage you to develop it if that is your idea. I'm still leaning towards php with the code made open source, as then it can be utilized on the web by anyone, anywhere, with no need to install anything to run the tool.

Side Note: Perhaps someone can get me started with the right setup for coding/compiling scripts in Python. I've installed python 3.5 in the past and read several tutorials to learn the language....seems pretty straight forward....but I couldnt figure out what I was doing in the software and wasnt committed enough to spend forever looking for tutorials on how to compile, etc. Every tutorial I did find looked nothing like what I was looking at on my screen or had options that I was missing, etc. So, I dropped it for the time.
Python isn't compiled, but rather interpreted. I use Pycharm as my IDE and it works out of the box well
headline is offline
T1MOXA
Member
Join Date: Aug 2016
Old 07-10-2017 , 10:03   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #3

Error when converting https://forums.alliedmods.net/showthread.php?t=71867


Last edited by T1MOXA; 07-10-2017 at 10:04.
T1MOXA is offline
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 07-11-2017 , 00:17   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #4

Quote:
Originally Posted by T1MOXA View Post
Thanks for the feedback! I just patched this for you. Try the new version (1.1.6) in the OP.

Note: The processor doesnt handle splitting lines into multiple when multiple variable types are declared and the default values are set in the same line. This plugin has an instance of that. After fixing that, some view_as<>() stuff, and the AskPluginToLoad2 function, this is what I got.
Attached Files
File Type: sp Get Plugin or Get Source (sm_regexfilter newsyntax.sp - 326 views - 11.6 KB)
File Type: smx sm_regexfilter newsyntax.smx (11.0 KB, 152 views)
__________________
ThatOneGuy is offline
cigzag
AlliedModders Donor
Join Date: Nov 2014
Location: NZ
Old 07-12-2017 , 00:28   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #5

How in the world do you even get this too work?
cigzag is offline
T1MOXA
Member
Join Date: Aug 2016
Old 07-12-2017 , 10:03   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #6

@ThatOneGuy Thanks!

Last edited by T1MOXA; 07-12-2017 at 10:04.
T1MOXA is offline
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 07-12-2017 , 23:59   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #7

Quote:
Originally Posted by T1MOXA View Post
@ThatOneGuy Thanks!
Your welcome!

Quote:
Originally Posted by SnowTigerVidz View Post
How in the world do you even get this too work?
It is a Microsoft Excel based tool for now. All you need to do to use it is:
  1. Open the tool. If there is a yellow bar at the top asking if you want macros enabled, say yes (that allows the code to run). If there is a dialogue asking if ActiveX should run, say yes. This allows the button to work, though you could say no and run the code directly from the VBA window.
  2. Make sure your include path is set. The includes arent edited, but are used to define variable types, natives, forwards, etc.
  3. Click the button, and find the .sp file you want converted, and click ok.
  4. The file will now be processed. The original file is left as is, and the new one is in the same location and has the text " newsyntax" added to the end. After this, the tool is done.
  5. After processing, you will see the following at the top of the code:
    PHP Code:
    /* put the line below after all of the includes!
    #pragma newdecls required
    */ 
    Move the line of code (#pragma newdecls required) to be just past the last inlude. I may automate this step in the future as well.
  6. Make final edits for anything not handled by the processor (see original post for what all that is) until it compiles.
__________________

Last edited by ThatOneGuy; 07-13-2017 at 00:01.
ThatOneGuy is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-14-2017 , 18:42   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #8

Cool! Thank you.
__________________
vortex. is offline
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 07-19-2017 , 13:01   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #9

I remember requesting this when the new syntax was brand new! Great work!
Only thing that needs fixing as I can see is whenever view_as<?> needs to be placed, it just puts the variable type then a space as if it's creating a new variable.
ReFlexPoison is offline
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 07-19-2017 , 21:05   Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
Reply With Quote #10

Quote:
Originally Posted by ReFlexPoison View Post
I remember requesting this when the new syntax was brand new! Great work!
Only thing that needs fixing as I can see is whenever view_as<?> needs to be placed, it just puts the variable type then a space as if it's creating a new variable.
Correct. I couldnt think of a way to capture the view_as stuff that didnt create false positives or trigger as a false positive for another part of the code....I may look into it again when I have more time.
__________________
ThatOneGuy is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 18:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode