%%-------------------------------------------------------------------- %% %CopyrightBegin% %% %% Copyright Ericsson AB 1999-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicable law or agreed to in writing, software %% distributed under the License is distributed on an "AS IS" BASIS, %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. %% %% %CopyrightEnd% %% %%-------------------------------------------------------------------- %% File : cosNotification_Grammar.yrl %% Purpose : Implement the constraint grammar for CosNotification filters. %%-------------------------------------------------------------------- Nonterminals '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' ''. Terminals % 'dbslsh' 'bslshd' 'bslsh' 'ident' 'string' '_length' '_d''_type_id' '_repos_id' 'not' 'or' 'and' 'num' 'in' '~' '.' 'dollar' 'ADDOP' 'RELOP' 'MULOP' 'default' 'exist' 'TRUE' 'FALSE' '(' ')' '[' ']' 'int'. Left 100 'or'. Left 200 'and'. %Nonassoc 300 'RELOP'. % '==', '!=', '<', '>', '<=', '=>' Left 300 'RELOP'. %Nonassoc 400 'in'. Left 400 'in'. %Nonassoc 500 '~'. Left 500 '~'. Left 600 'ADDOP'. % '+', '-' Left 700 'MULOP'. % '*', '/' Unary 800 'not'. Unary 900 'exist'. Unary 900 'default'. %Unary 900 'u-'. % unary minus Rootsymbol ''. Endsymbol '$end'. '' -> '$empty' : '$empty'. '' -> '' : '$1'. '' -> '' : '$1'. '' -> '' : '$1'. '' -> '' 'or' '' : {'or', '$1', '$3'}. '' -> '' : '$1'. '' -> '' 'and' '' : {'and', '$1', '$3'}. '' -> '' : '$1'. '' -> '' 'RELOP' '' : {element(2, '$2'), '$1', '$3'}. '' -> '' : '$1'. '' -> '' : '$1'. '' -> '' 'in' '' : {'in', '$1', '$3'}. '' -> '' 'in' 'dollar' '' : {'in', '$1', examin_comp({'component', '$4'})}. '' -> '' : '$1'. '' -> '' '~' '' : {'~', '$1', '$3'}. '' -> '' : '$1'. '' -> '' 'ADDOP' '' : {element(2, '$2'), '$1', '$3'}. '' -> '' : '$1'. '' -> '' 'MULOP' '' : {element(2, '$2'), '$1', '$3'}. '' -> '' : '$1'. '' -> 'not' '' : {'not', '$2'}. '' -> '(' '' ')' : '$2'. '' -> 'num' : element(2, '$1'). '' -> 'int' : element(2, '$1'). '' -> 'string' : element(2, '$1'). '' -> 'TRUE' : 'true'. '' -> 'FALSE' : 'false'. '' -> 'ADDOP' 'num' : create_unary(element(2, '$1'), element(2, '$2')). '' -> 'ADDOP' 'int' : create_unary(element(2, '$1'), element(2, '$2')). '' -> '' : list_to_atom('$1'). '' -> 'dollar' '' : examin_comp({component, '$2'}). '' -> 'default' 'dollar' '' : examin_comp({'default_component', '$3'}). '' -> 'exist' 'dollar' '' : examin_comp({'exist_component', '$3'}). %% The following rules are used to create Components. The format used is: %% [...] '' -> '.' '' : '$2'. '' -> '[' 'int' ']' '' : [{'arrindex', element(2, '$2')} | '$4']. %% CompArray '' -> '(' '' ')' '' : [{'associd', '$2'} | '$4']. %%CompAssoc '' -> '' '' : [{'varid', '$1'} | '$2']. %% run-time variable '' -> '$empty' : []. '' -> '.' '' : '$2'. '' -> '[' 'int' ']' '' : [{'arrindex', element(2, '$2')} | '$4']. %% CompArray '' -> '(' '' ')' '' : [{'associd', '$2'} | '$4']. %%CompAssoc '' -> '$empty' : []. '' -> '' '' : [{'dotid', '$1'} | '$2']. '' -> 'int' '' : [{'dotint', element(2, '$1')} | '$2']. %% ComPos '' -> '(' '' ')' '' : ['$2' | '$4']. %% UnionPos '' -> '_length' : ['_length']. %% arrays or sequences ONLY '' -> '_d' : ['_d']. %% discriminated unions ONLY '' -> '_type_id' : ['_type_id']. %% ok if info can be obtained '' -> '_repos_id' : ['_repos_id']. %% ok if info can be obtained '' -> 'ident' : element(2, '$1'). '' -> 'bslsh' 'ident' : element(2, '$2'). '' -> 'int' : {'uint', element(2, '$1')}. '' -> 'ADDOP' 'int' : {'uint', create_unary(element(2, '$1'), element(2, '$2'))}. '' -> 'string' : {'ustr', element(2, '$1')}. '' -> '$empty': 'default'. Erlang code. %%-------------------------------------------------------------------- %% %% %CopyrightBegin% %% %% Copyright Ericsson AB 1999-2009. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicable law or agreed to in writing, software %% distributed under the License is distributed on an "AS IS" BASIS, %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. %% %% %CopyrightEnd% %% %%---------------------------------------------------------------------- %% File : cosNotification_Grammar.erl %% Purpose : THIS FILE HAS BEEN GENERATED. DO NOT EDIT!!!! %%---------------------------------------------------------------------- -include("CosNotification_Definitions.hrl"). create_unary('+', Val) when is_number(Val) -> Val; create_unary('-', Val) when is_number(Val) -> -Val; create_unary(_, _) -> return_error(0, "syntax error"). examin_comp({T, []}) -> {T, '$empty'}; examin_comp(V) -> V.