Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christoph Reichenbach
EDAP15-exercise-3
Commits
b6d2c339
Commit
b6d2c339
authored
Dec 12, 2020
by
Christoph Reichenbach
Browse files
Further location fixes; column offsets now start at zero
parent
7a355845
Changes
12
Hide whitespace changes
Inline
Side-by-side
compiler/teal0/scanner/header.flex
View file @
b6d2c339
...
...
@@ -23,7 +23,7 @@ import lang.ast.TEALParser.SyntaxError;
//
this
code
will
be
inlined
in
the
body
of
the
generated
scanner
class
%{
private
beaver
.
Symbol
sym
(
short
id
)
{
return
new
beaver
.
Symbol
(
id
,
yyline
+
1
,
yycolumn
+
1
,
yylength
(),
yytext
());
return
new
beaver
.
Symbol
(
id
,
yyline
+
1
,
yycolumn
,
yylength
(),
yytext
());
}
%}
...
...
compiler/teal0/scanner/scanner.flex
View file @
b6d2c339
...
...
@@ -40,17 +40,17 @@
{
String text = yytext();
Long data = Long.parseLong(text);
return new beaver.Symbol(Terminals.INTEGER_LITERAL, yyline + 1, yycolumn
+ 1
, yylength(), data);
return new beaver.Symbol(Terminals.INTEGER_LITERAL, yyline + 1, yycolumn, yylength(), data);
}
{HexLiteral}
{
String text = yytext();
Long data = Long.parseLong(text.substring(2), 16);
return new beaver.Symbol(Terminals.INTEGER_LITERAL, yyline + 1, yycolumn
+ 1
, yylength(), data);
return new beaver.Symbol(Terminals.INTEGER_LITERAL, yyline + 1, yycolumn, yylength(), data);
}
{StringLiteral}
{
String text = yytext();
String data = text.substring(1, text.length() - 1);
return new beaver.Symbol(Terminals.STRING_LITERAL, yyline + 1, yycolumn
+ 1
, yylength() - 2, data);
return new beaver.Symbol(Terminals.STRING_LITERAL, yyline + 1, yycolumn, yylength() - 2, data);
}
compiler/testfiles/namecheck/func_and_var.expected
View file @
b6d2c339
Multiple declarations for symbol 'dup_name' at locations: [1:
1
-1:1
8
], [2:
1
-2:2
6
], [3:
1
-3:3
6
].
Multiple declarations for symbol 'dup_name' at locations: [1:
0
-1:1
7
], [2:
0
-2:2
5
], [3:
0
-3:3
5
].
compiler/testfiles/namecheck/missing.expected
View file @
b6d2c339
Undeclared symbol 'g' at [3:
5
-3:
7
].
Undeclared symbol 'g' at [3:
4
-3:
6
].
compiler/testfiles/names/function.teal2.expected
View file @
b6d2c339
f1 [10:1
2
-10:2
3
] [3:
1
-8:
1
]
int [12:
10
-12:1
4
] (BUILTIN)[0:0-0:0]
int [18:1
1
-18:1
5
] (BUILTIN)[0:0-0:0]
int [3:
10
-3:1
4
] (BUILTIN)[0:0-0:0]
s [6:1
5
-6:1
5
] [3:1
7
-3:2
6
]
shadowed [10:2
7
-10:3
4
] [1:
1
-1:1
8
]
shadowed [13:1
4
-13:2
1
] [1:
1
-1:1
8
]
shadowed [15:1
2
-15:1
9
] [14:
5
-14:2
6
]
shadowed [5:2
3
-5:
30
] [4:
5
-4:2
2
]
sp [20:1
2
-20:1
3
] [19:
5
-19:1
6
]
string [12:1
9
-12:2
6
] (BUILTIN)[0:0-0:0]
string [3:1
9
-3:2
6
] (BUILTIN)[0:0-0:0]
t [5:1
5
-5:1
5
] [3:
8
-3:1
4
]
t1 [7:1
2
-7:1
3
] [5:
5
-5:3
1
]
f1 [10:1
1
-10:2
2
] [3:
0
-8:
0
]
int [12:
9
-12:1
3
] (BUILTIN)[0:0-0:0]
int [18:1
0
-18:1
4
] (BUILTIN)[0:0-0:0]
int [3:
9
-3:1
3
] (BUILTIN)[0:0-0:0]
s [6:1
4
-6:1
4
] [3:1
6
-3:2
5
]
shadowed [10:2
6
-10:3
3
] [1:
0
-1:1
7
]
shadowed [13:1
3
-13:2
0
] [1:
0
-1:1
7
]
shadowed [15:1
1
-15:1
8
] [14:
4
-14:2
5
]
shadowed [5:2
2
-5:
29
] [4:
4
-4:2
1
]
sp [20:1
1
-20:1
2
] [19:
4
-19:1
5
]
string [12:1
8
-12:2
5
] (BUILTIN)[0:0-0:0]
string [3:1
8
-3:2
5
] (BUILTIN)[0:0-0:0]
t [5:1
4
-5:1
4
] [3:
7
-3:1
3
]
t1 [7:1
1
-7:1
2
] [5:
4
-5:3
0
]
compiler/testfiles/semacheck/decl-kinds.expected
View file @
b6d2c339
testfiles/semacheck/decl-kinds.in[4:
5
-4:
5
]: 'g' is declared as a function, but used as a variable.
testfiles/semacheck/decl-kinds.in[5:
5
-5:
7
]: 'v' is declared as a variable, but used as a function.
testfiles/semacheck/decl-kinds.in[4:
4
-4:
4
]: 'g' is declared as a function, but used as a variable.
testfiles/semacheck/decl-kinds.in[5:
4
-5:
6
]: 'v' is declared as a variable, but used as a function.
compiler/testfiles/semacheck/global-init.expected
View file @
b6d2c339
testfiles/semacheck/global-init.in[1:
1
-1:1
1
]: Global variable does not allow explicit initialization. Its initial value is always null.
testfiles/semacheck/global-init.in[3:
1
-3:1
5
]: Global variable does not allow explicit initialization. Its initial value is always null.
testfiles/semacheck/global-init.in[1:
0
-1:1
0
]: Global variable does not allow explicit initialization. Its initial value is always null.
testfiles/semacheck/global-init.in[3:
0
-3:1
4
]: Global variable does not allow explicit initialization. Its initial value is always null.
compiler/testfiles/semacheck/linkage_kinds.expected
View file @
b6d2c339
testfiles/semacheck/linkage_kinds.in[5:
5
-5:
5
]: 'f' is declared as a function, but used as a variable.
testfiles/semacheck/linkage_kinds.in[6:
5
-6:
9
]: 'v' is declared as a variable, but used as a function.
testfiles/semacheck/linkage_kinds.in[5:
4
-5:
4
]: 'f' is declared as a function, but used as a variable.
testfiles/semacheck/linkage_kinds.in[6:
4
-6:
8
]: 'v' is declared as a variable, but used as a function.
compiler/testfiles/semacheck/lvalue-simple.teal0.expected
View file @
b6d2c339
testfiles/semacheck/lvalue-simple.in[2:
5
-2:
5
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[3:
5
-3:
7
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[4:
5
-4:
9
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[5:
5
-5:
9
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[6:
5
-6:
10
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[7:
5
-7:
8
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[9:
5
-9:
8
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[13:
5
-13:
8
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[2:
4
-2:
4
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[3:
4
-3:
6
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[4:
4
-4:
8
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[5:
4
-5:
8
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[6:
4
-6:
9
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[7:
4
-7:
7
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[9:
4
-9:
7
]: Illegal target expression for assignment.
testfiles/semacheck/lvalue-simple.in[13:
4
-13:
7
]: Illegal target expression for assignment.
compiler/testfiles/semacheck/teal1/nonnull-global.teal2.expected
View file @
b6d2c339
testfiles/semacheck/teal1/nonnull-global.in[1:
1
-1:
20
]: Global variable types cannot be qualified.
testfiles/semacheck/teal1/nonnull-global.in[1:
0
-1:
19
]: Global variable types cannot be qualified.
compiler/testfiles/semacheck/teal1/nonnull-local.teal2.expected
View file @
b6d2c339
testfiles/semacheck/teal1/nonnull-local.in[2:
5
-2:2
4
]: Qualified local variabes must be initialized.
testfiles/semacheck/teal1/nonnull-local.in[2:
4
-2:2
3
]: Qualified local variabes must be initialized.
compiler/testfiles/semacheck/teal2/struct-member.teal2.expected
View file @
b6d2c339
testfiles/semacheck/teal2/struct-member.in[1:
1
-1:3
9
]: User defined type cannot have formal type parameters.
testfiles/semacheck/teal2/struct-member.in[1:2
9
-1:3
7
]: Actual type parameters are disallowed for types other than array[T].
testfiles/semacheck/teal2/struct-member.in[3:
9
-3:1
9
]: Actual type parameters are disallowed for types other than array[T].
testfiles/semacheck/teal2/struct-member.in[1:
0
-1:3
8
]: User defined type cannot have formal type parameters.
testfiles/semacheck/teal2/struct-member.in[1:2
8
-1:3
6
]: Actual type parameters are disallowed for types other than array[T].
testfiles/semacheck/teal2/struct-member.in[3:
8
-3:1
8
]: Actual type parameters are disallowed for types other than array[T].
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment