Skip to content

Commit ececd03

Browse files
author
Alexander Shiryaev
committedAug 11, 2011
empty lines and redundant spaces removed in some places
1 parent fb0becf commit ececd03

18 files changed

+104
-132
lines changed
 

‎examples/ADACS.atg

+3-7
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ PRODUCTIONS
8282
ExcPart = "EXCEPTION" {ExcHandler}.
8383
ExcHandler = "WHEN" ExcWhenTail.
8484
ExcWhenTail = "OTHERS" "=>" StatList | Name { "|" Name } "=>" StatList.
85-
Stat = Pragma | NullStat | AssignStat | CallStat | Block | LoopStat
85+
Stat = Pragma | NullStat | AssignStat | CallStat | Block | LoopStat
8686
| IfStat | ExitStat | ReturnStat | CaseStat | RaiseStat.
8787
StatList = Stat {Stat}.
8888
NullStat = "NULL" ";".
8989
AssignStat = Name ":=" Expr ";".
90-
CallStat = Name ";".
90+
CallStat = Name ";".
9191
Block = [id ":"] [DeclPart] "BEGIN" {Stat} [ExcPart] "END" [ id] ";".
9292
DeclPart = "DECLARE" BodyDecl.
9393
ReturnStat = "RETURN" [Expr] ";".
@@ -116,7 +116,7 @@ PRODUCTIONS
116116
AddOp = "+" | "-" | "&".
117117
UnaryAddOp = "+" | "-".
118118
MulOp = "*" | "/" | "MOD".
119-
Name = SimpleName {NameSuffix} ["." "ALL"].
119+
Name = SimpleName {NameSuffix} ["." "ALL"].
120120
SimpleName = id.
121121
NameSuffix = "." SelSuffix | "(" Expr {"," Expr}")" | "'" id.
122122
SelSuffix = id | OpSymbol.
@@ -126,7 +126,3 @@ PRODUCTIONS
126126
AggChoice = SimpleName | SimpleExpr | DiscrRange | "OTHERS".
127127
NameList = Name { "," Name } .
128128
END AdaCS.
129-
130-
131-
132-

‎examples/C.atg

-4
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,3 @@ PRODUCTIONS
164164
UnaryOperator = "+" | "-" | "*" | "!" | "&" | "~" .
165165

166166
END C.
167-
168-
169-
170-

‎examples/CALC.atg

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COMPILER Calc
2929
def setVar( self, spix, val ):
3030
self.VARS[ spix ] = val
3131

32-
IGNORECASE
32+
IGNORECASE
3333

3434
CHARACTERS
3535
letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".

‎examples/CLANG1.atg

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
COMPILER Clang1
22
/* Simple CLANG level 1 parser.
3-
See "Programming Language Translation" by P.D. Terry (Addison Wesley 1986)
3+
See "Programming Language Translation" by P.D. Terry (Addison Wesley 1986)
44
Adapted from Pat Terry's distribution
55
*/
66

@@ -41,26 +41,26 @@ PRODUCTIONS
4141
Statement = SYNC [ CompoundStatement | Assignment
4242
| IfStatement | WhileStatement
4343
| WriteStatement | ReadStatement ] .
44-
44+
4545
Assignment = VarDesignator ":=" Expression .
46-
46+
4747
IfStatement = "IF" Condition "THEN" Statement .
4848

4949
WhileStatement = "WHILE" Condition "DO" Statement .
50-
50+
5151
WriteStatement = "WRITE" [ "(" WriteList ")" ] .
52-
52+
5353
ReadStatement = "READ" "(" VarDesignator { "," VarDesignator } ")" .
5454

5555
Condition = "ODD" "(" Expression ")"
5656
| Expression RelOp Expression SYNC .
5757

5858
WriteList = ( Expression | string ) { "," ( Expression | string ) }.
59-
59+
6060
Expression = SYNC ( Term | "+" Term | "-" Term) { AddOp Term } .
61-
61+
6262
Term = Factor { MulOp Factor } .
63-
63+
6464
Factor = SYNC (identifier | number | "(" Expression ")" ) .
6565

6666
VarDesignator = VarIdentifier .
@@ -78,7 +78,3 @@ PRODUCTIONS
7878
ConstIdentifier = identifier .
7979

8080
END Clang1.
81-
82-
83-
84-

