Skip to content
Snippets Groups Projects
Commit a44bcd92 authored by Mike Collins's avatar Mike Collins
Browse files

Fixed missing Schema Name behavior and error messages for situations related...

Fixed missing Schema Name behavior and error messages for situations related to improper specification of a SCHEMA name
parent b632a7b5
No related branches found
No related tags found
No related merge requests found
......@@ -294,9 +294,24 @@
( ('SCHEMA'
$id_schema := #IDENT
[ ';' ] -- optional, although not in the syntax
/LAST #MP $input_schema_name := $id_schema/) !
$x /#error( $x err1 ); FAIL/
--Checks if schema name is a keyword in which case it causes an error
/IF #keyword($id_schema) = T ->
--PRINT 'Keyword instead of Schema name';
#name_error($id_schema err93);
FI;
--Checks if token after schema name is ':' which would indicate a composite
--meaning no schema name was provided
$next := LAST #MP $Lex[3];
IF $next = ':' ->
--PRINT 'Composite name instead of Schema name';
#name_error($id_schema err94);
FI;
LAST #MP $input_schema_name := $id_schema/) !
$x /#name_error( $x err95 ); FAIL/
)
(*
......@@ -365,6 +380,7 @@
$elt_list!.:= #pattern_list -- always returns single elt
[ $build_block := #BUILD_block
/ $elt_list !!:= $build_block.composition_operations/ ]
......@@ -378,8 +394,8 @@
LAST #MP $composites ++:= <. $event_name: $rule_body .>;
FI;
LAST #MP $this := LAST #MP $input_schema_name; -- restore back
LAST #MP $mode := local; -- may have been changed by BLOCK
RETURN $defined_event /
LAST #MP $mode := local; -- may have been changed by BLOCK
RETURN $defined_event /
##
#pattern_list
......@@ -417,24 +433,25 @@
#keyword
V'(#IDENT($$))
('ACTIVITY' ! 'ADD' ! 'AFTER' ! 'ALL' ! 'AND' ! 'APPLY' ! 'ATTRIBUTES' !
'BEFORE' ! 'BUILD' !
'CHECK' ! 'CLEAR' ! 'CONTAINS' ! 'COORDINATE' !
'DO' ! 'duration' !
'ELSE' ! 'ENCLOSING' ! 'ENSURE' ! 'EXISTS' ! 'end' !
'FI' ! 'FOR' ! 'FOREACH' ! 'FOLLOWS' ! 'FROM' ! 'false' !
('ACTIVITY' ! 'ADD' ! 'AFTER' ! 'ALL' ! 'AND' ! 'APPLY' ! 'ARROW' ! 'AS' ! 'AT' ! 'ATTRIBUTES' ! 'average' !
'BAR' ! 'BEFORE' ! 'BUILD' !
'CHAIN' ! 'CHART' ! 'CHECK' ! 'CLEAR' ! 'CONTAINS' ! 'COORDINATE' ! 'CUT_END' ! 'CUT_FRONT' !
'DIAGRAM' ! 'DISJ' ! 'DO' !
'earliest' ! 'ELSE' ! 'ENCLOSING' ! 'ENSURE' ! 'EXISTS' !
'FI' ! 'FIRST' ! 'FOLLOWS' ! 'FOR' ! 'FOREACH' ! 'FROM' !
'GLOBAL' ! 'GRAPH' !
'IF' ! 'IN' !
'LAST' ! 'LOOP' !
'MAP' ! 'MARK' ! 'MAY_OVERLAP' ! 'MAX' ! 'MIN' ! 'max' ! 'min' !
'HAS' !
'IF' ! 'IN' ! 'IS' !
'LAST' ! 'latest' ! 'LEAST' ! 'LINE' !
'MAP' ! 'MARK' ! 'MAY_OVERLAP' ! 'MIN' ! 'MAX' !
'NEW' ! 'NOT' !
'OD' ! 'ON' ! 'ONFAIL' ! 'OR' !
'PRECEDES' !
'REJECT' ! 'REPORT' ! 'RESET' ! 'ROOT' !
'SAY' ! 'SET' ! 'SHARE' ! 'SHOW' ! 'SUCH' ! 'SUM' ! 'start' ! 'STEP' !
'TABLE' ! 'TABS' ! 'THAT' ! 'THEN' ! 'THIS' ! 'TIMES' ! trace_id ! 'true' !
'REJECT' ! 'REPORT' ! 'REVERSE' ! 'ROOT' ! 'ROTATE' !
'SAY' ! 'SCHEMA' ! 'SET' ! 'SHARE' ! 'SHIFT_LEFT' ! 'SHIFT_RIGHT' !'SHOW' ! 'SORT' ! 'STEP' ! 'SUCH' ! 'SUM' !
'TABLE' ! 'TABS' ! 'THAT' ! 'THEN' ! 'THIS' ! 'TIMES' !
'WHEN' ! 'WITHIN' !
'$$scope'
'X_AXIS'
)
/RETURN T/
##
......@@ -713,4 +730,4 @@
%INCLUDE MP2-parse-comp-op.rig
%INCLUDE parse_expr.rig
%INCLUDE attribute_parsing.rig
%INCLUDE MP4_parse_view_objects.rig
%INCLUDE MP4_parse_view_objects.rig
\ No newline at end of file
......@@ -433,14 +433,16 @@
------------- auxiliary rules -------------------
#error
$a /IF LAST #MP $errors_detected > 2 -> FAIL FI;
$line := #CALL_PAS( 4 $a ) DIV 80;
$col := #CALL_PAS( 4 $a ) MOD 80;
MSG<< '*** error:';
IF $line <> 0 ->
MSG<] at $line ':' $col
FI;
LAST #MP $errors_detected +:= 1/
$a
/IF LAST #MP $errors_detected > 2 -> FAIL FI;
$line := #CALL_PAS( 4 $a ) DIV 80;
$col := #CALL_PAS( 4 $a ) MOD 80;
MSG<< '*** error:';
IF $line <> 0 ->
MSG<] at $line ':' $col
FI;
LAST #MP $errors_detected +:= 1/
( err1 /MSG<] schema name expected when actual token is $a/ !
err2 /MSG<] wrong event pattern $a / !
......@@ -534,12 +536,27 @@ err88 /MSG<] 'X_AXIS' is missing in BAR CHART declaration / !
err89 /MSG<] CLEAR operation is not allowed for BAR CHART $a / !
err90 /MSG<] file $a has no ROOT events / !
err91 /MSG<] SORTED $a should be TABLE or CHART / !
err92 /MSG<] input file $a not found / !
$any /MSG<< at token $a/
)
##
--------------------------------------------------
--Error messages for cases involving missing schema name or SCHEMA that immediately exit program
#name_error
$a
/ MSG<< '*** error:'; /
(err93 /MSG<] schema name is missing or is a reserved keyword / !
err94 /MSG<] schema name is missing / !
err95 /MSG<] Missing 'SCHEMA' or schema name / !
$any /MSG<< at token $a/
)
/#CALL_PAS(90);/
##
#unique_number
/LAST #MP $unique_number +:=1;
RETURN COPY(LAST #MP $unique_number)/
##
##
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment