Difference between revisions of "User:Sytyi"

From The Battle for Wesnoth Wiki
m
m (SoC Application)
Line 301: Line 301:
 
[[Category:Summer of Code]]
 
[[Category:Summer of Code]]
 
=SoC Application=
 
=SoC Application=
http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/nicksytyi/1
+
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/nicksytyi/1]

Revision as of 17:40, 29 March 2011


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



This is a Summer of Code 2011 student page
Project: SoC_Ideas_Schema_Validation2011


This page is under development. Proposal summary is under development. Please forgive for mistakes.

Description

Sytyi - WML Validator

The main idea of WML Validator is grammar based validator on C++ generating USER-FRIENDLY error messages.

IRC

Sytyi

Proposal Summary

I want to write a grammar based validator. One tool will prepare schema file containing all tags, keys and possible values from annotated source, and another, the validator will read schema file on the beginning of the work and then, while parsing, just compare is this value allowed in this place.

Schema file

Header (version info)
Topleveltags in alphabetical order.
Each tag contains possible tags and keys. and number of possible inclusions of tag. (min and max values)
Each key contains name of key, type of value, or list of possible values and additional information (is this key mandatory, default value, value possible).

Frequently used tags are organized in global list. Tags which list of keys differs, but name are the same, are in different parent tags, and can not be in global list.

Types:
boolean
integer
float
string
Tstring (for Translated string)
LuaCode
<Predefined values>

Additional Information
!M - is mandatory (for key)
!(value) - default value. (for non-mandatory keys)
!G - tag from global list. !S - For special tags, !<0,1> number of min and max occurs. Example

[scenario]
      [label]
                                         !G
      [/label] 
      [music]
                                         !G   
      [/music]
      [side]                             !<0,-1>
          controller=<human>|<ai>|<null> !(<ai>)           
          gold=integer                   !(100)
          side=integer                   !M
      [/side]
      [story]
      [/story]
      id=string                          !M
      name=Tstring 
      next_scenario=string
      turns=integer                      !(-1) 
[/scenario]

Annotation

/* 
* @TagName  name
* @Global    #for global list tags
* @TopLevel  #for top-level tags
* @Special   #for tags, who depends on the parent tag
* @MinOccurs number 
* @MaxOccurs number 
*/
some source about tag
/* 
* @Key key
* @Default value
* @Type type
* @Mandatory
*/ 
some source about key
/* 
*@Value value
*/
some source about value

How It All Work?

After a patch the developer runs SchemaGeneratorTool to regenerate schema file. If somebody want to validate his WML document he runs ValidatorTool, and receives Error Messages like

%linenumber Mandatory key "id" is misssing in tag [scenario] which is toplevel tag in file %filename 
%linenumber Mandatory key "side" is misssing  in tag [side] which is in [scenario] in file %filename
%linenumber Unknown value in key controller  in tag [side] which is in [scenario] in file %filename

Grammar

Grammar needs some improvements in types of key values, but the main work is done.
If you see any mistake here, please contact me

EBNF form for unpreprocessed WML http://en.wikipedia.org/wiki/EBNF

