return new ProcedureDeclaration(location().start.line, location().start.column, type, id, fp, stmtBlock)
}
...
...
@@ -448,21 +439,11 @@ Statement
}
/ "join" ___ exp:Expression __ ";"
{
throw new PseucoSyntaxError(
location().start.line,
location().start.column,
"OldSyntax",
old_syntax
);
error(old_syntax);
}
/ "unlock" ___ exp:Expression __ ";"
{
throw new PseucoSyntaxError(
location().start.line,
location().start.column,
"OldSyntax",
old_syntax
);
error(old_syntax);
}
/ stmt:Println
{
...
...
@@ -532,12 +513,12 @@ Statement
StatementBlock
= "{" __ blockStmts:(BlockStatement __)* "}"
{
var stmts = []//[location().start.line, location().start.column];
var stmts = []
for (var i = 0; i < blockStmts.length; ++i)
{
stmts.push(blockStmts[i][0]);
}
//return construct(PCStmtBlock, stmts);
return new StatementBlock(location().start.line, location().start.column, ...stmts)
}
...
...
@@ -550,10 +531,9 @@ BlockStatement
return new StatementWrapper(location().start.line, location().start.column, stmt);
}
/ stmt:Procedure {
throw new PseucoSyntaxError(location().start.line, location().start.column, "Nested Procedure", "Nesting procedures is not possible! You can define procedures globally, in monitors or structs.");
error("Nesting procedures is not possible! You can define procedures globally, in monitors or structs.");
}
/ stmt:DeclarationStatement {
//return new StatementWrapper(location().start.line, location().start.column, stmt);
throw new PseucoSyntaxError(location().start.line, location().start.column, "Old Syntax", "You are using old pseuCo syntax. Case conditions must be send (chan <! val) or receive (<? chan) expressions or assignments of received values (x = <? chan).");
error("You are using old pseuCo syntax. Case conditions must be send (chan <! val) or receive (<? chan) expressions or assignments of received values (x = <? chan).");