Difference between revisions of "GSoC-WMLDebugingSupport fakedrake"

From The Battle for Wesnoth Wiki
(A Rough(and Unformatted) Plan)
m (Description: fixed headers)
Line 6: Line 6:
 
I am most interested in patching the code to output accurate line numbers along with the errors and improving the error messages themselves. After that i hope to have time to make a schema system, although i believe 2 months are enough for all 3 tasks.
 
I am most interested in patching the code to output accurate line numbers along with the errors and improving the error messages themselves. After that i hope to have time to make a schema system, although i believe 2 months are enough for all 3 tasks.
  
===A Rough(and Unformatted) Plan===
+
=A Rough(and Unformatted) Plan=
  
 
The current implementation of the preprocessor leaves no stable way to trace tha file name and line number of an error.
 
The current implementation of the preprocessor leaves no stable way to trace tha file name and line number of an error.

Revision as of 18:10, 3 April 2010


This page is related to Summer of Code 2010
See the list of Summer of Code 2010 Ideas



This is a Summer of Code 2010 student page


Contents

Description

fakedrake - WML Debugging

I am most interested in patching the code to output accurate line numbers along with the errors and improving the error messages themselves. After that i hope to have time to make a schema system, although i believe 2 months are enough for all 3 tasks.

A Rough(and Unformatted) Plan

The current implementation of the preprocessor leaves no stable way to trace tha file name and line number of an error.

My proposal is to reimplement the preprocessor focusing on the final structure of the file to be parsed wich will be much more than a mere istream.

Base Classes

manager: has container of all lines:

  • container for all defined information
  • functions to direct the appropriate of them to the parser
  • rules for recognizing line subclasses
  • some private counters, eg. for the conditionals or inclusion depth
  • a dummy aprent line for the _main.cfg lines that terminates preprocessing(see later)

line: a base class that contains the line string:

  • information about the containing file,
  • the line number
  • information about the parent file(not optimal memory-wise but pretty fast)
  • virtual functions that specify the line that follows(see later)
  • (try to store all debug information in the base class so we dont have to store extra lines for debuging purposes)

Deriving From Line

ignorable: a line that is created to be destroyed after it redirects to the next line
unless it has an eof in which case it traces back to the line conducted by the parent file line
normal: a line that is nothing more than a variable or a tag(error on these lines are the aprser's job)
conditional: a line wich adds or subtracts to the skipping(as named in the current implementation) variable.
when skipping is not zero all read non-conditional lines are ignorable.
define_related: these lines are the trickiest. there might be no base class for them but for documentation purposes i put one for now
define_head: sends defining information to the manager and rises the define flag.
the following lines till #enddef are stored as strings(or even more eficient objects) as define information.
definer: this line is structured in a way to allow fast inserting of parameter values(TODO details)
define_line: contains a function that requests and evaluates the lines from the define container of the manager
and puts them in the line container.(it might be more efficient to preprocess them before inserting them in the define container)
file_includer: a line that redirects to line 1 of a file.
The thought is to delete this line and have a parent pointer to the next line
dir_includer: a line that has a stack of files(contents of a dir)
and redirects to the first line of each one in a row
then has the same redirecting behaviour as file_includer

The parser then gets the normal lines (could be through an istream but it doesnt really matter) and makes the cfg

TODO: details about this
TODO: preview the connection with the parser and the creation of a debugger class that will contain all debuging information
TODO: timeline

IRC

fakedrake

Questionnaire

1) Basics

1.1) Write a small introduction to yourself.

My real name is Chris Perivolaropoulos, I am 18 years old and i study electrical and computer engineering in the university of Patras (Greece)

1.2) State your preferred email address.

darksaga2006@gmail.com

1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?

fakedrake for the forum, fakedrake for the IRC

1.4) Why do you want to participate in summer of code?

I consider summer of code to be a great opportunity gain experience with big projects and an opportunity to work with good developers who share my enthusiasm for the subject. I am expecting to to improve my skills while contributing to a fun project and to open source in general.

1.5) What are you studying, subject, level and school?

I am in the first year of the electrical and computer engineering department of Patras university.

1.6) What country are you from, at what time are you most likely to be able to join IRC?

I'm from Greece and i am most likely to be found in the IRC in the night hours generally(10pm-3am UMT +3) but you might find me any time...

1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.

I dont have any commitments for the summer, I might go on a week long vacation some time during the summer but nothing is arranged yet.

2) Experience

2.1) What programs/software have you worked on before?

I have written the PythonGallery ( http://code.google.com/p/pythongallery ) in python(duh) but i primarily code in C/C++. I have most of my coding experience through the greek computing olympiads in which i have been taking place from 2007-2009 and have not been doing bad(places 2007: 14th, 2008: 14th, 2009: 10th), but i have been writing some small text based games with friends just to pass some time and have some experience with openGL, SDL, Qt and less with gtk.

I am also currently working on developing a stable and user friendly way of managing quotas on a linux network with ldap authentication for the computer lab of our departmet(project mentored by prof. George Thomopoulos)

finally i have been following the libmpt project, submitting bugs and hacking it very slightly to suit myself but never actually sent any patches.

2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)