Document = [ Header ], { StmntList } ;
StmntList = Statement, EOL, { StmntList } ;
Statement = { ( Tag | MacroCall | MacroDefine | TextDomain | PreprocIf ) }  ;
Tag = TagStart { ( Tag | Key | MacroCall | MacroDefine | TextDomain | PreprocIf ) }, TagEnd ;
Key = Name, { Name} ,"=", KeyValue, { KeyValue },  EOL;
MacroCall = "{", Name," ",{ " " }, MacroValue {, MacroValue} , "}"
MacroDefine = DEFINE, Name, MacroVar {, MacroVar} , StmntList, "ENDDEF";
TextDomain = "#textdomain ", Name ;
PreprocIf = (IFBegin, StmntList, [IFElse, StmntList,] IFEnd) | (Undef, MacroName);
TagStart = "[",[ "+" ], TagName , "]" ;
TagEnd = "[/", TagName ,"]" ;
(* Can TagName contain uppercase?  *)
TagName = LowerCaseLetter | "_", { LowerCaseLetter | Special  | "_"};
KeyValue = ( Name | Substitution | Strings );
Substitution = "$",  (Name | Formula) ;
Formula = "(", Name, ")" ;
MacroVar = Name;
IFBegin = "#ifdef " | "#ifhave " | "#ifndef " | "#ifnhave " | "#ifver " | "#ifnver " ;
IFElse = "#else " ;
IFEnd = "#endif" ;
DEFINE = "#define " ;
ENDDEF = "#enddef" ;
Name = Letter, { Letter };
Identifier = Letter, { Letter | Digit | Special };
Strings = ( String | TranslatedString ), { "+", ( String | TranslatedString ) };
String = '"', { ( Letter | Digit | Symbols) },'"';
TranslatedString = "_", String;
Letter = (UpperCaseLetter | LowerCaseletter | "_" );
UpperCaseLetter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" ;
LowerCaseLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" ;
Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
Sign = "+" | "-"  ;
WhiteSpace = " " | "\t" , { " " | "\t" } ;
Special = "-" | ":" ;
EOL = { "\r" },  "\n" , {  "\r"|"\n"  } 

EBNF form for preprocessed WML

Document = [ Header ], { StmntList } ;
StmntList = Statement, EOL, { StmntList } ;
Statement = { ( Tag | TextDomain ) }  ;
Tag = TagStart { ( Tag | Key ) }, TagEnd ;
Key = Name, { Name} ,"=", KeyValue, { KeyValue },  EOL;
TextDomain = "#textdomain ", Name ;
TagStart = "[",[ "+" ], TagName , "]" ;
TagEnd = "[/", TagName ,"]" ;
(* Can TagName contain uppercase?  *)
TagName = LowerCaseLetter | "_", { LowerCaseLetter | Special  | "_"};
KeyValue = ( Name | Substitution | Strings );
Substitution = "$",  (Name | Formula) ;
Formula = "(", Name, ")" ;
Name = Letter, { Letter };
Identifier = Letter, { Letter | Digit | Special };
Strings = ( String | TranslatedString ), { "+", ( String | TranslatedString ) };
String = '"', { ( Letter | Digit | Symbols) },'"';
TranslatedString = "_", String;
Letter = (UpperCaseLetter | LowerCaseletter | "_" );
UpperCaseLetter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" ;
LowerCaseLetter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" ;
Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
Sign = "+" | "-"  ;
WhiteSpace = " " | "\t" , { " " | "\t" } ;
Special = "-" | ":" ;
EOL = { "\r" },  "\n" , {  "\r"|"\n"  } 

Thanks to Timotei Dolean for providing his works about WML grammar to Eclipse plugin.

Timeline

Schema generating tool
Creating data structures and data containers
Parsing WML documents tools
Refactoring data stuctures, if necessary
Testing
Fixing bugs
Improving

Patches and commits

No one at this moment of time.

Answers to those questions

Basics

Write a small introduction to yourself.
Hello. My name is Nick Sytyi . I study Computer Engineering at the Chernigiv Technological University. I want to participate in Google Summer of Code and gain expierence in C++ and game development. I like this project and I want to encahnce it.

1.2) State your preferred email address.
nsytyi@gmail.com

1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?
IRC: Sytyi
Wesnoth forums: none for now Wesnoth wiki: Sytyi
GNA: sytyi

1.4) Why do you want to participate in summer of code?
I would like to try some serious work. I want to grow in C++ development, open source, team work and game development experience. I think the experience I gain here, will help me in future. I hope I come in project for long period of my life, because it is my dream (to develop a game) since when I was child.

1.5) What are you studying, subject, level and school?
Computer Engineering, 3rd year Faculty of Electronic Informational Technologies, Chernigiv Technological University, Ukraine.

1.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 Wesnoth. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.

No patches for now. Maybe the situation will change for better.