‎examples/CLANG2.atg

-4
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,3 @@ PRODUCTIONS
293293
| ">=" (. Append(" >= ") .) .
294294

295295
END Clang2.
296-
297-
298-
299-

‎examples/Calc/CALC.INP

-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,3 @@ VAR
66
WRITE A;
77
B := A*16;
88
WRITE B*2
9-
10-
11-
12-

‎examples/Calc/CALC.atg

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ COMPILER Calc
2929
def setVar( self, spix, val ):
3030
self.VARS[ spix ] = val
3131

32-
IGNORECASE
32+
IGNORECASE
3333

3434
CHARACTERS
3535
letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".

‎examples/EXPR.atg

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ COMPILER Expr
88

99
def getNumber( self ):
1010
return int( self.token.val )
11-
11+
1212
def getVar( self ):
1313
return self.token.val
1414

@@ -62,7 +62,7 @@ PRODUCTIONS
6262
.
6363

6464
Number<out result>
65-
=
65+
=
6666
number (. result = self.getNumber() .)
6767
.
6868

‎examples/Expr.frame

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ Errors.Init( 'interactive', '', False, parser.getParsingPos, parser.errorMessage
4646
while True :
4747
try :
4848
strVal = raw_input( "Expr>" )
49-
49+
5050
except EOFError :
5151
break;
52-
52+
5353
if len(strVal) == 0 :
5454
break;
55-
55+
5656
scanner = Scanner( strVal )
5757
parser.Parse( scanner )
5858

5959
if Errors.count > 0 :
6060
Errors.Summarize( scanner.buffer )
6161
Errors.count = 0;
62-
62+
6363
sys.exit( 0 )
6464

6565
$$$

‎examples/MICROADA.atg

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PRODUCTIONS
2323
IdList = id {"," id}.
2424
Type = "ARRAY" "(" Range ")" "OF" SimpleType.
2525
SimpleType = "INTEGER" | "CHARACTER" | "BOOLEAN".
26-
ProcDecl = "PROCEDURE" id FormalPart
26+
ProcDecl = "PROCEDURE" id FormalPart
2727
["IS" {Declaration} "BEGIN" {Stat} "END" [id]] ";".
2828
FormalPart = ["(" ParamDecl {";" ParamDecl} ")"].
2929
ParamDecl = IdList ":" [ParamMode] ["ARRAY" "OF"] SimpleType.
@@ -56,4 +56,3 @@ PRODUCTIONS
5656
MulOp = "*" | "/" | "MOD".
5757

5858
END MAda.
59-

‎examples/MOD2.atg

-1
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,3 @@ PRODUCTIONS
110110
ExpList = Expr { "," Expr }.
111111

112112
END Mod2.
113-

‎examples/OBERON.atg

-1
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,3 @@ PRODUCTIONS
9191
[ ImportList ] DeclarationSequence
9292
[ "BEGIN" StatementSequence ] "END" ident "." .
9393
END Oberon.
94-

‎examples/PIMMOD2.atg

-1
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,3 @@ PRODUCTIONS
115115
{ Import } Block ident "." .
116116

117117
END Mod2.
118-

‎examples/PRETTY.atg

-1
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,3 @@ PRODUCTIONS
143143
.
144144

145145
END Pretty.
146-

‎examples/Pascal2.atg

+2-3
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ PRODUCTIONS
461461
BoundIdentifier =
462462
identifier .
463463

464-
464+
465465

466466
UnsignedNumber =
467467
unsignedInteger | unsignedReal .
@@ -478,5 +478,4 @@ PRODUCTIONS
478478
Label =
479479
unsignedInteger .
480480

481-
END Pascal .
482-
481+
END Pascal .

‎examples/TASTE.atg

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ PRODUCTIONS
111111
"END" (. Fixup(fix) .)
112112
| "WHILE" (. loopstart = pc .)
113113
Expression<out type> (. if type != BOOL:
114-
SemError(122)
114+
SemError(122)
115115
fix = pc + 1
116116
Emit2(FJMP, 0) .)
117117
"DO" StatSeq (. Emit2(JMP, loopstart)

‎examples/structs.atg

-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,3 @@ PRODUCTIONS
5959
.
6060

6161
END structDefs.
62-

‎pimaker/pimakerlib.py

+81-82
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.