Jump to content

Alint update


Recommended Posts

Okay, I fixed some of the minor errors in alint and uploaded new binaries here. I also put the source on github and created a makefile that works with the Microsoft compiler (this didn't take a lot of work).

 

I ran the four preset scenarios through it; they seem to give quite a few errors, but I'm not sure if these are a problem with alint or actually a problem with the scenarios.

 

Also, this version currently accepts both "set_flag" and "set_sdf" as correct, and also accepts both "print_big_str_num" and "print_big_str_color". I'm not quite sure if this is right/

Link to comment
Share on other sites

Searching the Windows program I found "print_big_str" and "print_big_str_num" but not "print_big_str_color". I don't know about the Mac version.

It is easy to write a program to get a list of the calls found in Blades of Avernum.exe, even I can do it.

 

Hopefully we can work towards a bug-free Alint.

Also, knowing how Alint works we can better understand its error messages.

 

I can now download it and check it on Of Good and Evil.

 

 

03 August 2014

Latest build is found at: the link shown in post #19 below:

http://te.calref.net:8080/job/alint/

Edited by Ishad Nha
Link to comment
Share on other sites

Also, this version currently accepts both "set_flag" and "set_sdf" as correct, and also accepts both "print_big_str_num" and "print_big_str_color". I'm not quite sure if this is right/

I'm reasonably sure that one of the two print_big_str calls doesn't work, but I forget which one. You should just create a quick experiment scenario and try it to find out. I also vaguely recall set_sdf() not working, but, again, you should just try it, because I may be remembering something else.

Link to comment
Share on other sites

I'm using Mac. Sometimes when I use Alint it crashes!

 

I'm guessing in the thousands of lines of code, somewhere there is a call that it doesn't like. I'm yet to figure it out. So lately I've just been copying and pasting the lines of code I need checked and not the entire script.

 

(I think it's something in the INIT state or START state of scripts that clashes with certain calls. I'm thinking it may be my cutscenes. My scenario works fine, just not Alint)

Link to comment
Share on other sites

I can't run the Windows version of Alint, I am on Windows XP SP3.

It was built on Windows 7, so being on XP still could be something of an issue. You should be able to build the code yourself though. If you have some version of Visual Studio (including an express version, which can be downloaded for free) you should be able to build it from the console by something like this:

"C:\Progam Files\MS Visual Studio\Common7\Tools\vsvars32.bat"
nmake -f Makefile.win

The exact path on the first line depends on where Visual Studio is installed, so you'd need to check that. You also need to have flex and bison installed (probably from the sourceforge link you mentioned) and accessible in your %PATH%, with the executable files named flex.exe and bison.exe.

 

If on the other hand you're using MinGW, you should be able to just type "make" to build it. This should create an output file "alint" which you'd have to rename to "alint.exe". Again, you'll need flex and bixon install; I'm not sure if MinGW comes with versions of them, but if it doesn't, you'd need to install it, rename the executables, and put it in your %PATH%.

 

As for how to add it to your %PATH%, try this.

Link to comment
Share on other sites

Hell, have to learn two new programs: Visual Studio and Bison. Need a donation of gray matter fast.

Edit:

XP is not a supported operating system for Visual Studio Express! Is there any other way to handle this?

 

Lex.l, known errors:

line 72 ends with:

fl_shortcut_key|fl_anim_steps|floor_shimmers|fl_out_fight_town_used return

Should be:

fl_shortcut_key|fl_anim_steps|fl_shimmers|fl_out_fight_town_used return

 

line 128:

print_big_str_color { yylval.t = 'v' ; strcpy(yylval.args, "sisi"); return FUNCTION;}

should be:

print_big_str_num { yylval.t = 'v' ; strcpy(yylval.args, "sisi"); return FUNCTION;}

(This is true for Windows, don't know about the Mac version.)

Edited by Ishad Nha
Link to comment
Share on other sites

XP is not a supported operating system for Visual Studio Express! Is there any other way to handle this?

I dunno, is there an older version of VS Express around somewhere? Or you could try MinGW, or maybe even Dev C++.

 

Or I could try to figure out how to build an XP-compatible binary, I suppose.

Link to comment
Share on other sites

It is working to a degree. But, in multi-variable calls, it won't accept commas as seperating variables!

C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil Win>alint mathe.txt

Checking file 'mathe.txt':

Error line 19: Wrong arguments to function

Have '(null)x', want 'ii'

This is line 19 from the relevant file:

set_mobility(ME,0);

(I deleted the rest of the printout for brevity's sake.)

 

Then it does not accept batch checking of all scripts, a good thing to do before uploading a scenario.

C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil Win>alint -a

C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil Win>alint *.txt

Couldn't open file '*.txt': Unknown error

 

The help command works:

C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil Win>alint

Usage:alint [-advwV] file ...

-a: Check all files, not just *.txt

-d: Print bison debug trace information (You don't want to do this)

-v: More verbose output

-w: Print warnings

-V: Print current version

--: Check stdin

Options only apply to files appearing after them

Edited by Ishad Nha
Link to comment
Share on other sites

Hm, curious, your example works correctly on my Mac but fails on my Windows, just as you say... I wonder why that could be...

 

Failing to open "*.txt" could be a result of trying to run it in a directory with no text files, maybe?

 

I'm not sure if that last line of your post is a complaint or just a random observation.

Link to comment
Share on other sites

"I'm not sure if that last line of your post is a complaint or just a random observation."

Options only apply to files appearing after them

(That is the last line of the help printout.)

 

"Failing to open "*.txt" could be a result of trying to run it in a directory with no text files, maybe?"

The directory was full of the scenario's text files, so the batch-check should have worked.

Link to comment
Share on other sites

The batch-checking works okay, the printout is 9,000+ lines in length of course.

 

"Hm, curious, your example works correctly on my Mac but fails on my Windows, just as you say... I wonder why that could be..."

Have you accidentally put something Mac in your Windows code?

 

"-a: Check all files, not just *.txt"

This sounds like another batch-check, rewriting the description might make it clearer:

"-a: Check any file, not just a file with the .txt extension"

Link to comment
Share on other sites

"Hm, curious, your example works correctly on my Mac but fails on my Windows, just as you say... I wonder why that could be..."

Have you accidentally put something Mac in your Windows code?

I haven't actually touched any code yet, just tweaked the lex.l file a little (to fix things like floor_shimmers), added a couple of lines to common.h (which were needed for it to compile with Visual Studio tools), and fiddled with makefiles.

 

"-a: Check all files, not just *.txt"

This sounds like another batch-check, rewriting the description might make it clearer:

"-a: Check any file, not just a file with the .txt extension"

I think what that actually does is, normally it skips any file without a .txt extension, but with -a it checks those files too (if they're passed on the arguments list at least). So yes, the description could be clearer.
Link to comment
Share on other sites

Alint is now covered by CalRef's Jenkins server at http://te.calref.net:8080/job/alint/ with builds successful for 32- and 64-bit windows!

 

CM: If you add a webhook for the "Jenkins (GitHub plugin)" to your repo, with the url pointing to http://te.calref.net:8080/github-webhook/ it should automatically build on every push.

Link to comment
Share on other sites

Is this a rule of Alint:

"Every call should end with a Paragraph Mark"?

I'm not sure if it is, but for stylistic reasons you definitely should use proper whitespace in your scripts.

In the Windows 32 bit version, everything seems to be working except for the batch-checking function:

Couldn't open file '*.txt': Unknown error

This is not the program's fault. This is a fault with cmd.exe (Windows shell). I just popped it open in bash and it worked like a charm (Win7 x64). http://cdn.calref.net/sylae/images/misc/69efcd26c31ec52d7b5f389d63e881ba.png

Link to comment
Share on other sites

That was because cl.exe by default links in a very simplistic command parsing routine. I had to explicitly tell it to link a different one that supports globbing. I guess cmd.exe doesn't expand the globs before forking, so the program is responsible for doing it. Or something like that. Main thing is, I think I fixed the issue, and it does now work in cmd.exe, so your test might've been biased (but that said, I wouldn't be surprised if it would've worked in bash before changing that, as well as in powershell).

 

EDIT: Wait a second! I forgot to commit that fix. Whoops!

Link to comment
Share on other sites

Yes, it worked properly on the PowerShell!

It also worked on the old Command Prompt.

 

Windows PowerShell

Copyright © 2009 Microsoft Corporation. All rights reserved.

 

PS C:\Documents and Settings\Ishad Nha> cd "C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil Win"

PS C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil Win> alint -V

alint version 0.9.1a (Git revision 5ecffa0)

Compiled using i686-w64-mingw32-gcc v4.6.3

PS C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil Win> alint *.txt

 

Checking file 'goodevil.txt':

Error line 500: Function used incorrectly

 

( a few hundred lines of error reporting...)

 

Checking file 't98Grand Tempdlg.txt':

Error line 57: Talking node error

PS C:\Program Files\Blades of Avernum\Blades of Avernum Scenarios\Of Good and Evil Win>

Link to comment
Share on other sites

Do I need to sign up for GitHub before I can access the "Pull#4"?

No, as the owner of the repository it's my responsibility to make sure the pull request is handled. I already did that as of my last post, so if there's still an issue it's with Sylae's Jenkins, I'd guess.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...