Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
firebie committed Aug 6, 2011
1 parent 056fda7 commit 3163017
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Parser/time.txt
TinyAcc/bin/
TinyAcc/obj/
TinyAcc.suo

_N_GeneratedSource*.n
12 changes: 6 additions & 6 deletions Parser/Parser.n
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace tinyacc
[PegGrammar(Options = EmitDebugSources, start,
grammar
{
Any = ['\u0000'..'\uFFFF'];
any = ['\u0000'..'\uFFFF'];

#region White space

Expand All @@ -35,8 +35,8 @@ namespace tinyacc

#region Comments

singleLineComment = "//" (!newLineCharacter Any)*;
delimitedComment = "/*" (!"*/" Any)* "*/";
singleLineComment = "//" (!newLineCharacter any)*;
delimitedComment = "/*" (!"*/" any)* "*/";
comment = singleLineComment / delimitedComment;

#endregion
Expand Down Expand Up @@ -76,12 +76,12 @@ namespace tinyacc
rate : Ast = "rate" space+ currencyName space+ currencyName space+ number semicolon;
account : Ast = "account" space+ currencyName space+ number space+ accountName space* semicolon;
creditOrDebit : Ast = ('+'/ '-') space* number space+ currencyName space+ accountName space+ operationName space* semicolon;
badRecord : Ast = (!semicolon Any)* semicolon;
veryBadRecord : Ast = Any+;
badRecord : Ast = (!semicolon any)* semicolon;
veryBadRecord : Ast = any+;

definition : Ast = (rate / account / creditOrDebit / badRecord / veryBadRecord) space*;

start : List[Ast] = space* definition* !Any;
start : List[Ast] = space* definition* !any;
})]

public class AccParser
Expand Down

0 comments on commit 3163017

Please sign in to comment.