#!/usr/bin/perl ################### ### Clause 10.1 ### ################### $ALF_macro_arithmetic_operator = join('$|^', 'min', 'max', 'exp', 'log', 'abs', ); ### Note: arithmetic_expression rule cannot be directly implemented as formulated in the standard. ### The naive implementation of the rule will lead to a false stop when arithmetic_value or identifier is detected: ### ... ### | '(' arithmetic_expression ')' ### | arithmetic_value | identifier ### | sign arithmetic_expression ### | arithmetic_expression arithmetic_operator arithmetic_expression ### ... ### Therefore we implement instead: ### ... ### | ( '(' arithmetic_expression ')' | arithmetic_value | identifier ) ### [ arithmetic_binary_operator arithmetic_expression ] ### ... sub ALF_arithmetic_expression { local($token) = @_; $ALF_Debug > 1 && print("# ALF Syntax Info:\tarithmetic expression evaluation started at token $token\n"); ### ( arithmetic_expression ) ( $ALF_ParserData[$token] eq '(' && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression begins with \47(\47\n")) && ($token = &ALF_arithmetic_expression($token+1)) && $ALF_ParserData[$token+1] eq ')' && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression ends with \47)\47\n")) && ($token = $token+1) ### arithmetic_value || &ALF_LexicalRule('arithmetic_value',$token) && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression begins with arithmetic_value\n")) ### identifier || &ALF_LexicalRule('identifier',$token) && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression begins with identifier\n")) ### arithmetic_operator arithmetic_expression ) && ( &ALF_LexicalRule('arithmetic_operator',$token+1) && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression continues with arithmetic_operator\n")) && ($token = &ALF_arithmetic_expression($token+2)) || ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression evaluation finished\n")) && $token ### sign arithmetic_expression ) || &ALF_LexicalRule('sign',$token) && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression begins with sign\n")) && ($token = &ALF_arithmetic_expression($token+1)) ### boolean_expression ? arithmetic_expression : arithmetic_expression || ($token = &ALF_boolean_expression($token)) && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression begins with boolean_expression\n")) && $ALF_ParserData[$token+1] eq '?' && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression continues with \47?\47\n")) && ($token = &ALF_arithmetic_expression($token+2)) && $ALF_ParserData[$token+1] eq ':' && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression continues with \47:\47\n")) && ($token = &ALF_arithmetic_expression($token+2)) ### macro_arithmetic_operator ( arithmetic_expression_list ) ### failed || ($ALF_Debug < 2 || print("# ALF Syntax Info:\tarithmetic expression evaluation failed\n")) && 0 ; } sub arithmetic_expression_list { local($token,$parent) = @_; } ################### ### Clause 10.2 ### ################### ### arithmetic operators, semantics only ################### ### Clause 10.3 ### ################### sub ALF_arithmetic_model { local($token,$parent) = @_; local ($object,$type); $type = $ALF_ParserData[$token]; # &ALF_SyntaxMatch('arithmetic_model',$type,$parent) (&ALF_SyntaxMatch('arithmetic_model',$type,$parent) || &ALF_SyntaxMatch('dynamic_template_instantiation_item',$type,$parent)) && ($object = &ALF_CreateObject($parent,$type)) && ( &ALF_trivial_arithmetic_model($token,$object) || &ALF_non_trivial_arithmetic_model($token,$object) || &ALF_SyntaxError('arithmetic_model',$token) ); } sub ALF_trivial_arithmetic_model { local($token,$object) = @_; local ($name,$value); ( $ALF_ParserData[$token+2] eq '=' && ($ALF_Name{$object} = $ALF_ParserData[$token+1]) && &ALF_LexicalRule('identifier',$token+1,1) && ($token = $token + 3) || $ALF_ParserData[$token+1] eq '=' && ($token = $token + 2) )&&( ($ALF_Debug < 1 || print("# ALF Syntax Info:\tidentified object $object as trivial_arithmetic_model\n")) && (($ALF_Value{$object} = $ALF_ParserData[$token]) || 1) && &ALF_LexicalRule('arithmetic_value',$token,1) && &ALF_SyntaxItems('arithmetic_model_qualifier',$token+1,$object) || &ALF_SyntaxError('trivial_arithmetic_model',$token) ); } sub ALF_non_trivial_arithmetic_model { local($token,$object) = @_; local ($next,$next1); ( $ALF_ParserData[$token+1] eq '{' && ($next = $token+1) || &ALF_LexicalRule('identifier',$token+1) && ($ALF_Name{$object} = $ALF_ParserData[$token+1]) && $ALF_ParserData[$token+2] eq '{' && ($next = $token+2) ) && ($ALF_Debug < 1 || print("# ALF Syntax Info:\tidentified object $object as non_trivial_arithmetic_model\n")) &&( ($next = &ALF_SyntaxItems('arithmetic_model_qualifier',$next,$object,0,1)) && $ALF_ParserData[$next] eq '}' && $next ||( ($next1 = &ALF_header_table_equation($next,$object)) && ($next = $next1) && ($next = (&ALF_trivial_min_max($next1+1,$object) || $next)) || ($next1 = &ALF_SyntaxItems('arithmetic_submodel',$next,$object,1,1)-1) && ($next < $next1) && ($next = $next1) || ($next1 = &ALF_SyntaxItems('partial_arithmetic_model_item',$next,$object,1,1)-1) && ($next < $next1) && ($next = $next1) || ($next1 = &ALF_min_typ_max($next,$object)) && ($next = $next1) ) && ($next = &ALF_SyntaxItems('arithmetic_model_qualifier',$next+1,$object,1,0)) || $ALF_ParserData[$next+1] eq '}' && ($next+1) || &ALF_SyntaxError('non_trivial_arithmetic_model',$token) ); } sub ALF_partial_arithmetic_model_item { local($token,$object) = @_; &ALF_arithmetic_model_qualifier($token,$object) || &ALF_table($token,$object) || &ALF_trivial_min_max($token,$object); } sub ALF_arithmetic_model_qualifier { local($token,$object) = @_; &ALF_non_inheritable_arithmetic_model_qualifier($token,$object) || &ALF_inheritable_arithmetic_model_qualifier($token,$object); } sub ALF_inheritable_arithmetic_model_qualifier { local($token,$object) = @_; &ALF_annotation_container($token,$object) || &ALF_annotation($token,$object) || &ALF_from_to($token,$object); } sub ALF_non_inheritable_arithmetic_model_qualifier { local($token,$object) = @_; &ALF_auxiliary_arithmetic_model($token,$object) || &ALF_violation($token,$object); } ################### ### Clause 10.4 ### ################### sub ALF_header_table_equation { local($token,$object) = @_; ($token = &ALF_header($token,$object)) && ( &ALF_table($token+1,$object) || &ALF_equation($token+1,$object) ); } sub ALF_header { local($token,$parent) = @_; local ($object,$type); $type = $ALF_ParserData[$token]; &StringMatch($type,'HEADER') && ( ($object = &ALF_CreateObject($parent,$type)) && &ALF_SyntaxItems('header_arithmetic_model',$token+1,$object) || &ALF_SyntaxError('header',$token) ); } sub ALF_header_arithmetic_model { local($token,$parent) = @_; local ($object,$type,$name); $type = $ALF_ParserData[$token]; $name = ($ALF_ParserData[$token+1] =~ /$ALF_identifier/)? $ALF_ParserData[$token+1] : 0; # &ALF_SyntaxMatch('arithmetic_model',$type,$parent) (&ALF_SyntaxMatch('arithmetic_model',$type,$parent) || &ALF_SyntaxMatch('dynamic_template_instantiation_item',$type,$parent)) && ( ($token = $name? $token+2 : $token+1) && ($object = &ALF_CreateObject($parent,$type,$name)) && &ALF_SyntaxItems('header_arithmetic_model_item',$token,$object) || &ALF_SyntaxError('header_arithmetic_model',$token) ); } sub ALF_header_arithmetic_model_item { local($token,$object) = @_; &ALF_trivial_min_max($token,$object) || &ALF_table($token,$object) || &ALF_inheritable_arithmetic_model_qualifier($token,$object); } sub ALF_equation { local($token,$parent) = @_; local ($object,$type,$start,$end); $type = $ALF_ParserData[$token]; &StringMatch($type,'EQUATION') && ( $ALF_ParserData[$token+1] eq '{' && ($start = $token + 2) && ($end = &ALF_arithmetic_expression($start)) && ($object = &ALF_CreateObject($parent,$type,0,&CreateSubArray('ALF_ParserData',$start,$end))) && (&ALF_DefineEquationFormat($object)) && $ALF_ParserData[$end+1] eq '}' && $end+1 || &ALF_SyntaxError('equation',$token+1) ); } sub ALF_table { local($token,$parent) = @_; local ($object,$type,$start,$end); $type = $ALF_ParserData[$token]; &StringMatch($type,'TABLE') && ( $ALF_ParserData[$token+1] eq '{' && ($start = $token + 2) && ($end = &ALF_LexicalItems('arithmetic_value',$start)) && ($object = &ALF_CreateObject($parent,$type,0,&CreateSubArray('ALF_ParserData',$start,$end))) && (&ALF_DefineTableFormat($object)) && $ALF_ParserData[$end+1] eq '}' && $end+1 || &ALF_SyntaxError('table',$token+1) ); } ################### ### Clause 10.5 ### ################### sub ALF_min_typ_max { local($token,$parent) = @_; ($ALF_Debug > 1) && print("# ALF Syntax Info:\tmin_typ_max evaluation started at token $token\n"); local $next; ### min max &ALF_min_max($token,$parent) ### min typ [max] || ($next = &ALF_min($token,$parent)) && ($next = &ALF_typ($next+1,$parent)) && (&ALF_max($next+1,$parent) || $next) ### typ [max] || ($next = &ALF_typ($token,$parent)) && (&ALF_max($next+1,$parent) || $next); } sub ALF_min_max { local($token,$parent) = @_; ($ALF_Debug > 1) && print("# ALF Syntax Info:\tmin_max evaluation started at token $token\n"); local $next; ### min [max] ($next = &ALF_min($token,$parent)) && (&ALF_max($next+1,$parent) || $next) ### max || &ALF_max($token,$parent); } sub ALF_min { local($token,$parent) = @_; ($ALF_Debug > 1) && print("# ALF Syntax Info:\tmin evaluation started at token $token\n"); &ALF_trivial_min($token,$parent) || &ALF_non_trivial_min($token,$parent); } sub ALF_max { local($token,$parent) = @_; ($ALF_Debug > 1) && print("# ALF Syntax Info:\tmax evaluation started at token $token\n"); &ALF_trivial_max($token,$parent) || &ALF_non_trivial_max($token,$parent); } sub ALF_typ { local($token,$parent) = @_; ($ALF_Debug > 1) && print("# ALF Syntax Info:\ttyp evaluation started at token $token\n"); &ALF_trivial_typ($token,$parent) || &ALF_non_trivial_typ($token,$parent); } sub ALF_non_trivial_min { local($token,$parent) = @_; local ($object,$type,$value); $type = $ALF_ParserData[$token]; $value = $ALF_ParserData[$token+2] if $ALF_ParserData[$token+1] eq '='; local $next = $value? $token+3 : $token+1; &StringMatch($type,'MIN') && $ALF_ParserData[$next] eq '{' && ( ($object = &ALF_CreateObject($parent,$type,0,$value)) && ( $value && &ALF_LexicalRule('arithmetic_value',$token+2,1) && ($next = &ALF_violation($next+1,$object)) || ($next = &ALF_header_table_equation($next+1,$object)) || ($next = &ALF_violation($next+1,$object)) && ($next = &ALF_header_table_equation($next+1,$object)) ) && $ALF_ParserData[$next+1] eq '}' || &ALF_SyntaxError('non_trivial_min',$token) ); } sub ALF_non_trivial_max { local($token,$parent) = @_; local ($object,$type,$value); $type = $ALF_ParserData[$token]; $value = $ALF_ParserData[$token+2] if $ALF_ParserData[$token+1] eq '='; local $next = $value? $token+3 : $token+1; &StringMatch($type,'MAX') && $ALF_ParserData[$next] eq '{' && ( ($object = &ALF_CreateObject($parent,$type,0,$value)) && ( $value && &ALF_LexicalRule('arithmetic_value',$token+2,1) && ($next = &ALF_violation($next+1,$object)) || ($next = &ALF_header_table_equation($next+1,$object)) || ($next = &ALF_violation($next+1,$object)) && ($next = &ALF_header_table_equation($next+1,$object)) ) && $ALF_ParserData[$next+1] eq '}' || &ALF_SyntaxError('non_trivial_max',$token) ); } sub ALF_non_trivial_typ { local($token,$parent) = @_; local ($object,$type,$value); $type = $ALF_ParserData[$token]; &StringMatch($type,'TYP') && $ALF_ParserData[$token+1] eq '{' && ( ($object = &ALF_CreateObject($parent,$type)) && ($token = &ALF_header_table_equation($token+2,$object)) && $ALF_ParserData[$token+1] eq '}' || &ALF_SyntaxError('non_trivial_typ',$token) ); } sub ALF_trivial_min_max { local($token,$parent) = @_; local $next; ### min [max] ($next = &ALF_trivial_min($token,$parent)) && (&ALF_trivial_max($next+1,$parent) || $next) ### max || &ALF_trivial_max($token,$parent); } sub ALF_trivial_min { local($token,$parent) = @_; local $type = $ALF_ParserData[$token]; local $value = $ALF_ParserData[$token+2]; &StringMatch($type,'MIN') && &ALF_CreateObject($parent,$type,0,$value) && $ALF_ParserData[$token+1] eq '=' && $ALF_ParserData[$token+3] eq ';' && &ALF_LexicalRule('arithmetic_value',$token+2,1) && $token+3; } sub ALF_trivial_max { local($token,$parent) = @_; local $type = $ALF_ParserData[$token]; local $value = $ALF_ParserData[$token+2]; &StringMatch($type,'MAX') && &ALF_CreateObject($parent,$type,0,$value) && $ALF_ParserData[$token+1] eq '=' && $ALF_ParserData[$token+3] eq ';' && &ALF_LexicalRule('arithmetic_value',$token+2,1) && $token+3; } sub ALF_trivial_typ { local($token,$parent) = @_; local $type = $ALF_ParserData[$token]; local $value = $ALF_ParserData[$token+2]; &StringMatch($type,'TYP') && &ALF_CreateObject($parent,$type,0,$value) && $ALF_ParserData[$token+1] eq '=' && $ALF_ParserData[$token+3] eq ';' && &ALF_LexicalRule('arithmetic_value',$token+2,1) && $token+3; } ################### ### Clause 10.6 ### ################### sub ALF_auxiliary_arithmetic_model { local($token,$parent) = @_; ($ALF_Debug > 1) && print("# ALF Syntax Info:\tauxiliary_arithmetic_model evaluation started at token $token\n"); local ($object,$type,$value); $type = $ALF_ParserData[$token]; &ALF_SyntaxMatch('arithmetic_model',$type,$parent) && ( ### auxiliary arithmetic model with value ( $ALF_ParserData[$token+1] eq '=' && &ALF_LexicalRule('arithmetic_value',$token+2,1) && ($value = $ALF_ParserData[$token+2]) && ($token = $token + 3) ### auxiliary arithmetic model without value || ($token = $token + 1) ### create auxiliary arithmetic model object ) && ($object = &ALF_CreateObject($parent,$type,0,$value)) && &ALF_SyntaxItems('inheritable_arithmetic_model_qualifier',$token,$object) || &ALF_SyntaxError('auxiliary_arithmetic_model',$token) ); } ################### ### Clause 10.7 ### ################### sub ALF_arithmetic_submodel { local($token,$parent) = @_; local ($object,$type); $type = $ALF_ParserData[$token]; &ALF_SyntaxMatch('arithmetic_submodel',$type,$parent) && ($object = &ALF_CreateObject($parent,$type)) && ( &ALF_trivial_arithmetic_submodel($token,$object) || &ALF_non_trivial_arithmetic_submodel($token,$object) || &ALF_SyntaxError('arithmetic_submodel',$token) ); } sub ALF_trivial_arithmetic_submodel { local($token,$object) = @_; local $value; $ALF_ParserData[$token+1] eq '=' && ($ALF_Debug < 1 || print("# ALF Syntax Info:\tidentified object $object as trivial_arithmetic_submodel\n")) && (($ALF_Value{$object} = $ALF_ParserData[$token+2]) || 1) && ( &ALF_LexicalRule('arithmetic_value',$token+2,1) && $ALF_ParserData[$token+3] eq ';' && $token + 3 || &ALF_SyntaxError('trivial_arithmetic_submodel',$token) ); } sub ALF_non_trivial_arithmetic_submodel { local($token,$object) = @_; local ($value,$next); $ALF_ParserData[$token+1] eq '{' && ($ALF_Children{$object} = &CreateArray()) && ($ALF_Debug < 1 || print("# ALF Syntax Info:\tidentified object $object as non_trivial_arithmetic_submodel\n")) && ( ( ($next = (&ALF_violation($token+2,$object) || $token+2)) && ($next = &ALF_min_max($next+1,$object)) || ($next = &ALF_header_table_equation($token+2,$object)) && ($next = (&ALF_trivial_min_max($next+1,$object) || $next+1)) || ($next = &ALF_min_typ_max($token+2,$object)) ) && $ALF_ParserData[$next+1] eq '}' && $next+1 || &ALF_SyntaxError('non_trivial_arithmetic_submodel',$token) ); } ################### ### Clause 10.8 ### ################### sub ALF_arithmetic_model_container { local($token,$parent) = @_; &ALF_SyntaxMatch('arithmetic_model_container',$ALF_ParserData[$token],$parent) && $ALF_ParserData[$token+1] eq '{' && ( &ALF_limit_arithmetic_model_container($token,$parent) || &ALF_early_late_arithmetic_model_container($token,$parent) || &ALF_general_arithmetic_model_container($token,$parent) ); } $ALF_SyntaxRule{'LIMIT'} = 'arithmetic_model_container'; $ALF_SyntaxRule{'EARLY'} = 'arithmetic_model_container'; $ALF_SyntaxRule{'LATE'} = 'arithmetic_model_container'; sub ALF_limit_arithmetic_model_container { local($token,$parent) = @_; ($ALF_Debug > 1) && print("# ALF Syntax Info:\tlimit_arithmetic_model_container evaluation started at token $token\n"); local ($object,$type); $type = $ALF_ParserData[$token]; &StringMatch($type,'LIMIT') && ( ($object = &ALF_CreateObject($parent,$type)) && ($token = &ALF_SyntaxItems('limit_arithmetic_model',$token+1,$object)) || &ALF_SyntaxError('limit_arithmetic_model_container',$token) ); } sub ALF_limit_arithmetic_model { local($token,$parent) = @_; ($ALF_Debug > 1) && print("# ALF Syntax Info:\tlimit_arithmetic_model evaluation started at token $token\n"); local ($object,$type,$name); $type = $ALF_ParserData[$token]; $name = &ALF_LexicalRule('identifier',$token+1)? $ALF_ParserData[$token+1] : 0; $token = $name? $token+2 : $token+1; ($object = &ALF_CreateObject($parent,$type,$name)) && ( ($token = &ALF_SyntaxItems('arithmetic_model_qualifier',$token,$object,0,1)) && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tlimit_arithmetic_model_body evaluation started at token $token\n")) && ($token = &ALF_limit_arithmetic_model_body($token,$object)) && ($ALF_Debug < 2 || print("# ALF Syntax Info:\tlimit_arithmetic_model_body evaluation finished at token $token\n")) && ($ALF_ParserData[$token+1] eq '}') && $token+1 || &ALF_SyntaxError('limit_arithmetic_model',$token) ); } sub ALF_limit_arithmetic_model_body { local($token,$parent) = @_; &ALF_min_max($token,$parent) || &ALF_SyntaxItems('limit_arithmetic_submodel',$token,$parent,1,1)-1; } sub ALF_limit_arithmetic_submodel { local($token,$parent) = @_; local ($object,$type,$value,$next); $type = $ALF_ParserData[$token]; &ALF_SyntaxMatch('arithmetic_submodel',$type,$parent) && ( $object = &ALF_CreateObject($parent,$type)) && ( $ALF_ParserData[$token+1] eq '{' && ($next = (&ALF_violation($token+2,$object) || $token+1)) && ($next = &ALF_min_max($next+1,$object)) && $ALF_ParserData[$next+1] eq '}' && $next+1 || &ALF_SyntaxError('limit_arithmetic_submodel',$token) ); } sub ALF_early_late_arithmetic_model_container { local($token,$parent) = @_; &ALF_early_arithmetic_model_container($token,$parent) && (&ALF_late_arithmetic_model_container($token,$parent) || $token) || &ALF_late_arithmetic_model_container($token,$parent); } sub ALF_early_arithmetic_model_container { local($token,$parent) = @_; local ($object,$type); $type = $ALF_ParserData[$token]; &StringMatch($type,'EARLY') && ( ($object = &ALF_CreateObject($parent,$type)) && &ALF_SyntaxItems('arithmetic_model',$token+1,$object) || &ALF_SyntaxError('early_arithmetic_model_container',$token) ); } sub ALF_late_arithmetic_model_container { local($token,$parent) = @_; local ($object,$type); $type = $ALF_ParserData[$token]; &StringMatch($type,'LATE') && ( ($object = &ALF_CreateObject($parent,$type)) && &ALF_SyntaxItems('arithmetic_model',$token+1,$object) || &ALF_SyntaxError('late_arithmetic_model_container',$token) ); } $ALF_SyntaxRule{'VECTOR.EARLY'} = 'arithmetic_model_container'; $ALF_SyntaxRule{'VECTOR.LATE'} = 'arithmetic_model_container'; sub ALF_general_arithmetic_model_container { local($token,$parent) = @_; local ($object,$type); $type = $ALF_ParserData[$token]; ($object = &ALF_CreateObject($parent,$type)) && &ALF_SyntaxItems('arithmetic_model',$token+1,$object) || &ALF_SyntaxError('arithmetic_model_container',$token) ; } ################### ### Clause 10.9 ### ################### $ALF_SyntaxRule{'ARITHMETIC_MODEL.UNIT'} = 'single_value_annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.CALCULATION'} = 'single_value_annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.INTERPOLATION'} = 'single_value_annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.MODEL'} = 'single_value_annotation'; ################### ### Clause 10.10 ## ################### sub ALF_violation { local($token,$parent) = @_; local ($object,$type); $type = $ALF_ParserData[$token]; &StringMatch($type,'VIOLATION') && ( ($object = &ALF_CreateObject($parent,$type)) && &ALF_SyntaxItems('violation_item',$token+1,$object) || &ALF_SyntaxError('violation',$token+1) ); } sub ALF_violation_item { local($token,$object) = @_; # &ALF_behavior($token,$object) || &ALF_single_value_annotation($token,$object); } $ALF_SyntaxRule{'VIOLATION.MESSAGE_TYPE'} = 'single_value_annotation'; $ALF_SyntaxRule{'VIOLATION.MESSAGE'} = 'single_value_annotation'; ################### ### Clause 10.11 ## ################### $ALF_SyntaxRule{'TIME'} = 'arithmetic_model'; $ALF_SyntaxRule{'FREQUENCY'} = 'arithmetic_model'; $ALF_SyntaxRule{'DELAY'} = 'arithmetic_model'; $ALF_SyntaxRule{'RETAIN'} = 'arithmetic_model'; $ALF_SyntaxRule{'SLEWRATE'} = 'arithmetic_model'; $ALF_SyntaxRule{'SETUP'} = 'arithmetic_model'; $ALF_SyntaxRule{'HOLD'} = 'arithmetic_model'; $ALF_SyntaxRule{'RECOVERY'} = 'arithmetic_model'; $ALF_SyntaxRule{'REMOVAL'} = 'arithmetic_model'; $ALF_SyntaxRule{'NOCHANGE'} = 'arithmetic_model'; $ALF_SyntaxRule{'ILLEGAL'} = 'arithmetic_model'; $ALF_SyntaxRule{'PULSEWIDTH'} = 'arithmetic_model'; $ALF_SyntaxRule{'PERIOD'} = 'arithmetic_model'; $ALF_SyntaxRule{'JITTER'} = 'arithmetic_model'; $ALF_SyntaxRule{'SKEW'} = 'arithmetic_model'; $ALF_SyntaxRule{'THRESHOLD'} = 'arithmetic_model'; $ALF_SyntaxRule{'NOISE'} = 'arithmetic_model'; $ALF_SyntaxRule{'NOISE_MARGIN'} = 'arithmetic_model'; $ALF_SyntaxRule{'POWER'} = 'arithmetic_model'; $ALF_SyntaxRule{'ENERGY'} = 'arithmetic_model'; ################### ### Clause 10.12 ## ################### sub ALF_from_to { local($token,$parent) = @_; ($ALF_Debug > 1) && print("# ALF Syntax Info:\tfrom_to evaluation started at token $token\n"); local ($object,$type); $type = $ALF_ParserData[$token]; &StringMatch($type,'FROM','TO') && ( ($object = &ALF_CreateObject($parent,$type)) && &ALF_SyntaxItems('from_to_item',$token+1,$object) || &ALF_SyntaxError('from_to',$token+1) ); } sub ALF_from_to_item { local($token,$object) = @_; &ALF_arithmetic_model($token,$object) || &ALF_single_value_annotation($token,$object); } $ALF_SyntaxRule{'FROM'} = 'from_to'; $ALF_SyntaxRule{'TO'} = 'from_to'; ################### ### Clause 10.13 ## ################### $ALF_SyntaxRule{'ARITHMETIC_MODEL.EDGE_NUMBER'} = 'single_value_annotation'; $ALF_SyntaxRule{'FROM.EDGE_NUMBER'} = 'single_value_annotation'; $ALF_SyntaxRule{'TO.EDGE_NUMBER'} = 'single_value_annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.MEASUREMENT'} = 'single_value_annotation'; ################### ### Clause 10.14 ## ################### $ALF_SyntaxRule{'PROCESS'} = 'arithmetic_model'; $ALF_SyntaxRule{'DERATE_CASE'} = 'arithmetic_model'; $ALF_SyntaxRule{'TEMPERATURE'} = 'arithmetic_model'; ################### ### Clause 10.15 ## ################### $ALF_SyntaxRule{'VOLTAGE'} = 'arithmetic_model'; $ALF_SyntaxRule{'CURRENT'} = 'arithmetic_model'; $ALF_SyntaxRule{'CAPACITANCE'} = 'arithmetic_model'; $ALF_SyntaxRule{'RESISTANCE'} = 'arithmetic_model'; $ALF_SyntaxRule{'INDUCTANCE'} = 'arithmetic_model'; ################### ### Clause 10.16 ## ################### $ALF_SyntaxRule{'ARITHMETIC_MODEL.COMPONENT'} = 'single_value_annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.FLOW'} = 'single_value_annotation'; ################### ### Clause 10.17 ## ################### $ALF_SyntaxRule{'DRIVE_STRENGTH'} = 'arithmetic_model'; $ALF_SyntaxRule{'SWITCHING_BITS'} = 'arithmetic_model'; ################### ### Clause 10.18 ## ################### $ALF_SyntaxRule{'CONNECTIVITY'} = 'arithmetic_model'; $ALF_SyntaxRule{'DRIVER'} = 'arithmetic_model'; $ALF_SyntaxRule{'RECEIVER'} = 'arithmetic_model'; $ALF_SyntaxRule{'FANIN'} = 'arithmetic_model'; $ALF_SyntaxRule{'FANOUT'} = 'arithmetic_model'; $ALF_SyntaxRule{'CONNECTIONS'} = 'arithmetic_model'; ################### ### Clause 10.19 ## ################### $ALF_SyntaxRule{'SIZE'} = 'arithmetic_model'; $ALF_SyntaxRule{'AREA'} = 'arithmetic_model'; $ALF_SyntaxRule{'PERIMETER'} = 'arithmetic_model'; $ALF_SyntaxRule{'EXTENSION'} = 'arithmetic_model'; $ALF_SyntaxRule{'THICKNESS'} = 'arithmetic_model'; $ALF_SyntaxRule{'HEIGHT'} = 'arithmetic_model'; $ALF_SyntaxRule{'WIDTH'} = 'arithmetic_model'; $ALF_SyntaxRule{'LENGTH'} = 'arithmetic_model'; $ALF_SyntaxRule{'DISTANCE'} = 'arithmetic_model'; $ALF_SyntaxRule{'OVERHANG'} = 'arithmetic_model'; $ALF_SyntaxRule{'DENSITY'} = 'arithmetic_model'; ################### ### Clause 10.20 ## ################### $ALF_SyntaxRule{'ARITHMETIC_MODEL.CONNECT_RULE'} = 'single_value_annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.BETWEEN'} = 'multi_value_annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.MEASURE'} = 'single_value_annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.REFERENCE'} = 'annotation_container'; $ALF_SyntaxRule{'REFERENCE.identifier'} = 'single_value_annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.ANTENNA'} = 'annotation'; $ALF_SyntaxRule{'ARITHMETIC_MODEL.TARGET'} = 'annotation'; ### Errata: This definition duplicates definition in Clause 8.30 ### $ALF_SyntaxRule{'ARITHMETIC_MODEL.PATTERN'} = 'annotation'; ################### ### Clause 10.21 ## ################### $ALF_SyntaxRule{'HIGH'} = 'arithmetic_submodel'; $ALF_SyntaxRule{'LOW'} = 'arithmetic_submodel'; $ALF_SyntaxRule{'RISE'} = 'arithmetic_submodel'; $ALF_SyntaxRule{'FALL'} = 'arithmetic_submodel'; ################### ### Clause 10.22 ## ################### $ALF_SyntaxRule{'HORIZONTAL'} = 'arithmetic_submodel'; $ALF_SyntaxRule{'VERTICAL'} = 'arithmetic_submodel'; $ALF_SyntaxRule{'ACUTE'} = 'arithmetic_submodel'; $ALF_SyntaxRule{'OBTUSE'} = 'arithmetic_submodel'; 1;