I wrote 90% of pythongallery and have been doing some pair coding for minor projects but i have never been actively involved as a developer in any big projects

2.3) Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?

No, i would have applied, but i was too young...

2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.

I have done my fair share of bug reporting on anything i use, done a little code reviewing on Qgrubeditor when it was still developed by the greek PCmagazine community and as i said i have been following the libmtp project for some time now but besides the pythongallery i havent been involved in any projects that anyone took the time to put under a licence.

2.5) Gaming experience - Are you a gamer?

2.5.1) What type of gamer are you?

I play games for 3 reasons 1. is to release some steam 2. for eduactional reasons: to look at the code afterwards if its opensource 3. social reasons In other words i am not much of a hardcore gamer, i look more to the tecnical aspect of the game i am playing.

2.5.2) What type of games?

I have played a varietey of games most of which i didnt like(if i wanted awesome graphics and nothing more i would rent a dvd) but the following 4 are always installed in my windows partition: Unreal Tournament 2004, Painkiller(just the first one without the expansion), medieval total war 2 and vampire the masquerade: bloodlines(fanatic of the pen n paper one).

I also adore the monkey island series, mame games(marvel vs capcom and metal slug ftw) and a Risk game that i found recently that spares us the hundrends of calculations the physical board game needs xD

finally i have spent some hours on wesnoth.

2.5.3) What type of opponents do you prefer?

i prefer AI opponents. If i have to play a game with some friends I'd rather it is a pen n paper rpg. And also i hate 14 year olds on the other side of the world who have rooted on their pc so much playing a game that i have no chance beating them(or i am just a coward :P)

2.5.4) Are you more interested in story or gameplay?

gameplay

2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.

havent started the campaign, not finished yet, and havent played multiplayer...

2.6) If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.

no i just joined the community

3) Communication skills

3.1) Though most of our developers are not native English speakers, English is the project's working language. Describe your fluency level in written English.

I was born and lived in the US for 5 years but my parents are greek so although i can write and speak pretty fluently my english are a step behind of my greek. I also have the ECPE with pretty good marks...

3.2) What spoken languages are you fluent in?

greek, english

3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.

i think i will make it...

3.4) Do you give constructive advice?

I dont think i am the one to judge that but i try not to speak up when i hevent looked thoroughly into the subject in question.

3.5) Do you receive advice well?

If i disagree with a piece of advice i try to talk it over an convince or be convinced but in any case i try never to be rude.

3.6) Are you good at sorting useful criticisms from useless ones?

I try to consider everything and reject anything not genuine or logical

3.7) How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to "see how it turn out", taking the risk of having it thrown away if it doesn't match what the project want

Most of the code i have ever written was for purely educational reasons so i am pretty used to having my code thrown away regardless of its quality. Id rather code something and have it thrown away than not code at all. I do however value time and the opinions of others so i think there is a fine line that i shouldnt cross about this.


4) Project

4.1) Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?

i would love to work with spritesheets, but i see many people do so i would also love working with AI, networking wouldnt also be too bad. (I feel like a kid in an ice cream truck in this project xD)

4.2) If you have invented your own project, please describe the project and the scope.

-

4.3) Why did you choose this project?

I believe that improving WML in general would make wesnoth much better in the long run since most of the game's charm comes from the variety and content of the game settings, and better WML will give campaign an scenario designers more creative power. In addition to the above debugging is a very crucial aspect of a language. Personally i have never worked with parsing before but i am quite interesting in looking into it and implementing so i consider this a good chance.

4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like "I booked holidays between A and B" and "I got an exam at ABC and won't be doing much then".

4.5) Include as much technical detail about your implementation as you can

After a first (and maybe immature) glance at the code(and especially the preprocessor code) i have some things in mind:

  • re-implementation of some preprocessor things. Some parts of the code are a bit fumbled which makes them difficult to debug and modify.
  • make some minor improvements regarding the preprocessor tokens.
  • Maybe we should redistribute the function declarations/definitions in this part of the code... far from urgent though

[Obviously more to come]

4.6) What do you expect to gain from this project?

i expect to gain mostly knowledge and also i hope to meet people with the same enthusiasm in coding as me

4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?

i most probably will do so if everything goes as planned.


5) Practical considerations

===5.1) Are you familiar with any of the following tools or languages?

  • Subversion (used for all commits)
  • C++ (language used for all the normal source code)
  • STL, Boost, Sdl (C++ libraries used by Wesnoth)
  • Python (optional, mainly used for tools)
  • build environments (eg cmake/autotools/scons)
  • WML (the wesnoth specific scenario language)
  • Lua (used in combination with WML to create scenarios)===

I am with all but the latter 2 (i use autotools as a build enviromet)

5.2) Which tools do you normally use for development? Why do you use them?

Geany or kdevelop for editing and autotools for compiling... i dont really rely on tools, i would work with anything as long as i have its documentation... i use svn because i hevent tried anything else and i think it's ok as a tool...

5.3) What programming languages are you fluent in?

mostly c/c++ and python but i can code decently in bash, php and javascript... I have worked with other languages too but most are far from my favorite.

5.4) Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of "there is no way to contact you" does arise!

ok...