Experience

good knowledge of C++, Java, computer science concepts, small experience of programming translators, olympiad projects with MCS-51 and AVR stends (I know it is insignificant but it gave me experience in quick, well synchronized C programs).

2.1) What programs/software have you worked on before?
Mostly, I'am working on website development using Java EE. Also, I've done little C++ projects writing simple data manipulating programs.

2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)
Yes. Our university has command projects, and now I am a team leader for a simple course work So I was to learn SVN features.

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?
I haven't participated in the GSoC before. This is my first chance to participate.

2.4) Open Source

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

I use Ubuntu, Mozilla, Eclipse, Qt , but Wesnoth is the first open source project I am involved with.

2.5) Gaming experience - Are you a gamer?
Yes, I am a gamer )

2.5.1) What type of gamer are you?
Slow strategic gamer.

2.5.2) What type of games?
I prefer turn-based strategy games or RPG with good story.

2.5.3) What type of opponents do you prefer?
I can’t say I play good. So I prefer good opponents which sometimes teach me some tricks. When I’m beaten, I analyze, why this occurred.

2.5.4) Are you more interested in story or gameplay?
Story is more interesting for me. But if gameplay is very booooring ………….

2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer. We do not plan to favor Wesnoth players as such, but some particular projects require a good feeling for the game which is hard to get without having played intensively.
I have heard about Wesnoth first time at 18 March. It interested me, and sometimes, when I need a rest, I play a little.

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 can read and write English with few mistakes.

3.2) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.
I just ignore rough statements in address. In a team I takes the second role.

3.3) Do you give constructive advice?
Maybe. Sometimes.

3.4) Do you receive advice well?
Yes

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

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?
Yes. It is interesting to make tools for non-programmers content developers. I want to concentrate on grammar of WML. And if I have free time after all of this, maybe a simple WML GUI or including WML validation into existing GUI’s.

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

4.3) Why did you choose this project?
When I studied Google list of participating organizations, I read about your game first, I played a little, and then I want to enchance project. I am interesting in translations. WML validation seemed to me a perfect task to study the main project and a perfect task for a starter not confident in his abilities.

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".
I'll have 4 or 5 exams in June, but I hope to pass 3 of them out by auto.
3-4 days in archaelogic expedition near 15 of August.
Two times 3-4 days on bike down the river in July. I can not say current time now, it depends on the last exam and my friends. More possible it will be after stipendy at 25 of each month

4.5) Include as much technical detail about your implementation as you can
I want to write two tools. One to generate Schema file from the annotated source. and another to validate WML documents using schema. Tags are organized in a hierarchical structure. 4.6) What do you expect to gain from this project?
I expect to gain experience in game development and maybe a continious work with Wesnoth.

4.7) What would make you stay in the Wesnoth community after the conclusion of SOC?
Willing to “upgrade” myself. To know more. To work with interesting people on the interesting tasks.

Practical considerations

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

* Subversion (used for all commits) Yes.
* C++ (language used for all the normal source code)Yes STL. QT.

* Python (optional, mainly used for tools) no.
* build environments (eg cmake/autotools/scons) 'make' - yes, 'scons' no. 'autotools' - no
I don't know LUA and i'm studying WML now.
5.2) Which tools do you normally use for development? Why do you use them?
Eclipse under Windows and Ubuntu. Qt. Notepad.

5.3) What programming languages are you fluent in?
I have a little practice in Java (1 years of experience) and C/C++ (2 years of experience) I know a bit of sh/javascript/pascal/c

5.4) What spoken languages are you fluent in?
I can speak in Ukrainian (native), in Russian (native), English.

5.5) At what hours are you awake and when will you be able to be in IRC (please specify in UTC)
I'm in UTC+3 timezone in summer. I am normally awake from +11 UTC to +02 UTC, and most of that time I'm at home or some anywhere with wi-fi, so I'm able to be in IRC.

5.6) 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.
Skype : azcure

SoC Application

[1]