Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

121 Neutral

About Anth0ny229

  • Rank
  1. Anth0ny229

    Angel Script BNF Grammar

    Ah to bad you never heard back from them that would have been great since that's pretty much what I'm using as a reference to create my own Visual Studio extension. I can't seem to find where the problem is because I can't seem to wrap my head around that recursive part of the assign part. If I do ever get it fixed ill be sure to share and if I spot anything in the comments ill be sure to let you know. Thank you!
  2. Anth0ny229

    Angel Script BNF Grammar

    UPDATE:   As a temporary fix just to make sure it wasn't me that was going crazy I made a temp var to test out a different way.   I replaced:              //    ::= 'if' '(' ASSIGN ')' STATEMENT ['else' STATEMENT]             IF.Rule = k_IF + "(" + TEMPIF + ")" + STATEMENT + (k_ELSE + STATEMENT).Q(); with:             var TEMPIF = new NonTerminal("tempif");             TEMPIF.Rule = EXPR | MakeStarRule(IDENTIFIER + EXPROP + (IDENTIFIER | LITERAL) + LOGICOP.Q());                          //    ::= 'if' '(' ASSIGN ')' STATEMENT ['else' STATEMENT]             IF.Rule = k_IF + "(" + TEMPIF + ")" + STATEMENT + (k_ELSE + STATEMENT).Q(); It seemed to at least let me setup my if statement properly // if statement if( a == b || b != a && a == 10 && b != 10 ) { // Do something if condition is true } Here's a picture:   So I'm now pretty sure it is a small issue in the BNF format in "as_parser.cpp". It is missing the setting of literals it seems as well as maybe a few other things. Rather then using this temporary fix for all the other types of statements I rather try and find the error in the .cpp so that way we can correct it there as well as have it work exactly how the Angel Script compiler works. It should not be that hard to fix but I can't seem to wrap my head around it because the recursiveness of it which is important so it's exactly how the Angel Script parser works.   I hope someone that can help out takes the time to, it's very easy to work off what I have provided and it will help everyone. If a donation is a better motivation then just let me know and i'll be more than happy to being it will help the community as a whole. Thanks again.   Also, here is what Lua's BNF looks like which was easy to implement being that it is a lot more simple than Angel Script. But at least it might be a good reference to see how they define some things. http://www.lua.org/manual/5.1/manual.html#8   - Anthony Clark
  3. Anth0ny229

    Angel Script BNF Grammar

    What i'm trying to do is create a Grammar class for Irony which is a great tool to implement languages but it requires the grammar to be defined in BNF. So far it's been going great but the issue is I'm following the BNF defined in "as_parser.cpp" and I have hit a problem where it's not recognizing the conditional statements within the for, while, do, if sections. I have followed the BNF almost exactly from within the .cpp so I'm not sure if its a problem how I implemented it of if its a small error in the BNF format. Anyways I was wondering if anyone would like to help fix this. It would help fix the BNF format in the Angel Script source if it is the problem. It would also allow people to create very nice syntax highlighters. My goal with this is once I get it down correctly is to make a Visual Studio extension for Angel Script that highlights as well as has Intellisense and all the nice features for writing code. Possible also create support for projects, and if  I get that far maybe even add support for the Debugger with a clean add-on class so anyone can use it without almost no code changes.   Attached is the project, all you need to do is compile the C# project which will create a dll. Then you open that DLL with "Irony.GrammarExplorer.exe" that I included in the Debug folder where the dll is outputted. It is very simple to get going so hopefully someone can help out even if its just a little bit. This is  a project I plan on releasing so that everyone can use it and hopefully make writing scripts just that much more fun.   You can use the Grammar explorer to open a script file to see how the highlighting works so far with the current grammar. I also included a script that I've been working with. I also removed some of the support for stuff like classes temporarily until I can fix this issue since once this problems solved it will then work with classes just fine. So with some luck someone can help me out and then we can have a nice IDE.   I'm using the Irony Dll from NuGet https://www.nuget.org/packages/Irony/   And if the exe in the debug folder does not work or you would like to rebuild or at least look at other samples here is the link https://irony.codeplex.com/   I hope someone is able to help, if you have any questions please ask. Thank you! - Anthony Clark   PS: Here is a picture of the Irony Grammar Explorer loaded with the Angel Script grammar dll I'm working on. And you can see how it only works with true or false and not other statements which I think is a problem with the BNF.    
  4. Anth0ny229

    Inheriting from application registered class

    Attached is the new as_callfunc_xenon.cpp. As I mentioned it now supports 64 bit integers. I would have posted it yesterday but I wanted to test it to be sure that I didn't accidentally break anything while in the process of adding the 64 bit support. I also wanted to thank you for all the amazing hard work you have done!
  5. Anth0ny229

    Inheriting from application registered class

    Thank you so much your the best!!! Also, I'm not sure exactly how much use the Xbox 360 version is getting but that is the platform I've been working on. I noticed how the support for 64 bit integers was not yet added after giving those a try and I have came up with a solution to fix that. They work the same as all the other integer types being that Xbox 360 is 64bit so the arguments can be passed in the registers as the others do starting with r3. For my fix all I did was change the size that the integers are passed on the temp stack from 4 to 8 bytes. and then I use a "ld" instead of "lwz" for the native ppc asm and then I also increase the step by 8 bytes from 4. There were a few more small changes within the part that sets up the temp stack but other then that it was a simple fix. If anyone is interested I can upload it somewhere.
  6. I'm trying to inherit from a registered class but I know that I must write some proxy methods and do it that way.   I have read the topic from the user manual but I am a little confused on how the factory function works in the example.   http://www.angelcode.com/angelscript/sdk/docs/manual/doc_adv_inheritappclass.html   // A factory function that can be used by the script side to create static FooScripted *Factory(); There is no actual implementation of the factory so i'm a bit confused on how the constructor is called with "asIScriptObject *obj" Becausse that is something that I will need at some point when calling inherited functions.   From the looks of it nothing is passed from the actual script code when doing   @m_obj = FooScripted_t();   So i'm wondering how I should implement the factory function so this example would work. Thank you!  
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!