diff --git a/DVT/Source/DVT/SopClassesManager.cs b/DVT/Source/DVT/SopClassesManager.cs index f2ad506..8c74ed5 100644 --- a/DVT/Source/DVT/SopClassesManager.cs +++ b/DVT/Source/DVT/SopClassesManager.cs @@ -1,6 +1,6 @@ -// ------------------------------------------------------ +// ------------------------------------------------------ // DVTk - The Healthcare Validation Toolkit (www.dvtk.org) -// Copyright © 2009 DVTk +// Copyright © 2009 DVTk // ------------------------------------------------------ // This file is part of DVTk. // @@ -239,7 +239,7 @@ private void AddSopClassesToDataGridFromDirectories() { string theErrorText; - theErrorText = string.Format("Definition file {0} could not be interpreted while reading directory:\n{1}\n\n", theDefinitionFileInfo.FullName, exception.Message); + theErrorText = string.Format("Definition file {0} could not be interpreted while reading directory:\n{1}\n\n", theDefinitionFileInfo.FullName, exception.ToString()); _RichTextBoxInfo.AppendText(theErrorText); } diff --git a/DVTk_Library/Libraries/Definition/definition_lex.l b/DVTk_Library/Libraries/Definition/definition_lex.l index 6c6320c..7ec36aa 100644 --- a/DVTk_Library/Libraries/Definition/definition_lex.l +++ b/DVTk_Library/Libraries/Definition/definition_lex.l @@ -226,16 +226,19 @@ VALUE { RETURN(T_VALUE);} RETURN(STRING); } -INFO\([^\n]*\) { - if (yyleng >= sizeof(yylval.string)) - { - yywarn("STRING too long!!! truncated") ; - yyleng = sizeof(yylval.string); - } - memcpy(yylval.string, yytext, yyleng); - yylval.string[yyleng] = '\0'; - RETURN(STRING); - } +INFO\([^\n]*\) { + /* copy only the inner text between INFO( and ) into STRING */ + int innerStart = 5; /* skip "INFO(" */ + int innerLen = yyleng - innerStart - 1; /* remove trailing ')' */ + if (innerLen < 0) innerLen = 0; + if (innerLen >= (int)sizeof(yylval.string)) { + yywarn("STRING too long!!! truncated"); + innerLen = (int)sizeof(yylval.string) - 1; + } + memcpy(yylval.string, yytext + innerStart, innerLen); + yylval.string[innerLen] = '\0'; + RETURN(STRING); +} 0(x|X)[0-9a-f]+ | diff --git a/DVTk_Library/Libraries/Definition/definition_parse.y b/DVTk_Library/Libraries/Definition/definition_parse.y index 9b3e44c..118d613 100644 --- a/DVTk_Library/Libraries/Definition/definition_parse.y +++ b/DVTk_Library/Libraries/Definition/definition_parse.y @@ -1,6 +1,6 @@ %{ // Part of Dvtk Libraries - Internal Native Library Code -// Copyright © 2001-2006 +// Copyright � 2001-2006 // Philips Medical Systems NL B.V., Agfa-Gevaert N.V. /* @@ -645,7 +645,31 @@ SequenceIntro : T_SQ ',' AttributeVM ',' attributes.push(currentAttribute_ptr); } } - ; + | T_SQ ',' AttributeVM + { + if (!definitionParseOnly && !skipDefinition) + { + currentAttribute_ptr->SetVR(ATTR_VR_SQ); + + currentItem_ptr = new DEF_ITEM_CLASS(); + + // create new value and value list, add item + currentValue_ptr = CreateNewValue(ATTR_VR_SQ); + currentValue_ptr->Set(currentItem_ptr); + + // add value to attribute - indexed by value list index + currentAttribute_ptr->AddValue(currentValue_ptr, currentValueListIndex); + currentAttribute_ptr->SetValueType(ATTR_VAL_TYPE_NOVALUE, currentValueListIndex); + + // the item is the new current attribute group. + // store the old one + groups.push(currentAttributeGroup_ptr); + currentAttributeGroup_ptr = currentItem_ptr; + + // store currentAttribute_ptr + attributes.push(currentAttribute_ptr); + } + }; OtherValueDef : AttributeVR ',' AttributeVM ValuesDef ; @@ -951,7 +975,7 @@ Condition : // reset textual condition lTextualCondition.erase(); } - } + } | ':' T_WEAK '(' PrimaryCond ',' SecondaryCond ')' { if (!definitionParseOnly && !skipDefinition) @@ -1699,4 +1723,4 @@ static void ResetVariables() void resetDefinitionParser() { ResetVariables(); -} \ No newline at end of file +} diff --git a/DVTk_Library/Libraries/Definition/definitionfile.cpp b/DVTk_Library/Libraries/Definition/definitionfile.cpp index d2db796..88f6fff 100644 --- a/DVTk_Library/Libraries/Definition/definitionfile.cpp +++ b/DVTk_Library/Libraries/Definition/definitionfile.cpp @@ -1,6 +1,6 @@ -// ------------------------------------------------------ +// ------------------------------------------------------ // DVTk - The Healthcare Validation Toolkit (www.dvtk.org) -// Copyright © 2009 DVTk +// Copyright © 2009 DVTk // ------------------------------------------------------ // This file is part of DVTk. // @@ -23,7 +23,8 @@ #include "definitiondetails.h" #include "definition.h" #include "Isession.h" // Session component interface - +#include +#include extern FILE* definitionin; extern string definitionfilename; @@ -524,9 +525,39 @@ bool DEFINITION_FILE_CLASS::GetDetails(DEF_DETAILS_CLASS& details) delete fileContentM_ptr; fileContentM_ptr = NULL; - char* errorText = new char[100]; + // Read the offending line from file (best-effort) and include it in the error. + std::string offendingLine; + { + std::ifstream ifs(defFile.c_str()); + if (ifs) + { + std::string tmp; + int ln = 0; + while (std::getline(ifs, tmp)) + { + ln++; + if (ln == lineNumber) + { + offendingLine = tmp; + break; + } + } + } + } + + // Build a descriptive error message that includes the line number and the line content (if available). + std::ostringstream oss; + oss << "Parse error in line " << lineNumber << "."; + if (!offendingLine.empty()) + { + // Trim trailing CR if present (def files might have CRLF) + if (!offendingLine.empty() && offendingLine.back() == '\r') offendingLine.pop_back(); + oss << " Offending line: \"" << offendingLine << "\""; + } - sprintf(errorText, "Parse error in line %i.", lineNumber); + std::string errStr = oss.str(); + char* errorText = new char[errStr.size() + 1]; + strcpy(errorText, errStr.c_str()); throw errorText; } } diff --git a/DVTk_Library/Libraries/Definition/y.output b/DVTk_Library/Libraries/Definition/y.output index c1ab5c0..a2a2867 100644 --- a/DVTk_Library/Libraries/Definition/y.output +++ b/DVTk_Library/Libraries/Definition/y.output @@ -71,101 +71,102 @@ rule 61 SequenceValueDef -> SequenceIntro ItemAttributeDefList rule 62 SequenceValueDef -> SequenceIntro rule 63 SequenceIntro -> T_SQ ',' AttributeVM ',' rule 64 SequenceIntro -> T_SQ ',' AttributeVM ',' AttributeIM ',' -rule 65 OtherValueDef -> AttributeVR ',' AttributeVM ValuesDef -rule 66 ItemAttributeDefList -> ItemAttributeDef -rule 67 ItemAttributeDefList -> ItemAttributeDefList ItemAttributeDef -rule 68 ItemAttributeDef -> T_GREATER AttributeDef -rule 69 AttributeVM -> INTEGER -rule 70 AttributeVM -> INTEGER ':' INTEGER -rule 71 AttributeVM -> INTEGER ':' 'n' -rule 72 AttributeVM -> STRING -rule 73 AttributeVM -> 'n' -rule 74 AttributeIM -> INTEGER -rule 75 AttributeIM -> INTEGER ':' INTEGER -rule 76 AttributeIM -> INTEGER ':' 'n' -rule 77 AttributeIM -> 'n' -rule 78 AttributeVR -> VR -rule 79 AttributeVR -> VR '/' VR -rule 80 ValuesDef -> /* empty */ -rule 81 ValuesDef -> ',' FirstValuesDef -rule 82 ValuesDef -> ',' FirstValuesDef ',' OtherValuesDefList -rule 83 FirstValuesDef -> ValueType ',' ValuesList -rule 84 OtherValuesDefList -> OtherValuesDef -rule 85 OtherValuesDefList -> OtherValuesDefList ',' OtherValuesDef -rule 86 OtherValuesDef -> ValueType ',' ValuesList -rule 87 OtherValuesDef -> ValuesList -rule 88 ValueType -> VALUETYPE -rule 89 ValuesList -> Value -rule 90 ValuesList -> ValuesList '|' Value -rule 91 Value -> STRING -rule 92 Value -> HEX -rule 93 Value -> INTEGER -rule 94 ItemDef -> T_ITEM ItemName AttributeDefList -rule 95 ItemName -> STRING -rule 96 MacroDef -> MacroBegin AttributeDefList -rule 97 MacroDef -> MacroBegin -rule 98 MacroBegin -> T_MACRO MacroName -rule 99 MacroBegin -> T_MACRO -rule 100 MacroName -> STRING -rule 101 MacroReference -> T_INCLUDEMACRO MacroName MacroCondition -rule 102 MacroCondition -> Condition -rule 103 Condition -> /* empty */ -rule 104 Condition -> ':' STRING -rule 105 Condition -> ':' CondExpr -rule 106 Condition -> ':' T_WEAK '(' PrimaryCond ',' SecondaryCond ')' -rule 107 PrimaryCond -> CondExpr -rule 108 SecondaryCond -> CondExpr -rule 109 CondExpr -> Expr -rule 110 CondExpr -> CondExpr T_OR Expr -rule 111 Expr -> SimpleExpr -rule 112 Expr -> Expr T_AND SimpleExpr -rule 113 SimpleExpr -> T_PRESENT AttributeTagAddress -rule 114 SimpleExpr -> T_EMPTY AttributeTagAddress -rule 115 SimpleExpr -> T_VALUE AttributeTagAddress ValueNr Operator CondValue -rule 116 SimpleExpr -> T_NOT SimpleExpr -rule 117 SimpleExpr -> '(' CondExpr ')' -rule 118 SimpleExpr -> T_WARN '(' CondExpr ')' -rule 119 SimpleExpr -> T_TRUE -rule 120 SimpleExpr -> T_FALSE -rule 121 ValueNr -> /* empty */ -rule 122 ValueNr -> INTEGER -rule 123 CondValue -> STRING -rule 124 Operator -> T_EQUAL -rule 125 Operator -> T_LESS -rule 126 Operator -> T_GREATER -rule 127 Operator -> T_LESS_OR_EQUAL -rule 128 Operator -> T_GREATER_OR_EQUAL -rule 129 AttributeTagAddress -> AttributeTag -rule 130 AttributeTagAddress -> AttributeTagPath -rule 131 AttributeTagPath -> AttributeTagHere AttributeTag -rule 132 AttributeTagPath -> AttributeTagUpPath AttributeTag -rule 133 AttributeTagPath -> AttributeTagRootPath AttributeTag -rule 134 AttributeTagPath -> AttributeTagDownPath AttributeTag -rule 135 AttributeTagPath -> AttributeTagHere AttributeTagDownPath AttributeTag -rule 136 AttributeTagPath -> AttributeTagUpPath AttributeTagDownPath AttributeTag -rule 137 AttributeTagPath -> AttributeTagRootPath AttributeTagDownPath AttributeTag -rule 138 AttributeTagHere -> '.' '/' -rule 139 AttributeTagUpPath -> AttributeTagUp -rule 140 AttributeTagUpPath -> AttributeTagUpPath AttributeTagUp -rule 141 AttributeTagUp -> '.' '.' '/' -rule 142 AttributeTagRootPath -> AttributeTagRoot -rule 143 AttributeTagRootPath -> AttributeTagRootPath AttributeTagRoot -rule 144 AttributeTagRoot -> '/' -rule 145 AttributeTagDownPath -> AttributeTagDown -rule 146 AttributeTagDownPath -> AttributeTagDownPath AttributeTagDown -rule 147 AttributeTagDown -> AttributeTag '/' +rule 65 SequenceIntro -> T_SQ ',' AttributeVM +rule 66 OtherValueDef -> AttributeVR ',' AttributeVM ValuesDef +rule 67 ItemAttributeDefList -> ItemAttributeDef +rule 68 ItemAttributeDefList -> ItemAttributeDefList ItemAttributeDef +rule 69 ItemAttributeDef -> T_GREATER AttributeDef +rule 70 AttributeVM -> INTEGER +rule 71 AttributeVM -> INTEGER ':' INTEGER +rule 72 AttributeVM -> INTEGER ':' 'n' +rule 73 AttributeVM -> STRING +rule 74 AttributeVM -> 'n' +rule 75 AttributeIM -> INTEGER +rule 76 AttributeIM -> INTEGER ':' INTEGER +rule 77 AttributeIM -> INTEGER ':' 'n' +rule 78 AttributeIM -> 'n' +rule 79 AttributeVR -> VR +rule 80 AttributeVR -> VR '/' VR +rule 81 ValuesDef -> /* empty */ +rule 82 ValuesDef -> ',' FirstValuesDef +rule 83 ValuesDef -> ',' FirstValuesDef ',' OtherValuesDefList +rule 84 FirstValuesDef -> ValueType ',' ValuesList +rule 85 OtherValuesDefList -> OtherValuesDef +rule 86 OtherValuesDefList -> OtherValuesDefList ',' OtherValuesDef +rule 87 OtherValuesDef -> ValueType ',' ValuesList +rule 88 OtherValuesDef -> ValuesList +rule 89 ValueType -> VALUETYPE +rule 90 ValuesList -> Value +rule 91 ValuesList -> ValuesList '|' Value +rule 92 Value -> STRING +rule 93 Value -> HEX +rule 94 Value -> INTEGER +rule 95 ItemDef -> T_ITEM ItemName AttributeDefList +rule 96 ItemName -> STRING +rule 97 MacroDef -> MacroBegin AttributeDefList +rule 98 MacroDef -> MacroBegin +rule 99 MacroBegin -> T_MACRO MacroName +rule 100 MacroBegin -> T_MACRO +rule 101 MacroName -> STRING +rule 102 MacroReference -> T_INCLUDEMACRO MacroName MacroCondition +rule 103 MacroCondition -> Condition +rule 104 Condition -> /* empty */ +rule 105 Condition -> ':' STRING +rule 106 Condition -> ':' CondExpr +rule 107 Condition -> ':' T_WEAK '(' PrimaryCond ',' SecondaryCond ')' +rule 108 PrimaryCond -> CondExpr +rule 109 SecondaryCond -> CondExpr +rule 110 CondExpr -> Expr +rule 111 CondExpr -> CondExpr T_OR Expr +rule 112 Expr -> SimpleExpr +rule 113 Expr -> Expr T_AND SimpleExpr +rule 114 SimpleExpr -> T_PRESENT AttributeTagAddress +rule 115 SimpleExpr -> T_EMPTY AttributeTagAddress +rule 116 SimpleExpr -> T_VALUE AttributeTagAddress ValueNr Operator CondValue +rule 117 SimpleExpr -> T_NOT SimpleExpr +rule 118 SimpleExpr -> '(' CondExpr ')' +rule 119 SimpleExpr -> T_WARN '(' CondExpr ')' +rule 120 SimpleExpr -> T_TRUE +rule 121 SimpleExpr -> T_FALSE +rule 122 ValueNr -> /* empty */ +rule 123 ValueNr -> INTEGER +rule 124 CondValue -> STRING +rule 125 Operator -> T_EQUAL +rule 126 Operator -> T_LESS +rule 127 Operator -> T_GREATER +rule 128 Operator -> T_LESS_OR_EQUAL +rule 129 Operator -> T_GREATER_OR_EQUAL +rule 130 AttributeTagAddress -> AttributeTag +rule 131 AttributeTagAddress -> AttributeTagPath +rule 132 AttributeTagPath -> AttributeTagHere AttributeTag +rule 133 AttributeTagPath -> AttributeTagUpPath AttributeTag +rule 134 AttributeTagPath -> AttributeTagRootPath AttributeTag +rule 135 AttributeTagPath -> AttributeTagDownPath AttributeTag +rule 136 AttributeTagPath -> AttributeTagHere AttributeTagDownPath AttributeTag +rule 137 AttributeTagPath -> AttributeTagUpPath AttributeTagDownPath AttributeTag +rule 138 AttributeTagPath -> AttributeTagRootPath AttributeTagDownPath AttributeTag +rule 139 AttributeTagHere -> '.' '/' +rule 140 AttributeTagUpPath -> AttributeTagUp +rule 141 AttributeTagUpPath -> AttributeTagUpPath AttributeTagUp +rule 142 AttributeTagUp -> '.' '.' '/' +rule 143 AttributeTagRootPath -> AttributeTagRoot +rule 144 AttributeTagRootPath -> AttributeTagRootPath AttributeTagRoot +rule 145 AttributeTagRoot -> '/' +rule 146 AttributeTagDownPath -> AttributeTagDown +rule 147 AttributeTagDownPath -> AttributeTagDownPath AttributeTagDown +rule 148 AttributeTagDown -> AttributeTag '/' Terminals, with rules where they appear $ (-1) -'(' (40) 51 106 117 118 -')' (41) 51 106 117 118 -',' (44) 51 63 64 65 81 82 83 85 86 106 -'.' (46) 138 141 -'/' (47) 79 138 141 144 147 -':' (58) 70 71 75 76 104 105 106 -'n' (110) 71 73 76 77 -'|' (124) 90 +'(' (40) 51 107 118 119 +')' (41) 51 107 118 119 +',' (44) 51 63 64 65 66 82 83 84 86 87 107 +'.' (46) 139 142 +'/' (47) 80 139 142 145 148 +':' (58) 71 72 76 77 105 106 107 +'n' (110) 72 74 77 78 +'|' (124) 91 error (256) 5 T_SYSTEM (258) 15 T_DEFINE (259) 7 @@ -173,34 +174,34 @@ T_ENDDEFINE (260) 8 T_METASOPCLASS (261) 22 T_SOPCLASS (262) 28 T_MODULE (263) 43 44 -T_ITEM (264) 94 -T_MACRO (265) 98 99 +T_ITEM (264) 95 +T_MACRO (265) 99 100 T_INCLUDEITEM (266) -T_INCLUDEMACRO (267) 101 -T_SQ (268) 63 64 -T_AND (269) 112 -T_OR (270) 110 -T_NOT (271) 116 -T_PRESENT (272) 113 -T_VALUE (273) 115 -T_EMPTY (274) 114 -T_TRUE (275) 119 -T_FALSE (276) 120 -T_EQUAL (277) 124 -T_LESS (278) 125 -T_GREATER (279) 68 126 -T_LESS_OR_EQUAL (280) 127 -T_GREATER_OR_EQUAL (281) 128 -T_WEAK (282) 106 -T_WARN (283) 118 -STRING (284) 17 18 20 21 24 25 29 30 35 45 57 72 91 95 100 104 123 -INTEGER (285) 55 69 70 71 74 75 76 93 122 -HEX (286) 54 92 +T_INCLUDEMACRO (267) 102 +T_SQ (268) 63 64 65 +T_AND (269) 113 +T_OR (270) 111 +T_NOT (271) 117 +T_PRESENT (272) 114 +T_VALUE (273) 116 +T_EMPTY (274) 115 +T_TRUE (275) 120 +T_FALSE (276) 121 +T_EQUAL (277) 125 +T_LESS (278) 126 +T_GREATER (279) 69 127 +T_LESS_OR_EQUAL (280) 128 +T_GREATER_OR_EQUAL (281) 129 +T_WEAK (282) 107 +T_WARN (283) 119 +STRING (284) 17 18 20 21 24 25 29 30 35 45 57 73 92 96 101 105 124 +INTEGER (285) 55 70 71 72 75 76 77 94 123 +HEX (286) 54 93 COMMANDFIELD (287) 33 TYPE (288) 56 USAGE (289) 47 -VALUETYPE (290) 88 -VR (291) 78 79 +VALUETYPE (290) 89 +VR (291) 79 80 Nonterminals, with rules where they appear @@ -277,13 +278,13 @@ ModUsage (79) ModuleCondition (80) on left: 48, on right: 46 AttributeDefList (81) - on left: 49 50, on right: 31 41 50 94 96 + on left: 49 50, on right: 31 41 50 95 97 AttributeDef (82) - on left: 51 52, on right: 49 50 68 + on left: 51 52, on right: 49 50 69 AttributeTagDef (83) on left: 53, on right: 51 AttributeTag (84) - on left: 54, on right: 53 129 131 132 133 134 135 136 137 147 + on left: 54, on right: 53 130 132 133 134 135 136 137 138 148 AttributeType (85) on left: 55 56, on right: 51 AttributeName (86) @@ -295,83 +296,83 @@ AttributeValueDef (88) SequenceValueDef (89) on left: 61 62, on right: 59 SequenceIntro (90) - on left: 63 64, on right: 61 62 + on left: 63 64 65, on right: 61 62 OtherValueDef (91) - on left: 65, on right: 60 + on left: 66, on right: 60 ItemAttributeDefList (92) - on left: 66 67, on right: 61 67 + on left: 67 68, on right: 61 68 ItemAttributeDef (93) - on left: 68, on right: 66 67 + on left: 69, on right: 67 68 AttributeVM (94) - on left: 69 70 71 72 73, on right: 63 64 65 + on left: 70 71 72 73 74, on right: 63 64 65 66 AttributeIM (95) - on left: 74 75 76 77, on right: 64 + on left: 75 76 77 78, on right: 64 AttributeVR (96) - on left: 78 79, on right: 65 + on left: 79 80, on right: 66 ValuesDef (97) - on left: 80 81 82, on right: 65 + on left: 81 82 83, on right: 66 FirstValuesDef (98) - on left: 83, on right: 81 82 + on left: 84, on right: 82 83 OtherValuesDefList (99) - on left: 84 85, on right: 82 85 + on left: 85 86, on right: 83 86 OtherValuesDef (100) - on left: 86 87, on right: 84 85 + on left: 87 88, on right: 85 86 ValueType (101) - on left: 88, on right: 83 86 + on left: 89, on right: 84 87 ValuesList (102) - on left: 89 90, on right: 83 86 87 90 + on left: 90 91, on right: 84 87 88 91 Value (103) - on left: 91 92 93, on right: 89 90 + on left: 92 93 94, on right: 90 91 ItemDef (104) - on left: 94, on right: 13 + on left: 95, on right: 13 ItemName (105) - on left: 95, on right: 94 + on left: 96, on right: 95 MacroDef (106) - on left: 96 97, on right: 14 + on left: 97 98, on right: 14 MacroBegin (107) - on left: 98 99, on right: 96 97 + on left: 99 100, on right: 97 98 MacroName (108) - on left: 100, on right: 98 101 + on left: 101, on right: 99 102 MacroReference (109) - on left: 101, on right: 52 + on left: 102, on right: 52 MacroCondition (110) - on left: 102, on right: 101 + on left: 103, on right: 102 Condition (111) - on left: 103 104 105 106, on right: 48 58 102 + on left: 104 105 106 107, on right: 48 58 103 PrimaryCond (112) - on left: 107, on right: 106 + on left: 108, on right: 107 SecondaryCond (113) - on left: 108, on right: 106 + on left: 109, on right: 107 CondExpr (114) - on left: 109 110, on right: 105 107 108 110 117 118 + on left: 110 111, on right: 106 108 109 111 118 119 Expr (115) - on left: 111 112, on right: 109 110 112 + on left: 112 113, on right: 110 111 113 SimpleExpr (116) - on left: 113 114 115 116 117 118 119 120, on right: 111 112 116 + on left: 114 115 116 117 118 119 120 121, on right: 112 113 117 ValueNr (117) - on left: 121 122, on right: 115 + on left: 122 123, on right: 116 CondValue (118) - on left: 123, on right: 115 + on left: 124, on right: 116 Operator (119) - on left: 124 125 126 127 128, on right: 115 + on left: 125 126 127 128 129, on right: 116 AttributeTagAddress (120) - on left: 129 130, on right: 113 114 115 + on left: 130 131, on right: 114 115 116 AttributeTagPath (121) - on left: 131 132 133 134 135 136 137, on right: 130 + on left: 132 133 134 135 136 137 138, on right: 131 AttributeTagHere (122) - on left: 138, on right: 131 135 + on left: 139, on right: 132 136 AttributeTagUpPath (123) - on left: 139 140, on right: 132 136 140 + on left: 140 141, on right: 133 137 141 AttributeTagUp (124) - on left: 141, on right: 139 140 + on left: 142, on right: 140 141 AttributeTagRootPath (125) - on left: 142 143, on right: 133 137 143 + on left: 143 144, on right: 134 138 144 AttributeTagRoot (126) - on left: 144, on right: 142 143 + on left: 145, on right: 143 144 AttributeTagDownPath (127) - on left: 145 146, on right: 134 135 136 137 146 + on left: 146 147, on right: 135 136 137 138 147 AttributeTagDown (128) - on left: 147, on right: 145 146 + on left: 148, on right: 146 147 state 0 @@ -490,7 +491,7 @@ state 9 state 10 - ItemDef -> T_ITEM . ItemName AttributeDefList (rule 94) + ItemDef -> T_ITEM . ItemName AttributeDefList (rule 95) STRING shift, and go to state 29 @@ -500,12 +501,12 @@ state 10 state 11 - MacroBegin -> T_MACRO . MacroName (rule 98) - MacroBegin -> T_MACRO . (rule 99) + MacroBegin -> T_MACRO . MacroName (rule 99) + MacroBegin -> T_MACRO . (rule 100) STRING shift, and go to state 31 - $default reduce using rule 99 (MacroBegin) + $default reduce using rule 100 (MacroBegin) MacroName go to state 32 @@ -603,13 +604,13 @@ state 21 state 22 - MacroDef -> MacroBegin . AttributeDefList (rule 96) - MacroDef -> MacroBegin . (rule 97) + MacroDef -> MacroBegin . AttributeDefList (rule 97) + MacroDef -> MacroBegin . (rule 98) T_INCLUDEMACRO shift, and go to state 35 '(' shift, and go to state 37 - $default reduce using rule 97 (MacroDef) + $default reduce using rule 98 (MacroDef) AttributeDefList go to state 42 AttributeDef go to state 40 @@ -677,15 +678,15 @@ state 28 state 29 - ItemName -> STRING . (rule 95) + ItemName -> STRING . (rule 96) - $default reduce using rule 95 (ItemName) + $default reduce using rule 96 (ItemName) state 30 - ItemDef -> T_ITEM ItemName . AttributeDefList (rule 94) + ItemDef -> T_ITEM ItemName . AttributeDefList (rule 95) T_INCLUDEMACRO shift, and go to state 35 '(' shift, and go to state 37 @@ -698,17 +699,17 @@ state 30 state 31 - MacroName -> STRING . (rule 100) + MacroName -> STRING . (rule 101) - $default reduce using rule 100 (MacroName) + $default reduce using rule 101 (MacroName) state 32 - MacroBegin -> T_MACRO MacroName . (rule 98) + MacroBegin -> T_MACRO MacroName . (rule 99) - $default reduce using rule 98 (MacroBegin) + $default reduce using rule 99 (MacroBegin) @@ -730,7 +731,7 @@ state 34 state 35 - MacroReference -> T_INCLUDEMACRO . MacroName MacroCondition (rule 101) + MacroReference -> T_INCLUDEMACRO . MacroName MacroCondition (rule 102) STRING shift, and go to state 31 @@ -803,12 +804,12 @@ state 41 state 42 AttributeDefList -> AttributeDefList . AttributeDef (rule 50) - MacroDef -> MacroBegin AttributeDefList . (rule 96) + MacroDef -> MacroBegin AttributeDefList . (rule 97) T_INCLUDEMACRO shift, and go to state 35 '(' shift, and go to state 37 - $default reduce using rule 96 (MacroDef) + $default reduce using rule 97 (MacroDef) AttributeDef go to state 61 MacroReference go to state 41 @@ -907,12 +908,12 @@ state 52 state 53 AttributeDefList -> AttributeDefList . AttributeDef (rule 50) - ItemDef -> T_ITEM ItemName AttributeDefList . (rule 94) + ItemDef -> T_ITEM ItemName AttributeDefList . (rule 95) T_INCLUDEMACRO shift, and go to state 35 '(' shift, and go to state 37 - $default reduce using rule 94 (ItemDef) + $default reduce using rule 95 (ItemDef) AttributeDef go to state 61 MacroReference go to state 41 @@ -921,11 +922,11 @@ state 53 state 54 - MacroReference -> T_INCLUDEMACRO MacroName . MacroCondition (rule 101) + MacroReference -> T_INCLUDEMACRO MacroName . MacroCondition (rule 102) ':' shift, and go to state 67 - $default reduce using rule 103 (Condition) + $default reduce using rule 104 (Condition) MacroCondition go to state 68 Condition go to state 69 @@ -1039,9 +1040,9 @@ state 66 state 67 - Condition -> ':' . STRING (rule 104) - Condition -> ':' . CondExpr (rule 105) - Condition -> ':' . T_WEAK '(' PrimaryCond ',' SecondaryCond ')' (rule 106) + Condition -> ':' . STRING (rule 105) + Condition -> ':' . CondExpr (rule 106) + Condition -> ':' . T_WEAK '(' PrimaryCond ',' SecondaryCond ')' (rule 107) T_NOT shift, and go to state 77 T_PRESENT shift, and go to state 78 @@ -1062,17 +1063,17 @@ state 67 state 68 - MacroReference -> T_INCLUDEMACRO MacroName MacroCondition . (rule 101) + MacroReference -> T_INCLUDEMACRO MacroName MacroCondition . (rule 102) - $default reduce using rule 101 (MacroReference) + $default reduce using rule 102 (MacroReference) state 69 - MacroCondition -> Condition . (rule 102) + MacroCondition -> Condition . (rule 103) - $default reduce using rule 102 (MacroCondition) + $default reduce using rule 103 (MacroCondition) @@ -1156,7 +1157,7 @@ state 76 state 77 - SimpleExpr -> T_NOT . SimpleExpr (rule 116) + SimpleExpr -> T_NOT . SimpleExpr (rule 117) T_NOT shift, and go to state 77 T_PRESENT shift, and go to state 78 @@ -1173,7 +1174,7 @@ state 77 state 78 - SimpleExpr -> T_PRESENT . AttributeTagAddress (rule 113) + SimpleExpr -> T_PRESENT . AttributeTagAddress (rule 114) HEX shift, and go to state 55 '/' shift, and go to state 98 @@ -1194,7 +1195,7 @@ state 78 state 79 - SimpleExpr -> T_VALUE . AttributeTagAddress ValueNr Operator CondValue (rule 115) + SimpleExpr -> T_VALUE . AttributeTagAddress ValueNr Operator CondValue (rule 116) HEX shift, and go to state 55 '/' shift, and go to state 98 @@ -1215,7 +1216,7 @@ state 79 state 80 - SimpleExpr -> T_EMPTY . AttributeTagAddress (rule 114) + SimpleExpr -> T_EMPTY . AttributeTagAddress (rule 115) HEX shift, and go to state 55 '/' shift, and go to state 98 @@ -1236,23 +1237,23 @@ state 80 state 81 - SimpleExpr -> T_TRUE . (rule 119) + SimpleExpr -> T_TRUE . (rule 120) - $default reduce using rule 119 (SimpleExpr) + $default reduce using rule 120 (SimpleExpr) state 82 - SimpleExpr -> T_FALSE . (rule 120) + SimpleExpr -> T_FALSE . (rule 121) - $default reduce using rule 120 (SimpleExpr) + $default reduce using rule 121 (SimpleExpr) state 83 - Condition -> ':' T_WEAK . '(' PrimaryCond ',' SecondaryCond ')' (rule 106) + Condition -> ':' T_WEAK . '(' PrimaryCond ',' SecondaryCond ')' (rule 107) '(' shift, and go to state 112 @@ -1260,7 +1261,7 @@ state 83 state 84 - SimpleExpr -> T_WARN . '(' CondExpr ')' (rule 118) + SimpleExpr -> T_WARN . '(' CondExpr ')' (rule 119) '(' shift, and go to state 113 @@ -1268,15 +1269,15 @@ state 84 state 85 - Condition -> ':' STRING . (rule 104) + Condition -> ':' STRING . (rule 105) - $default reduce using rule 104 (Condition) + $default reduce using rule 105 (Condition) state 86 - SimpleExpr -> '(' . CondExpr ')' (rule 117) + SimpleExpr -> '(' . CondExpr ')' (rule 118) T_NOT shift, and go to state 77 T_PRESENT shift, and go to state 78 @@ -1295,31 +1296,31 @@ state 86 state 87 - Condition -> ':' CondExpr . (rule 105) - CondExpr -> CondExpr . T_OR Expr (rule 110) + Condition -> ':' CondExpr . (rule 106) + CondExpr -> CondExpr . T_OR Expr (rule 111) T_OR shift, and go to state 115 - $default reduce using rule 105 (Condition) + $default reduce using rule 106 (Condition) state 88 - CondExpr -> Expr . (rule 109) - Expr -> Expr . T_AND SimpleExpr (rule 112) + CondExpr -> Expr . (rule 110) + Expr -> Expr . T_AND SimpleExpr (rule 113) T_AND shift, and go to state 116 - $default reduce using rule 109 (CondExpr) + $default reduce using rule 110 (CondExpr) state 89 - Expr -> SimpleExpr . (rule 111) + Expr -> SimpleExpr . (rule 112) - $default reduce using rule 111 (Expr) + $default reduce using rule 112 (Expr) @@ -1391,24 +1392,24 @@ state 96 state 97 - SimpleExpr -> T_NOT SimpleExpr . (rule 116) + SimpleExpr -> T_NOT SimpleExpr . (rule 117) - $default reduce using rule 116 (SimpleExpr) + $default reduce using rule 117 (SimpleExpr) state 98 - AttributeTagRoot -> '/' . (rule 144) + AttributeTagRoot -> '/' . (rule 145) - $default reduce using rule 144 (AttributeTagRoot) + $default reduce using rule 145 (AttributeTagRoot) state 99 - AttributeTagHere -> '.' . '/' (rule 138) - AttributeTagUp -> '.' . '.' '/' (rule 141) + AttributeTagHere -> '.' . '/' (rule 139) + AttributeTagUp -> '.' . '.' '/' (rule 142) '/' shift, and go to state 121 '.' shift, and go to state 122 @@ -1417,35 +1418,35 @@ state 99 state 100 - AttributeTagAddress -> AttributeTag . (rule 129) - AttributeTagDown -> AttributeTag . '/' (rule 147) + AttributeTagAddress -> AttributeTag . (rule 130) + AttributeTagDown -> AttributeTag . '/' (rule 148) '/' shift, and go to state 123 - $default reduce using rule 129 (AttributeTagAddress) + $default reduce using rule 130 (AttributeTagAddress) state 101 - SimpleExpr -> T_PRESENT AttributeTagAddress . (rule 113) + SimpleExpr -> T_PRESENT AttributeTagAddress . (rule 114) - $default reduce using rule 113 (SimpleExpr) + $default reduce using rule 114 (SimpleExpr) state 102 - AttributeTagAddress -> AttributeTagPath . (rule 130) + AttributeTagAddress -> AttributeTagPath . (rule 131) - $default reduce using rule 130 (AttributeTagAddress) + $default reduce using rule 131 (AttributeTagAddress) state 103 - AttributeTagPath -> AttributeTagHere . AttributeTag (rule 131) - AttributeTagPath -> AttributeTagHere . AttributeTagDownPath AttributeTag (rule 135) + AttributeTagPath -> AttributeTagHere . AttributeTag (rule 132) + AttributeTagPath -> AttributeTagHere . AttributeTagDownPath AttributeTag (rule 136) HEX shift, and go to state 55 @@ -1457,9 +1458,9 @@ state 103 state 104 - AttributeTagPath -> AttributeTagUpPath . AttributeTag (rule 132) - AttributeTagPath -> AttributeTagUpPath . AttributeTagDownPath AttributeTag (rule 136) - AttributeTagUpPath -> AttributeTagUpPath . AttributeTagUp (rule 140) + AttributeTagPath -> AttributeTagUpPath . AttributeTag (rule 133) + AttributeTagPath -> AttributeTagUpPath . AttributeTagDownPath AttributeTag (rule 137) + AttributeTagUpPath -> AttributeTagUpPath . AttributeTagUp (rule 141) HEX shift, and go to state 55 '.' shift, and go to state 126 @@ -1473,17 +1474,17 @@ state 104 state 105 - AttributeTagUpPath -> AttributeTagUp . (rule 139) + AttributeTagUpPath -> AttributeTagUp . (rule 140) - $default reduce using rule 139 (AttributeTagUpPath) + $default reduce using rule 140 (AttributeTagUpPath) state 106 - AttributeTagPath -> AttributeTagRootPath . AttributeTag (rule 133) - AttributeTagPath -> AttributeTagRootPath . AttributeTagDownPath AttributeTag (rule 137) - AttributeTagRootPath -> AttributeTagRootPath . AttributeTagRoot (rule 143) + AttributeTagPath -> AttributeTagRootPath . AttributeTag (rule 134) + AttributeTagPath -> AttributeTagRootPath . AttributeTagDownPath AttributeTag (rule 138) + AttributeTagRootPath -> AttributeTagRootPath . AttributeTagRoot (rule 144) HEX shift, and go to state 55 '/' shift, and go to state 98 @@ -1497,16 +1498,16 @@ state 106 state 107 - AttributeTagRootPath -> AttributeTagRoot . (rule 142) + AttributeTagRootPath -> AttributeTagRoot . (rule 143) - $default reduce using rule 142 (AttributeTagRootPath) + $default reduce using rule 143 (AttributeTagRootPath) state 108 - AttributeTagPath -> AttributeTagDownPath . AttributeTag (rule 134) - AttributeTagDownPath -> AttributeTagDownPath . AttributeTagDown (rule 146) + AttributeTagPath -> AttributeTagDownPath . AttributeTag (rule 135) + AttributeTagDownPath -> AttributeTagDownPath . AttributeTagDown (rule 147) HEX shift, and go to state 55 @@ -1517,19 +1518,19 @@ state 108 state 109 - AttributeTagDownPath -> AttributeTagDown . (rule 145) + AttributeTagDownPath -> AttributeTagDown . (rule 146) - $default reduce using rule 145 (AttributeTagDownPath) + $default reduce using rule 146 (AttributeTagDownPath) state 110 - SimpleExpr -> T_VALUE AttributeTagAddress . ValueNr Operator CondValue (rule 115) + SimpleExpr -> T_VALUE AttributeTagAddress . ValueNr Operator CondValue (rule 116) INTEGER shift, and go to state 135 - $default reduce using rule 121 (ValueNr) + $default reduce using rule 122 (ValueNr) ValueNr go to state 136 @@ -1537,15 +1538,15 @@ state 110 state 111 - SimpleExpr -> T_EMPTY AttributeTagAddress . (rule 114) + SimpleExpr -> T_EMPTY AttributeTagAddress . (rule 115) - $default reduce using rule 114 (SimpleExpr) + $default reduce using rule 115 (SimpleExpr) state 112 - Condition -> ':' T_WEAK '(' . PrimaryCond ',' SecondaryCond ')' (rule 106) + Condition -> ':' T_WEAK '(' . PrimaryCond ',' SecondaryCond ')' (rule 107) T_NOT shift, and go to state 77 T_PRESENT shift, and go to state 78 @@ -1565,7 +1566,7 @@ state 112 state 113 - SimpleExpr -> T_WARN '(' . CondExpr ')' (rule 118) + SimpleExpr -> T_WARN '(' . CondExpr ')' (rule 119) T_NOT shift, and go to state 77 T_PRESENT shift, and go to state 78 @@ -1584,8 +1585,8 @@ state 113 state 114 - CondExpr -> CondExpr . T_OR Expr (rule 110) - SimpleExpr -> '(' CondExpr . ')' (rule 117) + CondExpr -> CondExpr . T_OR Expr (rule 111) + SimpleExpr -> '(' CondExpr . ')' (rule 118) T_OR shift, and go to state 115 ')' shift, and go to state 140 @@ -1594,7 +1595,7 @@ state 114 state 115 - CondExpr -> CondExpr T_OR . Expr (rule 110) + CondExpr -> CondExpr T_OR . Expr (rule 111) T_NOT shift, and go to state 77 T_PRESENT shift, and go to state 78 @@ -1612,7 +1613,7 @@ state 115 state 116 - Expr -> Expr T_AND . SimpleExpr (rule 112) + Expr -> Expr T_AND . SimpleExpr (rule 113) T_NOT shift, and go to state 77 T_PRESENT shift, and go to state 78 @@ -1664,7 +1665,7 @@ state 120 ':' shift, and go to state 67 - $default reduce using rule 103 (Condition) + $default reduce using rule 104 (Condition) ModuleCondition go to state 150 Condition go to state 151 @@ -1673,15 +1674,15 @@ state 120 state 121 - AttributeTagHere -> '.' '/' . (rule 138) + AttributeTagHere -> '.' '/' . (rule 139) - $default reduce using rule 138 (AttributeTagHere) + $default reduce using rule 139 (AttributeTagHere) state 122 - AttributeTagUp -> '.' '.' . '/' (rule 141) + AttributeTagUp -> '.' '.' . '/' (rule 142) '/' shift, and go to state 152 @@ -1689,27 +1690,27 @@ state 122 state 123 - AttributeTagDown -> AttributeTag '/' . (rule 147) + AttributeTagDown -> AttributeTag '/' . (rule 148) - $default reduce using rule 147 (AttributeTagDown) + $default reduce using rule 148 (AttributeTagDown) state 124 - AttributeTagPath -> AttributeTagHere AttributeTag . (rule 131) - AttributeTagDown -> AttributeTag . '/' (rule 147) + AttributeTagPath -> AttributeTagHere AttributeTag . (rule 132) + AttributeTagDown -> AttributeTag . '/' (rule 148) '/' shift, and go to state 123 - $default reduce using rule 131 (AttributeTagPath) + $default reduce using rule 132 (AttributeTagPath) state 125 - AttributeTagPath -> AttributeTagHere AttributeTagDownPath . AttributeTag (rule 135) - AttributeTagDownPath -> AttributeTagDownPath . AttributeTagDown (rule 146) + AttributeTagPath -> AttributeTagHere AttributeTagDownPath . AttributeTag (rule 136) + AttributeTagDownPath -> AttributeTagDownPath . AttributeTagDown (rule 147) HEX shift, and go to state 55 @@ -1720,7 +1721,7 @@ state 125 state 126 - AttributeTagUp -> '.' . '.' '/' (rule 141) + AttributeTagUp -> '.' . '.' '/' (rule 142) '.' shift, and go to state 122 @@ -1728,27 +1729,27 @@ state 126 state 127 - AttributeTagPath -> AttributeTagUpPath AttributeTag . (rule 132) - AttributeTagDown -> AttributeTag . '/' (rule 147) + AttributeTagPath -> AttributeTagUpPath AttributeTag . (rule 133) + AttributeTagDown -> AttributeTag . '/' (rule 148) '/' shift, and go to state 123 - $default reduce using rule 132 (AttributeTagPath) + $default reduce using rule 133 (AttributeTagPath) state 128 - AttributeTagUpPath -> AttributeTagUpPath AttributeTagUp . (rule 140) + AttributeTagUpPath -> AttributeTagUpPath AttributeTagUp . (rule 141) - $default reduce using rule 140 (AttributeTagUpPath) + $default reduce using rule 141 (AttributeTagUpPath) state 129 - AttributeTagPath -> AttributeTagUpPath AttributeTagDownPath . AttributeTag (rule 136) - AttributeTagDownPath -> AttributeTagDownPath . AttributeTagDown (rule 146) + AttributeTagPath -> AttributeTagUpPath AttributeTagDownPath . AttributeTag (rule 137) + AttributeTagDownPath -> AttributeTagDownPath . AttributeTagDown (rule 147) HEX shift, and go to state 55 @@ -1759,27 +1760,27 @@ state 129 state 130 - AttributeTagPath -> AttributeTagRootPath AttributeTag . (rule 133) - AttributeTagDown -> AttributeTag . '/' (rule 147) + AttributeTagPath -> AttributeTagRootPath AttributeTag . (rule 134) + AttributeTagDown -> AttributeTag . '/' (rule 148) '/' shift, and go to state 123 - $default reduce using rule 133 (AttributeTagPath) + $default reduce using rule 134 (AttributeTagPath) state 131 - AttributeTagRootPath -> AttributeTagRootPath AttributeTagRoot . (rule 143) + AttributeTagRootPath -> AttributeTagRootPath AttributeTagRoot . (rule 144) - $default reduce using rule 143 (AttributeTagRootPath) + $default reduce using rule 144 (AttributeTagRootPath) state 132 - AttributeTagPath -> AttributeTagRootPath AttributeTagDownPath . AttributeTag (rule 137) - AttributeTagDownPath -> AttributeTagDownPath . AttributeTagDown (rule 146) + AttributeTagPath -> AttributeTagRootPath AttributeTagDownPath . AttributeTag (rule 138) + AttributeTagDownPath -> AttributeTagDownPath . AttributeTagDown (rule 147) HEX shift, and go to state 55 @@ -1790,34 +1791,34 @@ state 132 state 133 - AttributeTagPath -> AttributeTagDownPath AttributeTag . (rule 134) - AttributeTagDown -> AttributeTag . '/' (rule 147) + AttributeTagPath -> AttributeTagDownPath AttributeTag . (rule 135) + AttributeTagDown -> AttributeTag . '/' (rule 148) '/' shift, and go to state 123 - $default reduce using rule 134 (AttributeTagPath) + $default reduce using rule 135 (AttributeTagPath) state 134 - AttributeTagDownPath -> AttributeTagDownPath AttributeTagDown . (rule 146) + AttributeTagDownPath -> AttributeTagDownPath AttributeTagDown . (rule 147) - $default reduce using rule 146 (AttributeTagDownPath) + $default reduce using rule 147 (AttributeTagDownPath) state 135 - ValueNr -> INTEGER . (rule 122) + ValueNr -> INTEGER . (rule 123) - $default reduce using rule 122 (ValueNr) + $default reduce using rule 123 (ValueNr) state 136 - SimpleExpr -> T_VALUE AttributeTagAddress ValueNr . Operator CondValue (rule 115) + SimpleExpr -> T_VALUE AttributeTagAddress ValueNr . Operator CondValue (rule 116) T_EQUAL shift, and go to state 156 T_LESS shift, and go to state 157 @@ -1831,7 +1832,7 @@ state 136 state 137 - Condition -> ':' T_WEAK '(' PrimaryCond . ',' SecondaryCond ')' (rule 106) + Condition -> ':' T_WEAK '(' PrimaryCond . ',' SecondaryCond ')' (rule 107) ',' shift, and go to state 162 @@ -1839,19 +1840,19 @@ state 137 state 138 - PrimaryCond -> CondExpr . (rule 107) - CondExpr -> CondExpr . T_OR Expr (rule 110) + PrimaryCond -> CondExpr . (rule 108) + CondExpr -> CondExpr . T_OR Expr (rule 111) T_OR shift, and go to state 115 - $default reduce using rule 107 (PrimaryCond) + $default reduce using rule 108 (PrimaryCond) state 139 - CondExpr -> CondExpr . T_OR Expr (rule 110) - SimpleExpr -> T_WARN '(' CondExpr . ')' (rule 118) + CondExpr -> CondExpr . T_OR Expr (rule 111) + SimpleExpr -> T_WARN '(' CondExpr . ')' (rule 119) T_OR shift, and go to state 115 ')' shift, and go to state 163 @@ -1860,28 +1861,28 @@ state 139 state 140 - SimpleExpr -> '(' CondExpr ')' . (rule 117) + SimpleExpr -> '(' CondExpr ')' . (rule 118) - $default reduce using rule 117 (SimpleExpr) + $default reduce using rule 118 (SimpleExpr) state 141 - CondExpr -> CondExpr T_OR Expr . (rule 110) - Expr -> Expr . T_AND SimpleExpr (rule 112) + CondExpr -> CondExpr T_OR Expr . (rule 111) + Expr -> Expr . T_AND SimpleExpr (rule 113) T_AND shift, and go to state 116 - $default reduce using rule 110 (CondExpr) + $default reduce using rule 111 (CondExpr) state 142 - Expr -> Expr T_AND SimpleExpr . (rule 112) + Expr -> Expr T_AND SimpleExpr . (rule 113) - $default reduce using rule 112 (Expr) + $default reduce using rule 113 (Expr) @@ -1889,6 +1890,7 @@ state 143 SequenceIntro -> T_SQ . ',' AttributeVM ',' (rule 63) SequenceIntro -> T_SQ . ',' AttributeVM ',' AttributeIM ',' (rule 64) + SequenceIntro -> T_SQ . ',' AttributeVM (rule 65) ',' shift, and go to state 164 @@ -1896,12 +1898,12 @@ state 143 state 144 - AttributeVR -> VR . (rule 78) - AttributeVR -> VR . '/' VR (rule 79) + AttributeVR -> VR . (rule 79) + AttributeVR -> VR . '/' VR (rule 80) '/' shift, and go to state 165 - $default reduce using rule 78 (AttributeVR) + $default reduce using rule 79 (AttributeVR) @@ -1945,7 +1947,7 @@ state 148 state 149 - OtherValueDef -> AttributeVR . ',' AttributeVM ValuesDef (rule 65) + OtherValueDef -> AttributeVR . ',' AttributeVM ValuesDef (rule 66) ',' shift, and go to state 170 @@ -1969,88 +1971,88 @@ state 151 state 152 - AttributeTagUp -> '.' '.' '/' . (rule 141) + AttributeTagUp -> '.' '.' '/' . (rule 142) - $default reduce using rule 141 (AttributeTagUp) + $default reduce using rule 142 (AttributeTagUp) state 153 - AttributeTagPath -> AttributeTagHere AttributeTagDownPath AttributeTag . (rule 135) - AttributeTagDown -> AttributeTag . '/' (rule 147) + AttributeTagPath -> AttributeTagHere AttributeTagDownPath AttributeTag . (rule 136) + AttributeTagDown -> AttributeTag . '/' (rule 148) '/' shift, and go to state 123 - $default reduce using rule 135 (AttributeTagPath) + $default reduce using rule 136 (AttributeTagPath) state 154 - AttributeTagPath -> AttributeTagUpPath AttributeTagDownPath AttributeTag . (rule 136) - AttributeTagDown -> AttributeTag . '/' (rule 147) + AttributeTagPath -> AttributeTagUpPath AttributeTagDownPath AttributeTag . (rule 137) + AttributeTagDown -> AttributeTag . '/' (rule 148) '/' shift, and go to state 123 - $default reduce using rule 136 (AttributeTagPath) + $default reduce using rule 137 (AttributeTagPath) state 155 - AttributeTagPath -> AttributeTagRootPath AttributeTagDownPath AttributeTag . (rule 137) - AttributeTagDown -> AttributeTag . '/' (rule 147) + AttributeTagPath -> AttributeTagRootPath AttributeTagDownPath AttributeTag . (rule 138) + AttributeTagDown -> AttributeTag . '/' (rule 148) '/' shift, and go to state 123 - $default reduce using rule 137 (AttributeTagPath) + $default reduce using rule 138 (AttributeTagPath) state 156 - Operator -> T_EQUAL . (rule 124) + Operator -> T_EQUAL . (rule 125) - $default reduce using rule 124 (Operator) + $default reduce using rule 125 (Operator) state 157 - Operator -> T_LESS . (rule 125) + Operator -> T_LESS . (rule 126) - $default reduce using rule 125 (Operator) + $default reduce using rule 126 (Operator) state 158 - Operator -> T_GREATER . (rule 126) + Operator -> T_GREATER . (rule 127) - $default reduce using rule 126 (Operator) + $default reduce using rule 127 (Operator) state 159 - Operator -> T_LESS_OR_EQUAL . (rule 127) + Operator -> T_LESS_OR_EQUAL . (rule 128) - $default reduce using rule 127 (Operator) + $default reduce using rule 128 (Operator) state 160 - Operator -> T_GREATER_OR_EQUAL . (rule 128) + Operator -> T_GREATER_OR_EQUAL . (rule 129) - $default reduce using rule 128 (Operator) + $default reduce using rule 129 (Operator) state 161 - SimpleExpr -> T_VALUE AttributeTagAddress ValueNr Operator . CondValue (rule 115) + SimpleExpr -> T_VALUE AttributeTagAddress ValueNr Operator . CondValue (rule 116) STRING shift, and go to state 171 @@ -2060,7 +2062,7 @@ state 161 state 162 - Condition -> ':' T_WEAK '(' PrimaryCond ',' . SecondaryCond ')' (rule 106) + Condition -> ':' T_WEAK '(' PrimaryCond ',' . SecondaryCond ')' (rule 107) T_NOT shift, and go to state 77 T_PRESENT shift, and go to state 78 @@ -2080,9 +2082,9 @@ state 162 state 163 - SimpleExpr -> T_WARN '(' CondExpr ')' . (rule 118) + SimpleExpr -> T_WARN '(' CondExpr ')' . (rule 119) - $default reduce using rule 118 (SimpleExpr) + $default reduce using rule 119 (SimpleExpr) @@ -2090,6 +2092,7 @@ state 164 SequenceIntro -> T_SQ ',' . AttributeVM ',' (rule 63) SequenceIntro -> T_SQ ',' . AttributeVM ',' AttributeIM ',' (rule 64) + SequenceIntro -> T_SQ ',' . AttributeVM (rule 65) STRING shift, and go to state 175 INTEGER shift, and go to state 176 @@ -2101,7 +2104,7 @@ state 164 state 165 - AttributeVR -> VR '/' . VR (rule 79) + AttributeVR -> VR '/' . VR (rule 80) VR shift, and go to state 179 @@ -2119,7 +2122,7 @@ state 166 state 167 - ItemAttributeDef -> T_GREATER . AttributeDef (rule 68) + ItemAttributeDef -> T_GREATER . AttributeDef (rule 69) T_INCLUDEMACRO shift, and go to state 35 '(' shift, and go to state 37 @@ -2132,7 +2135,7 @@ state 167 state 168 SequenceValueDef -> SequenceIntro ItemAttributeDefList . (rule 61) - ItemAttributeDefList -> ItemAttributeDefList . ItemAttributeDef (rule 67) + ItemAttributeDefList -> ItemAttributeDefList . ItemAttributeDef (rule 68) T_GREATER shift, and go to state 167 @@ -2144,15 +2147,15 @@ state 168 state 169 - ItemAttributeDefList -> ItemAttributeDef . (rule 66) + ItemAttributeDefList -> ItemAttributeDef . (rule 67) - $default reduce using rule 66 (ItemAttributeDefList) + $default reduce using rule 67 (ItemAttributeDefList) state 170 - OtherValueDef -> AttributeVR ',' . AttributeVM ValuesDef (rule 65) + OtherValueDef -> AttributeVR ',' . AttributeVM ValuesDef (rule 66) STRING shift, and go to state 175 INTEGER shift, and go to state 176 @@ -2164,23 +2167,23 @@ state 170 state 171 - CondValue -> STRING . (rule 123) + CondValue -> STRING . (rule 124) - $default reduce using rule 123 (CondValue) + $default reduce using rule 124 (CondValue) state 172 - SimpleExpr -> T_VALUE AttributeTagAddress ValueNr Operator CondValue . (rule 115) + SimpleExpr -> T_VALUE AttributeTagAddress ValueNr Operator CondValue . (rule 116) - $default reduce using rule 115 (SimpleExpr) + $default reduce using rule 116 (SimpleExpr) state 173 - Condition -> ':' T_WEAK '(' PrimaryCond ',' SecondaryCond . ')' (rule 106) + Condition -> ':' T_WEAK '(' PrimaryCond ',' SecondaryCond . ')' (rule 107) ')' shift, and go to state 185 @@ -2188,40 +2191,40 @@ state 173 state 174 - SecondaryCond -> CondExpr . (rule 108) - CondExpr -> CondExpr . T_OR Expr (rule 110) + SecondaryCond -> CondExpr . (rule 109) + CondExpr -> CondExpr . T_OR Expr (rule 111) T_OR shift, and go to state 115 - $default reduce using rule 108 (SecondaryCond) + $default reduce using rule 109 (SecondaryCond) state 175 - AttributeVM -> STRING . (rule 72) + AttributeVM -> STRING . (rule 73) - $default reduce using rule 72 (AttributeVM) + $default reduce using rule 73 (AttributeVM) state 176 - AttributeVM -> INTEGER . (rule 69) - AttributeVM -> INTEGER . ':' INTEGER (rule 70) - AttributeVM -> INTEGER . ':' 'n' (rule 71) + AttributeVM -> INTEGER . (rule 70) + AttributeVM -> INTEGER . ':' INTEGER (rule 71) + AttributeVM -> INTEGER . ':' 'n' (rule 72) ':' shift, and go to state 186 - $default reduce using rule 69 (AttributeVM) + $default reduce using rule 70 (AttributeVM) state 177 - AttributeVM -> 'n' . (rule 73) + AttributeVM -> 'n' . (rule 74) - $default reduce using rule 73 (AttributeVM) + $default reduce using rule 74 (AttributeVM) @@ -2229,16 +2232,19 @@ state 178 SequenceIntro -> T_SQ ',' AttributeVM . ',' (rule 63) SequenceIntro -> T_SQ ',' AttributeVM . ',' AttributeIM ',' (rule 64) + SequenceIntro -> T_SQ ',' AttributeVM . (rule 65) ',' shift, and go to state 187 + $default reduce using rule 65 (SequenceIntro) + state 179 - AttributeVR -> VR '/' VR . (rule 79) + AttributeVR -> VR '/' VR . (rule 80) - $default reduce using rule 79 (AttributeVR) + $default reduce using rule 80 (AttributeVR) @@ -2256,7 +2262,7 @@ state 181 ':' shift, and go to state 67 - $default reduce using rule 103 (Condition) + $default reduce using rule 104 (Condition) AttributeCondition go to state 188 Condition go to state 189 @@ -2265,27 +2271,27 @@ state 181 state 182 - ItemAttributeDef -> T_GREATER AttributeDef . (rule 68) + ItemAttributeDef -> T_GREATER AttributeDef . (rule 69) - $default reduce using rule 68 (ItemAttributeDef) + $default reduce using rule 69 (ItemAttributeDef) state 183 - ItemAttributeDefList -> ItemAttributeDefList ItemAttributeDef . (rule 67) + ItemAttributeDefList -> ItemAttributeDefList ItemAttributeDef . (rule 68) - $default reduce using rule 67 (ItemAttributeDefList) + $default reduce using rule 68 (ItemAttributeDefList) state 184 - OtherValueDef -> AttributeVR ',' AttributeVM . ValuesDef (rule 65) + OtherValueDef -> AttributeVR ',' AttributeVM . ValuesDef (rule 66) ',' shift, and go to state 190 - $default reduce using rule 80 (ValuesDef) + $default reduce using rule 81 (ValuesDef) ValuesDef go to state 191 @@ -2293,16 +2299,16 @@ state 184 state 185 - Condition -> ':' T_WEAK '(' PrimaryCond ',' SecondaryCond ')' . (rule 106) + Condition -> ':' T_WEAK '(' PrimaryCond ',' SecondaryCond ')' . (rule 107) - $default reduce using rule 106 (Condition) + $default reduce using rule 107 (Condition) state 186 - AttributeVM -> INTEGER ':' . INTEGER (rule 70) - AttributeVM -> INTEGER ':' . 'n' (rule 71) + AttributeVM -> INTEGER ':' . INTEGER (rule 71) + AttributeVM -> INTEGER ':' . 'n' (rule 72) INTEGER shift, and go to state 192 'n' shift, and go to state 193 @@ -2341,8 +2347,8 @@ state 189 state 190 - ValuesDef -> ',' . FirstValuesDef (rule 81) - ValuesDef -> ',' . FirstValuesDef ',' OtherValuesDefList (rule 82) + ValuesDef -> ',' . FirstValuesDef (rule 82) + ValuesDef -> ',' . FirstValuesDef ',' OtherValuesDefList (rule 83) VALUETYPE shift, and go to state 197 @@ -2353,45 +2359,45 @@ state 190 state 191 - OtherValueDef -> AttributeVR ',' AttributeVM ValuesDef . (rule 65) + OtherValueDef -> AttributeVR ',' AttributeVM ValuesDef . (rule 66) - $default reduce using rule 65 (OtherValueDef) + $default reduce using rule 66 (OtherValueDef) state 192 - AttributeVM -> INTEGER ':' INTEGER . (rule 70) + AttributeVM -> INTEGER ':' INTEGER . (rule 71) - $default reduce using rule 70 (AttributeVM) + $default reduce using rule 71 (AttributeVM) state 193 - AttributeVM -> INTEGER ':' 'n' . (rule 71) + AttributeVM -> INTEGER ':' 'n' . (rule 72) - $default reduce using rule 71 (AttributeVM) + $default reduce using rule 72 (AttributeVM) state 194 - AttributeIM -> INTEGER . (rule 74) - AttributeIM -> INTEGER . ':' INTEGER (rule 75) - AttributeIM -> INTEGER . ':' 'n' (rule 76) + AttributeIM -> INTEGER . (rule 75) + AttributeIM -> INTEGER . ':' INTEGER (rule 76) + AttributeIM -> INTEGER . ':' 'n' (rule 77) ':' shift, and go to state 200 - $default reduce using rule 74 (AttributeIM) + $default reduce using rule 75 (AttributeIM) state 195 - AttributeIM -> 'n' . (rule 77) + AttributeIM -> 'n' . (rule 78) - $default reduce using rule 77 (AttributeIM) + $default reduce using rule 78 (AttributeIM) @@ -2405,26 +2411,26 @@ state 196 state 197 - ValueType -> VALUETYPE . (rule 88) + ValueType -> VALUETYPE . (rule 89) - $default reduce using rule 88 (ValueType) + $default reduce using rule 89 (ValueType) state 198 - ValuesDef -> ',' FirstValuesDef . (rule 81) - ValuesDef -> ',' FirstValuesDef . ',' OtherValuesDefList (rule 82) + ValuesDef -> ',' FirstValuesDef . (rule 82) + ValuesDef -> ',' FirstValuesDef . ',' OtherValuesDefList (rule 83) ',' shift, and go to state 202 - $default reduce using rule 81 (ValuesDef) + $default reduce using rule 82 (ValuesDef) state 199 - FirstValuesDef -> ValueType . ',' ValuesList (rule 83) + FirstValuesDef -> ValueType . ',' ValuesList (rule 84) ',' shift, and go to state 203 @@ -2432,8 +2438,8 @@ state 199 state 200 - AttributeIM -> INTEGER ':' . INTEGER (rule 75) - AttributeIM -> INTEGER ':' . 'n' (rule 76) + AttributeIM -> INTEGER ':' . INTEGER (rule 76) + AttributeIM -> INTEGER ':' . 'n' (rule 77) INTEGER shift, and go to state 204 'n' shift, and go to state 205 @@ -2450,7 +2456,7 @@ state 201 state 202 - ValuesDef -> ',' FirstValuesDef ',' . OtherValuesDefList (rule 82) + ValuesDef -> ',' FirstValuesDef ',' . OtherValuesDefList (rule 83) STRING shift, and go to state 206 INTEGER shift, and go to state 207 @@ -2467,7 +2473,7 @@ state 202 state 203 - FirstValuesDef -> ValueType ',' . ValuesList (rule 83) + FirstValuesDef -> ValueType ',' . ValuesList (rule 84) STRING shift, and go to state 206 INTEGER shift, and go to state 207 @@ -2480,66 +2486,66 @@ state 203 state 204 - AttributeIM -> INTEGER ':' INTEGER . (rule 75) + AttributeIM -> INTEGER ':' INTEGER . (rule 76) - $default reduce using rule 75 (AttributeIM) + $default reduce using rule 76 (AttributeIM) state 205 - AttributeIM -> INTEGER ':' 'n' . (rule 76) + AttributeIM -> INTEGER ':' 'n' . (rule 77) - $default reduce using rule 76 (AttributeIM) + $default reduce using rule 77 (AttributeIM) state 206 - Value -> STRING . (rule 91) + Value -> STRING . (rule 92) - $default reduce using rule 91 (Value) + $default reduce using rule 92 (Value) state 207 - Value -> INTEGER . (rule 93) + Value -> INTEGER . (rule 94) - $default reduce using rule 93 (Value) + $default reduce using rule 94 (Value) state 208 - Value -> HEX . (rule 92) + Value -> HEX . (rule 93) - $default reduce using rule 92 (Value) + $default reduce using rule 93 (Value) state 209 - ValuesDef -> ',' FirstValuesDef ',' OtherValuesDefList . (rule 82) - OtherValuesDefList -> OtherValuesDefList . ',' OtherValuesDef (rule 85) + ValuesDef -> ',' FirstValuesDef ',' OtherValuesDefList . (rule 83) + OtherValuesDefList -> OtherValuesDefList . ',' OtherValuesDef (rule 86) ',' shift, and go to state 215 - $default reduce using rule 82 (ValuesDef) + $default reduce using rule 83 (ValuesDef) state 210 - OtherValuesDefList -> OtherValuesDef . (rule 84) + OtherValuesDefList -> OtherValuesDef . (rule 85) - $default reduce using rule 84 (OtherValuesDefList) + $default reduce using rule 85 (OtherValuesDefList) state 211 - OtherValuesDef -> ValueType . ',' ValuesList (rule 86) + OtherValuesDef -> ValueType . ',' ValuesList (rule 87) ',' shift, and go to state 216 @@ -2547,37 +2553,37 @@ state 211 state 212 - OtherValuesDef -> ValuesList . (rule 87) - ValuesList -> ValuesList . '|' Value (rule 90) + OtherValuesDef -> ValuesList . (rule 88) + ValuesList -> ValuesList . '|' Value (rule 91) '|' shift, and go to state 217 - $default reduce using rule 87 (OtherValuesDef) + $default reduce using rule 88 (OtherValuesDef) state 213 - ValuesList -> Value . (rule 89) + ValuesList -> Value . (rule 90) - $default reduce using rule 89 (ValuesList) + $default reduce using rule 90 (ValuesList) state 214 - FirstValuesDef -> ValueType ',' ValuesList . (rule 83) - ValuesList -> ValuesList . '|' Value (rule 90) + FirstValuesDef -> ValueType ',' ValuesList . (rule 84) + ValuesList -> ValuesList . '|' Value (rule 91) '|' shift, and go to state 217 - $default reduce using rule 83 (FirstValuesDef) + $default reduce using rule 84 (FirstValuesDef) state 215 - OtherValuesDefList -> OtherValuesDefList ',' . OtherValuesDef (rule 85) + OtherValuesDefList -> OtherValuesDefList ',' . OtherValuesDef (rule 86) STRING shift, and go to state 206 INTEGER shift, and go to state 207 @@ -2593,7 +2599,7 @@ state 215 state 216 - OtherValuesDef -> ValueType ',' . ValuesList (rule 86) + OtherValuesDef -> ValueType ',' . ValuesList (rule 87) STRING shift, and go to state 206 INTEGER shift, and go to state 207 @@ -2606,7 +2612,7 @@ state 216 state 217 - ValuesList -> ValuesList '|' . Value (rule 90) + ValuesList -> ValuesList '|' . Value (rule 91) STRING shift, and go to state 206 INTEGER shift, and go to state 207 @@ -2618,28 +2624,28 @@ state 217 state 218 - OtherValuesDefList -> OtherValuesDefList ',' OtherValuesDef . (rule 85) + OtherValuesDefList -> OtherValuesDefList ',' OtherValuesDef . (rule 86) - $default reduce using rule 85 (OtherValuesDefList) + $default reduce using rule 86 (OtherValuesDefList) state 219 - OtherValuesDef -> ValueType ',' ValuesList . (rule 86) - ValuesList -> ValuesList . '|' Value (rule 90) + OtherValuesDef -> ValueType ',' ValuesList . (rule 87) + ValuesList -> ValuesList . '|' Value (rule 91) '|' shift, and go to state 217 - $default reduce using rule 86 (OtherValuesDef) + $default reduce using rule 87 (OtherValuesDef) state 220 - ValuesList -> ValuesList '|' Value . (rule 90) + ValuesList -> ValuesList '|' Value . (rule 91) - $default reduce using rule 90 (ValuesList) + $default reduce using rule 91 (ValuesList) diff --git a/DVTk_Library/Source/Libraries/AttributeGroup/ext_char_set_parser.cpp b/DVTk_Library/Source/Libraries/AttributeGroup/ext_char_set_parser.cpp deleted file mode 100644 index af3862b..0000000 --- a/DVTk_Library/Source/Libraries/AttributeGroup/ext_char_set_parser.cpp +++ /dev/null @@ -1,973 +0,0 @@ - -/* A Bison parser, made from ext_char_set_parser.y with Bison version GNU Bison version 1.24 - */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define T_DEFINE 258 -#define T_ENDDEFINE 259 -#define T_SYSTEM 260 -#define T_CHARACTER_SET 261 -#define T_CODE_ELEMENT 262 -#define T_CODE_EXTENSIONS 263 -#define T_NO_CODE_EXTENSIONS 264 -#define T_ESC 265 -#define STRING 266 - -#line 1 "ext_char_set_parser.y" - -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright © 2001-2005 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -//***************************************************************************** -// DESCRIPTION : Extended Character Set File Parser. -//***************************************************************************** - -#include - -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "ext_char_set_definition.h" - - -// flex / bison error and warning functions -extern void extcharseterror(char* msg); -extern void extcharsetwarn(char* msg); -extern int extcharsetlex(void); - -// local variables - unfortunately this structure is needed for YACC/LEX -// they are used as temporary variables -static CHARACTER_SET_CLASS* current_character_set_ptr = NULL; -static CODE_ELEMENT_CLASS* current_code_element_ptr = NULL; - -#line 29 "ext_char_set_parser.y" -typedef union { - NAME_STRING string; -} YYSTYPE; - -#ifndef YYLTYPE -typedef - struct yyltype - { - int timestamp; - int first_line; - int first_column; - int last_line; - int last_column; - char *text; - } - yyltype; - -#define YYLTYPE yyltype -#endif - -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 56 -#define YYFLAG -32768 -#define YYNTBASE 15 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 266 ? yytranslate[x] : 37) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, - 14, 2, 2, 13, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 7, 11, 13, 15, 17, 19, 23, - 26, 29, 33, 36, 39, 41, 43, 46, 66, 68, - 70, 72, 74, 76, 78, 80 -}; - -static const short yyrhs[] = { 16, - 0, 17, 0, 16, 17, 0, 18, 20, 19, 0, - 3, 0, 4, 0, 21, 0, 24, 0, 5, 22, - 23, 0, 11, 11, 0, 11, 11, 0, 6, 25, - 26, 0, 11, 9, 0, 11, 8, 0, 27, 0, - 28, 0, 27, 28, 0, 7, 12, 29, 13, 30, - 13, 31, 13, 10, 32, 13, 33, 13, 34, 13, - 35, 13, 36, 14, 0, 11, 0, 11, 0, 11, - 0, 11, 0, 11, 0, 11, 0, 11, 0, 11, - 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 45, 48, 49, 52, 55, 58, 61, 62, 65, 68, - 73, 78, 85, 89, 95, 98, 106, 117, 142, 145, - 148, 151, 154, 157, 160, 163 -}; - -static const char * const yytname[] = { "$","error","$undefined.","T_DEFINE", -"T_ENDDEFINE","T_SYSTEM","T_CHARACTER_SET","T_CODE_ELEMENT","T_CODE_EXTENSIONS", -"T_NO_CODE_EXTENSIONS","T_ESC","STRING","'('","','","')'","DefinitionGrammar", -"DefinitionComponents","Definition","BeginDefine","EndDefine","DefinitionChoice", -"SystemDef","SystemDefinition","AEDefinition","CharacterSet","CSDescription", -"CSDefinition","CodeElementList","CodeElement","CEBytes","CEDefinedTerm","CEStandardForCodeExt", -"CEEscSequence","CEISORegNr","CENrChars","CECodeElement","CECharSet","" -}; -#endif - -static const short extcharsetr1[] = { 0, - 15, 16, 16, 17, 18, 19, 20, 20, 21, 22, - 23, 24, 25, 25, 26, 27, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36 -}; - -static const short extcharsetr2[] = { 0, - 1, 1, 2, 3, 1, 1, 1, 1, 3, 2, - 2, 3, 2, 2, 1, 1, 2, 19, 1, 1, - 1, 1, 1, 1, 1, 1 -}; - -static const short extcharsetdefact[] = { 0, - 5, 1, 2, 0, 3, 0, 0, 0, 7, 8, - 0, 0, 0, 0, 6, 4, 10, 0, 9, 14, - 13, 0, 12, 15, 16, 11, 0, 17, 19, 0, - 0, 20, 0, 0, 21, 0, 0, 0, 22, 0, - 0, 23, 0, 0, 24, 0, 0, 25, 0, 0, - 26, 0, 18, 0, 0, 0 -}; - -static const short extcharsetdefgoto[] = { 54, - 2, 3, 4, 16, 8, 9, 12, 19, 10, 14, - 23, 24, 25, 30, 33, 36, 40, 43, 46, 49, - 52 -}; - -static const short extcharsetpact[] = { 1, --32768, 1,-32768, -5,-32768, -4, -3, 2,-32768,-32768, - -2, -1, -6, 4,-32768,-32768,-32768, 3,-32768,-32768, --32768, -7,-32768, 4,-32768,-32768, 5,-32768,-32768, 0, - 6,-32768, 7, 8,-32768, 9, 11, 12,-32768, 13, - 14,-32768, 15, 16,-32768, 17, 18,-32768, 19, 20, --32768, 10,-32768, 33, 34,-32768 -}; - -static const short extcharsetpgoto[] = {-32768, --32768, 35,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, -12,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768 -}; - - -#define YYLAST 37 - - -static const short yytable[] = { 6, - 7, 20, 21, 1, 27, 15, 11, 13, 17, 18, - 22, 28, 31, 26, 0, 29, 32, 0, 35, 34, - 38, 37, 39, 53, 42, 41, 45, 44, 48, 47, - 51, 50, 55, 56, 0, 0, 5 -}; - -static const short yycheck[] = { 5, - 6, 8, 9, 3, 12, 4, 11, 11, 11, 11, - 7, 24, 13, 11, -1, 11, 11, -1, 11, 13, - 10, 13, 11, 14, 11, 13, 11, 13, 11, 13, - 11, 13, 0, 0, -1, -1, 2 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "bison.simple" - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -#ifndef alloca -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) -#include -#else /* not sparc */ -#if defined (MSDOS) && !defined (__TURBOC__) -#include -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -#include - #pragma alloca -#else /* not MSDOS, __TURBOC__, or _AIX */ -#ifdef __hpux -#ifdef __cplusplus -extern "C" { -void *alloca (unsigned int); -}; -#else /* not __cplusplus */ -void *alloca (); -#endif /* not __cplusplus */ -#endif /* __hpux */ -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc. */ -#endif /* not GNU C. */ -#endif /* alloca not defined. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define extcharseterrok (yyerrstatus = 0) -#define extcharsetclearin (extcharsetchar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto extcharseterrlab1 -/* Like YYERROR except do call extcharseterror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto extcharseterrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (extcharsetchar == YYEMPTY && yylen == 1) \ - { extcharsetchar = (token), extcharsetlval = (value); \ - extcharsetchar1 = YYTRANSLATE (extcharsetchar); \ - YYPOPSTACK; \ - goto extcharsetbackup; \ - } \ - else \ - { extcharseterror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX extcharsetlex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX extcharsetlex(&extcharsetlval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX extcharsetlex(&extcharsetlval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX extcharsetlex(&extcharsetlval, YYLEX_PARAM) -#else -#define YYLEX extcharsetlex(&extcharsetlval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int extcharsetchar; /* the lookahead symbol */ -YYSTYPE extcharsetlval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int extcharsetnerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int extcharsetdebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -int extcharsetparse (void); -#endif - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (from, to, count) - char *from; - char *to; - int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *from, char *to, int count) -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 192 "bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into extcharsetparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#else -#define YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#endif - -int -extcharsetparse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL -{ - register int extcharsetstate; - register int yyn; - register short *extcharsetssp; - register YYSTYPE *extcharsetvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int extcharsetchar1 = 0; /* lookahead token as an internal (translated) token number */ - - short extcharsetssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE extcharsetvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *extcharsetss = extcharsetssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *extcharsetvs = extcharsetvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *extcharsetlsp; - -#define YYPOPSTACK (extcharsetvsp--, extcharsetssp--, extcharsetlsp--) -#else -#define YYPOPSTACK (extcharsetvsp--, extcharsetssp--) -#endif - - int extcharsetstacksize = YYINITDEPTH; - -#ifdef YYPURE - int extcharsetchar; - YYSTYPE extcharsetlval; - int extcharsetnerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE extcharsetval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (extcharsetdebug) - fprintf(stderr, "Starting parse\n"); -#endif - - extcharsetstate = 0; - yyerrstatus = 0; - extcharsetnerrs = 0; - extcharsetchar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - extcharsetssp = extcharsetss - 1; - extcharsetvsp = extcharsetvs; -#ifdef YYLSP_NEEDED - extcharsetlsp = yyls; -#endif - -/* Push a new state, which is found in extcharsetstate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++extcharsetssp = extcharsetstate; - - if (extcharsetssp >= extcharsetss + extcharsetstacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *extcharsetvs1 = extcharsetvs; - short *extcharsetss1 = extcharsetss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = extcharsetssp - extcharsetss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &extcharsetss1, size * sizeof (*extcharsetssp), - &extcharsetvs1, size * sizeof (*extcharsetvsp), - &yyls1, size * sizeof (*extcharsetlsp), - &extcharsetstacksize); -#else - yyoverflow("parser stack overflow", - &extcharsetss1, size * sizeof (*extcharsetssp), - &extcharsetvs1, size * sizeof (*extcharsetvsp), - &extcharsetstacksize); -#endif - - extcharsetss = extcharsetss1; extcharsetvs = extcharsetvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (extcharsetstacksize >= YYMAXDEPTH) - { - extcharseterror("parser stack overflow"); - return 2; - } - extcharsetstacksize *= 2; - if (extcharsetstacksize > YYMAXDEPTH) - extcharsetstacksize = YYMAXDEPTH; - extcharsetss = (short *) alloca (extcharsetstacksize * sizeof (*extcharsetssp)); - __yy_memcpy ((char *)extcharsetss1, (char *)extcharsetss, size * sizeof (*extcharsetssp)); - extcharsetvs = (YYSTYPE *) alloca (extcharsetstacksize * sizeof (*extcharsetvsp)); - __yy_memcpy ((char *)extcharsetvs1, (char *)extcharsetvs, size * sizeof (*extcharsetvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (extcharsetstacksize * sizeof (*extcharsetlsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*extcharsetlsp)); -#endif -#endif /* no yyoverflow */ - - extcharsetssp = extcharsetss + size - 1; - extcharsetvsp = extcharsetvs + size - 1; -#ifdef YYLSP_NEEDED - extcharsetlsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (extcharsetdebug) - fprintf(stderr, "Stack size increased to %d\n", extcharsetstacksize); -#endif - - if (extcharsetssp >= extcharsetss + extcharsetstacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (extcharsetdebug) - fprintf(stderr, "Entering state %d\n", extcharsetstate); -#endif - - goto extcharsetbackup; - extcharsetbackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = extcharsetpact[extcharsetstate]; - if (yyn == YYFLAG) - goto extcharsetdefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* extcharsetchar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (extcharsetchar == YYEMPTY) - { -#if YYDEBUG != 0 - if (extcharsetdebug) - fprintf(stderr, "Reading a token: "); -#endif - extcharsetchar = YYLEX; - } - - /* Convert token to internal form (in extcharsetchar1) for indexing tables with */ - - if (extcharsetchar <= 0) /* This means end of input. */ - { - extcharsetchar1 = 0; - extcharsetchar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (extcharsetdebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - extcharsetchar1 = YYTRANSLATE(extcharsetchar); - -#if YYDEBUG != 0 - if (extcharsetdebug) - { - fprintf (stderr, "Next token is %d (%s", extcharsetchar, yytname[extcharsetchar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, extcharsetchar, extcharsetlval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += extcharsetchar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != extcharsetchar1) - goto extcharsetdefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto extcharseterrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto extcharseterrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (extcharsetdebug) - fprintf(stderr, "Shifting token %d (%s), ", extcharsetchar, yytname[extcharsetchar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (extcharsetchar != YYEOF) - extcharsetchar = YYEMPTY; - - *++extcharsetvsp = extcharsetlval; -#ifdef YYLSP_NEEDED - *++extcharsetlsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - extcharsetstate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -extcharsetdefault: - - yyn = extcharsetdefact[extcharsetstate]; - if (yyn == 0) - goto extcharseterrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = extcharsetr2[yyn]; - if (yylen > 0) - extcharsetval = extcharsetvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (extcharsetdebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[extcharsetr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 10: -#line 69 "ext_char_set_parser.y" -{ - ; - break;} -case 11: -#line 74 "ext_char_set_parser.y" -{ - ; - break;} -case 12: -#line 79 "ext_char_set_parser.y" -{ - EXTCHARACTERSET->AddCharacterSet(current_character_set_ptr); - current_character_set_ptr = NULL; - ; - break;} -case 13: -#line 86 "ext_char_set_parser.y" -{ - current_character_set_ptr = new CHARACTER_SET_CLASS(extcharsetvsp[-1].string, false); - ; - break;} -case 14: -#line 90 "ext_char_set_parser.y" -{ - current_character_set_ptr = new CHARACTER_SET_CLASS(extcharsetvsp[-1].string, true); - ; - break;} -case 16: -#line 99 "ext_char_set_parser.y" -{ - if (current_character_set_ptr) - { - current_character_set_ptr->AddCodeElement(current_code_element_ptr); - } - current_code_element_ptr = NULL; - ; - break;} -case 17: -#line 107 "ext_char_set_parser.y" -{ - if (current_character_set_ptr) - { - current_character_set_ptr->AddCodeElement(current_code_element_ptr); - } - current_code_element_ptr = NULL; - ; - break;} -case 18: -#line 118 "ext_char_set_parser.y" -{ - // create new code element - current_code_element_ptr = new CODE_ELEMENT_CLASS(extcharsetvsp[-14].string); - - // and set parameters - if (strcmp(extcharsetvsp[-16].string, "MULTI") == 0) - { - current_code_element_ptr->SetMultiByte(true); - } - else - { - current_code_element_ptr->SetMultiByte(false); - } - - current_code_element_ptr->SetDefinedTerm(extcharsetvsp[-14].string); - current_code_element_ptr->SetStdForCodeExt(extcharsetvsp[-12].string); - current_code_element_ptr->SetEscSequenceCRFormat(extcharsetvsp[-9].string); - current_code_element_ptr->SetISORegNr(extcharsetvsp[-7].string); - current_code_element_ptr->SetNrChars(extcharsetvsp[-5].string); - current_code_element_ptr->SetCodeElementName(extcharsetvsp[-3].string); - current_code_element_ptr->SetCharacterSet(extcharsetvsp[-1].string); - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "bison.simple" - - extcharsetvsp -= yylen; - extcharsetssp -= yylen; -#ifdef YYLSP_NEEDED - extcharsetlsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (extcharsetdebug) - { - short *ssp1 = extcharsetss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != extcharsetssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++extcharsetvsp = extcharsetval; - -#ifdef YYLSP_NEEDED - extcharsetlsp++; - if (yylen == 0) - { - extcharsetlsp->first_line = yylloc.first_line; - extcharsetlsp->first_column = yylloc.first_column; - extcharsetlsp->last_line = (extcharsetlsp-1)->last_line; - extcharsetlsp->last_column = (extcharsetlsp-1)->last_column; - extcharsetlsp->text = 0; - } - else - { - extcharsetlsp->last_line = (extcharsetlsp+yylen-1)->last_line; - extcharsetlsp->last_column = (extcharsetlsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = extcharsetr1[yyn]; - - extcharsetstate = extcharsetpgoto[yyn - YYNTBASE] + *extcharsetssp; - if (extcharsetstate >= 0 && extcharsetstate <= YYLAST && yycheck[extcharsetstate] == *extcharsetssp) - extcharsetstate = yytable[extcharsetstate]; - else - extcharsetstate = extcharsetdefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -extcharseterrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++extcharsetnerrs; - -#ifdef YYERROR_VERBOSE - yyn = extcharsetpact[extcharsetstate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - extcharseterror(msg); - free(msg); - } - else - extcharseterror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - extcharseterror("parse error"); - } - - goto extcharseterrlab1; -extcharseterrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (extcharsetchar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (extcharsetdebug) - fprintf(stderr, "Discarding token %d (%s).\n", extcharsetchar, yytname[extcharsetchar1]); -#endif - - extcharsetchar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = extcharsetdefact[extcharsetstate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto extcharsetdefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (extcharsetssp == extcharsetss) YYABORT; - extcharsetvsp--; - extcharsetstate = *--extcharsetssp; -#ifdef YYLSP_NEEDED - extcharsetlsp--; -#endif - -#if YYDEBUG != 0 - if (extcharsetdebug) - { - short *ssp1 = extcharsetss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != extcharsetssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = extcharsetpact[extcharsetstate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (extcharsetdebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++extcharsetvsp = extcharsetlval; -#ifdef YYLSP_NEEDED - *++extcharsetlsp = yylloc; -#endif - - extcharsetstate = yyn; - goto yynewstate; -} -#line 165 "ext_char_set_parser.y" - diff --git a/DVTk_Library/Source/Libraries/AttributeGroup/ext_char_set_parser.cpp.h b/DVTk_Library/Source/Libraries/AttributeGroup/ext_char_set_parser.cpp.h deleted file mode 100644 index c13b1a8..0000000 --- a/DVTk_Library/Source/Libraries/AttributeGroup/ext_char_set_parser.cpp.h +++ /dev/null @@ -1,15 +0,0 @@ -typedef union { - NAME_STRING string; -} YYSTYPE; -#define T_DEFINE 258 -#define T_ENDDEFINE 259 -#define T_SYSTEM 260 -#define T_CHARACTER_SET 261 -#define T_CODE_ELEMENT 262 -#define T_CODE_EXTENSIONS 263 -#define T_NO_CODE_EXTENSIONS 264 -#define T_ESC 265 -#define STRING 266 - - -extern YYSTYPE extcharsetlval; diff --git a/DVTk_Library/Source/Libraries/Definition/definition_parse.cpp b/DVTk_Library/Source/Libraries/Definition/definition_parse.cpp deleted file mode 100644 index e8887b9..0000000 --- a/DVTk_Library/Source/Libraries/Definition/definition_parse.cpp +++ /dev/null @@ -1,2584 +0,0 @@ - -/* A Bison parser, made from definition_parse.y with Bison version GNU Bison version 1.24 - */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define T_SYSTEM 258 -#define T_DEFINE 259 -#define T_ENDDEFINE 260 -#define T_METASOPCLASS 261 -#define T_SOPCLASS 262 -#define T_MODULE 263 -#define T_ITEM 264 -#define T_MACRO 265 -#define T_INCLUDEITEM 266 -#define T_INCLUDEMACRO 267 -#define T_SQ 268 -#define T_AND 269 -#define T_OR 270 -#define T_NOT 271 -#define T_PRESENT 272 -#define T_VALUE 273 -#define T_EMPTY 274 -#define T_TRUE 275 -#define T_FALSE 276 -#define T_EQUAL 277 -#define T_LESS 278 -#define T_GREATER 279 -#define T_LESS_OR_EQUAL 280 -#define T_GREATER_OR_EQUAL 281 -#define T_WEAK 282 -#define T_WARN 283 -#define STRING 284 -#define INTEGER 285 -#define HEX 286 -#define COMMANDFIELD 287 -#define TYPE 288 -#define USAGE 289 -#define VALUETYPE 290 -#define VR 291 - -#line 1 "definition_parse.y" - -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright © 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -/* - * A parser for the definition files - */ - -#include - -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "IAttributeGroup.h" // Attribute Group component interface -#include "Icondition.h" // Condition component interface -#include "AEDefinition.h" -#include "AttributeDefinition.h" -#include "AttributeGroupDefinition.h" -#include "CommandDefinition.h" -#include "DatasetDefinition.h" -#include "DICOMObjectDefinition.h" -#include "ItemDefinition.h" -#include "MacroDefinition.h" -#include "MetaSopClassDefinition.h" -#include "ModuleDefinition.h" -#include "SopClassDefinition.h" -#include "SystemDefinition.h" -#include "deffilecontent.h" - -// flex/bison error and warning functions -extern void definitionerror(char*); -extern void definitionwarn(char*); -extern void definitionerror(char*, bool); -extern void definitionwarn(char*, bool); -extern int definitionlex(void); -extern LOG_CLASS* definitionfilelogger_ptr; -extern DEF_FILE_CONTENT_CLASS* defFileContent_ptr; - -void resetDefinitionParser(); - -string definitionfilename; -bool definitionnewfile = false; -bool definitionfileempty = false; - -static BASE_VALUE_CLASS* CreateValueFromString(NAME_STRING, ATTR_VR_ENUM); -static BASE_VALUE_CLASS* CreateValueFromInt(int, ATTR_VR_ENUM); -static BASE_VALUE_CLASS* CreateValueFromHex(unsigned long, ATTR_VR_ENUM); -static void CreateVMFromString(NAME_STRING, DEF_ATTRIBUTE_CLASS*); -static void ResetVariables(); -static void ResolveMacroReferences(); - - -// local variables - unfortunately this structure is needed for YACC/LEX -// they are used as temporary variables -static DEF_METASOPCLASS_CLASS* currentMetaSopClass_ptr = NULL; -static DEF_SOPCLASS_CLASS* currentSopClass_ptr = NULL; -static DEF_DICOM_OBJECT_CLASS* currentDICOMObject_ptr = NULL; -static DEF_COMMAND_CLASS* currentCommand_ptr = NULL; -static DEF_DATASET_CLASS* currentDataset_ptr = NULL; -static DEF_ATTRIBUTE_GROUP_CLASS* currentAttributeGroup_ptr = NULL; -static DEF_MODULE_CLASS* currentModule_ptr = NULL; -static DEF_ITEM_CLASS* currentItem_ptr = NULL; -static DEF_MACRO_CLASS* currentMacro_ptr = NULL; -static DEF_ATTRIBUTE_CLASS* currentAttribute_ptr = NULL; -static int currentValueListIndex = 0; -static BASE_VALUE_CLASS* currentValue_ptr = NULL; -static CONDITION_CLASS* currentCondition_ptr = NULL; -static CONDITION_NODE_CLASS* condition_node_ptr = NULL; -static CONDITION_NODE_CLASS* node_left_ptr = NULL; -static CONDITION_NODE_CLASS* node_right_ptr = NULL; -static CONDITION_NODE_CLASS* node_ptr = NULL; -static string lTextualCondition; -static NAME_STRING lsystemname; -static NAME_STRING lsystemversion; -static NAME_STRING lAEname; -static NAME_STRING lAEversion; -static NAME_STRING lMetaSOPClassUID; -static NAME_STRING lMetaSOPClassName; -static NAME_STRING lSOPClassUID; -static NAME_STRING lSOPClassName; -static NAME_STRING lIodName; -static NAME_STRING lModuleName; -static MOD_USAGE_ENUM lModuleUsage; -static UINT16 lAttrGroup; -static UINT16 lAttrElement; -static ATTR_VR_ENUM lAttrVr; -static DIMSE_CMD_ENUM lDimseCmd; -static ATTR_VAL_TYPE_ENUM currentValueType; -static ATTR_VAL_TYPE_ENUM lFirstValueType; - - -// switch which in case errors occur prevents -// that attributes and the like are added to non-existing -// objects. Parsing can continue. -bool definitionParseOnly = false; -bool skipDefinition = false; - -// keep track of nesting levels -static stack groups; -static stack attributes; - -// remember which groups have macro references -static vector groups_with_refs; -static vector macros; - -#line 108 "definition_parse.y" -typedef union { - bool boolean; - DIMSE_CMD_ENUM commandField; - unsigned long hex; - int integer; - NAME_STRING string; - ATTR_TYPE_ENUM type; - MOD_USAGE_ENUM usage; - ATTR_VAL_TYPE_ENUM valueType; - ATTR_VR_ENUM vr; - CONDITION_NODE_CLASS* node_ptr; - CONDITION_UNARY_NODE_CLASS* unary_node_ptr; - CONDITION_BINARY_NODE_CLASS* binary_node_ptr; -} YYSTYPE; - -#ifndef YYLTYPE -typedef - struct yyltype - { - int timestamp; - int first_line; - int first_column; - int last_line; - int last_column; - char *text; - } - yyltype; - -#define YYLTYPE yyltype -#endif - -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 209 -#define YYFLAG -32768 -#define YYNTBASE 45 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 291 ? yytranslate[x] : 126) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 37, - 39, 2, 2, 38, 2, 44, 42, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 40, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 41, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 43, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 7, 9, 11, 15, 17, 19, 21, - 23, 25, 27, 29, 31, 35, 38, 40, 42, 45, - 47, 49, 53, 56, 58, 60, 62, 65, 69, 71, - 73, 76, 78, 80, 84, 86, 89, 91, 93, 95, - 98, 101, 103, 107, 109, 111, 114, 116, 118, 120, - 123, 133, 135, 137, 139, 141, 143, 145, 147, 149, - 151, 154, 156, 161, 166, 168, 171, 174, 176, 180, - 184, 186, 188, 190, 194, 195, 198, 203, 207, 209, - 213, 217, 219, 221, 223, 227, 229, 231, 233, 237, - 239, 242, 244, 247, 249, 251, 255, 257, 258, 261, - 264, 272, 274, 276, 278, 282, 284, 288, 291, 294, - 300, 303, 307, 312, 314, 316, 317, 319, 321, 323, - 325, 327, 329, 331, 333, 335, 338, 341, 344, 348, - 352, 355, 357, 360, 364, 366, 369 -}; - -static const short yyrhs[] = { 46, - 0, 47, 0, 46, 47, 0, 48, 0, 1, 0, - 49, 51, 50, 0, 4, 0, 5, 0, 52, 0, - 59, 0, 67, 0, 70, 0, 103, 0, 105, 0, - 3, 53, 56, 0, 54, 55, 0, 29, 0, 29, - 0, 57, 58, 0, 29, 0, 29, 0, 6, 60, - 63, 0, 61, 62, 0, 29, 0, 29, 0, 64, - 0, 63, 64, 0, 7, 65, 66, 0, 29, 0, - 29, 0, 68, 81, 0, 69, 0, 32, 0, 68, - 71, 72, 0, 29, 0, 73, 74, 0, 73, 0, - 64, 0, 75, 0, 74, 75, 0, 76, 81, 0, - 76, 0, 8, 77, 78, 0, 8, 0, 29, 0, - 79, 80, 0, 34, 0, 110, 0, 82, 0, 81, - 82, 0, 37, 83, 38, 85, 38, 88, 39, 86, - 87, 0, 108, 0, 84, 0, 31, 0, 30, 0, - 33, 0, 29, 0, 110, 0, 89, 0, 91, 0, - 90, 92, 0, 90, 0, 13, 38, 94, 38, 0, - 95, 38, 94, 96, 0, 93, 0, 92, 93, 0, - 24, 82, 0, 30, 0, 30, 40, 30, 0, 30, - 40, 41, 0, 29, 0, 41, 0, 36, 0, 36, - 42, 36, 0, 0, 38, 97, 0, 38, 97, 38, - 98, 0, 100, 38, 101, 0, 99, 0, 98, 38, - 99, 0, 100, 38, 101, 0, 101, 0, 35, 0, - 102, 0, 101, 43, 102, 0, 29, 0, 31, 0, - 30, 0, 9, 104, 81, 0, 29, 0, 106, 81, - 0, 106, 0, 10, 107, 0, 10, 0, 29, 0, - 12, 107, 109, 0, 110, 0, 0, 40, 29, 0, - 40, 113, 0, 40, 27, 37, 111, 38, 112, 39, - 0, 113, 0, 113, 0, 114, 0, 113, 15, 114, - 0, 115, 0, 114, 14, 115, 0, 17, 119, 0, - 19, 119, 0, 18, 119, 116, 118, 117, 0, 16, - 115, 0, 37, 113, 39, 0, 28, 37, 113, 39, - 0, 20, 0, 21, 0, 0, 30, 0, 29, 0, - 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, - 84, 0, 120, 0, 121, 84, 0, 122, 84, 0, - 124, 84, 0, 121, 124, 84, 0, 122, 124, 84, - 0, 44, 42, 0, 123, 0, 122, 123, 0, 44, - 44, 42, 0, 125, 0, 124, 125, 0, 84, 42, - 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 157, 164, 165, 169, 170, 178, 181, 184, 192, 193, - 194, 195, 196, 197, 200, 203, 212, 218, 225, 234, - 240, 247, 257, 266, 272, 278, 285, 294, 297, 303, - 309, 320, 323, 343, 352, 377, 385, 391, 413, 414, - 417, 424, 430, 444, 450, 457, 460, 466, 469, 470, - 473, 480, 484, 493, 500, 520, 529, 538, 563, 564, - 567, 580, 596, 623, 626, 627, 631, 634, 642, 650, - 658, 665, 675, 683, 694, 698, 703, 710, 726, 727, - 730, 738, 751, 760, 767, 776, 783, 790, 799, 802, - 807, 820, 826, 834, 845, 848, 864, 868, 869, 879, - 894, 915, 921, 927, 931, 941, 945, 955, 963, 975, - 998, 1006, 1010, 1015, 1023, 1033, 1037, 1043, 1046, 1054, - 1062, 1070, 1078, 1088, 1099, 1108, 1118, 1134, 1150, 1167, - 1192, 1202, 1209, 1224, 1234, 1241, 1256 -}; - -static const char * const yytname[] = { "$","error","$undefined.","T_SYSTEM", -"T_DEFINE","T_ENDDEFINE","T_METASOPCLASS","T_SOPCLASS","T_MODULE","T_ITEM","T_MACRO", -"T_INCLUDEITEM","T_INCLUDEMACRO","T_SQ","T_AND","T_OR","T_NOT","T_PRESENT","T_VALUE", -"T_EMPTY","T_TRUE","T_FALSE","T_EQUAL","T_LESS","T_GREATER","T_LESS_OR_EQUAL", -"T_GREATER_OR_EQUAL","T_WEAK","T_WARN","STRING","INTEGER","HEX","COMMANDFIELD", -"TYPE","USAGE","VALUETYPE","VR","'('","','","')'","':'","'n'","'/'","'|'","'.'", -"DefinitionGrammar","DefinitionComponents","Definition","Define","BeginDefine", -"EndDefine","Definitions","SystemDef","SystemDefinition","SystemName","SystemVersion", -"AEDefinition","AEName","AEVersion","MetaSopClassDef","BeginMetaSopClassDef", -"MetaSopClassUID","MetaSopClassName","SopClassDefList","SopClassDef","SopClassUID", -"SopClassName","CommandDef","DimseCmdDef","DimseCmd","CommandIodDef","IodName", -"IodContentDef","SopClassDefinition","ModuleDefList","ModuleDef","ModuleNameDef", -"ModuleName","ModuleUsage","ModUsage","ModuleCondition","AttributeDefList","AttributeDef", -"AttributeTagDef","AttributeTag","AttributeType","AttributeName","AttributeCondition", -"AttributeValueDef","SequenceValueDef","SequenceIntro","OtherValueDef","ItemAttributeDefList", -"ItemAttributeDef","AttributeVM","AttributeVR","ValuesDef","FirstValuesDef", -"OtherValuesDefList","OtherValuesDef","ValueType","ValuesList","Value","ItemDef", -"ItemName","MacroDef","MacroBegin","MacroName","MacroReference","MacroCondition", -"Condition","PrimaryCond","SecondaryCond","CondExpr","Expr","SimpleExpr","ValueNr", -"CondValue","Operator","AttributeTagAddress","AttributeTagPath","AttributeTagHere", -"AttributeTagUpPath","AttributeTagUp","AttributeTagDownPath","AttributeTagDown", -"" -}; -#endif - -static const short definitionr1[] = { 0, - 45, 46, 46, 47, 47, 48, 49, 50, 51, 51, - 51, 51, 51, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 72, 73, 74, 74, - 75, 75, 76, 76, 77, 78, 79, 80, 81, 81, - 82, 82, 83, 84, 85, 85, 86, 87, 88, 88, - 89, 89, 90, 91, 92, 92, 93, 94, 94, 94, - 94, 94, 95, 95, 96, 96, 96, 97, 98, 98, - 99, 99, 100, 101, 101, 102, 102, 102, 103, 104, - 105, 105, 106, 106, 107, 108, 109, 110, 110, 110, - 110, 111, 112, 113, 113, 114, 114, 115, 115, 115, - 115, 115, 115, 115, 115, 116, 116, 117, 118, 118, - 118, 118, 118, 119, 119, 120, 120, 120, 120, 120, - 121, 122, 122, 123, 124, 124, 125 -}; - -static const short definitionr2[] = { 0, - 1, 1, 2, 1, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 2, 1, 1, 2, 1, - 1, 3, 2, 1, 1, 1, 2, 3, 1, 1, - 2, 1, 1, 3, 1, 2, 1, 1, 1, 2, - 2, 1, 3, 1, 1, 2, 1, 1, 1, 2, - 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 4, 4, 1, 2, 2, 1, 3, 3, - 1, 1, 1, 3, 0, 2, 4, 3, 1, 3, - 3, 1, 1, 1, 3, 1, 1, 1, 3, 1, - 2, 1, 2, 1, 1, 3, 1, 0, 2, 2, - 7, 1, 1, 1, 3, 1, 3, 2, 2, 5, - 2, 3, 4, 1, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, - 2, 1, 2, 3, 1, 2, 2 -}; - -static const short definitiondefact[] = { 0, - 5, 7, 0, 2, 4, 0, 3, 0, 0, 0, - 94, 33, 0, 9, 10, 11, 0, 32, 12, 13, - 14, 92, 17, 0, 0, 24, 0, 0, 90, 0, - 95, 93, 8, 6, 0, 35, 0, 0, 31, 49, - 52, 91, 20, 15, 0, 18, 16, 0, 22, 26, - 25, 23, 89, 98, 54, 0, 53, 38, 34, 37, - 50, 21, 19, 29, 0, 27, 0, 96, 97, 0, - 44, 36, 39, 42, 30, 28, 0, 0, 0, 0, - 114, 115, 0, 0, 99, 0, 100, 104, 106, 55, - 56, 0, 45, 0, 40, 41, 111, 0, 124, 108, - 125, 0, 0, 132, 0, 135, 116, 109, 0, 0, - 0, 0, 0, 0, 47, 43, 98, 131, 0, 137, - 126, 0, 0, 127, 133, 0, 128, 136, 117, 0, - 0, 102, 0, 112, 105, 107, 0, 73, 0, 59, - 62, 60, 0, 46, 48, 134, 129, 130, 119, 120, - 121, 122, 123, 0, 0, 113, 0, 0, 0, 0, - 61, 65, 0, 118, 110, 0, 103, 71, 68, 72, - 0, 74, 57, 98, 67, 66, 75, 101, 0, 63, - 51, 58, 0, 64, 69, 70, 83, 76, 0, 0, - 0, 86, 88, 87, 77, 79, 0, 82, 84, 78, - 0, 0, 0, 80, 81, 85, 0, 0, 0 -}; - -static const short definitiondefgoto[] = { 207, - 3, 4, 5, 6, 34, 13, 14, 24, 25, 47, - 44, 45, 63, 15, 27, 28, 52, 49, 50, 65, - 76, 16, 17, 18, 19, 38, 59, 60, 72, 73, - 74, 94, 116, 117, 144, 39, 40, 56, 99, 92, - 174, 181, 139, 140, 141, 142, 161, 162, 171, 143, - 184, 188, 195, 196, 197, 198, 199, 20, 30, 21, - 22, 32, 41, 68, 69, 131, 166, 87, 88, 89, - 130, 165, 154, 100, 101, 102, 103, 104, 105, 106 -}; - -static const short definitionpact[] = { 79, --32768,-32768, 81,-32768,-32768, 3,-32768, -9, 0, 8, - 36,-32768, 19,-32768,-32768,-32768, -1,-32768,-32768,-32768, --32768, -4,-32768, 41, 49,-32768, 80, 60,-32768, -4, --32768,-32768,-32768,-32768, 36,-32768, 61, 80, -4,-32768, --32768, -4,-32768,-32768, 77,-32768,-32768, 78, 80,-32768, --32768,-32768, -4, 68,-32768, 71,-32768,-32768,-32768, 102, --32768,-32768,-32768,-32768, 82,-32768, 27,-32768,-32768, 58, - 83, 102,-32768, -4,-32768,-32768, 56, -14, -14, -14, --32768,-32768, 76, 85,-32768, 56, 99, 101,-32768,-32768, --32768, 86,-32768, 84,-32768, -4,-32768, 16, 74,-32768, --32768, 61, -13,-32768, 61,-32768, 87,-32768, 56, 56, - -5, 56, 56, 6,-32768,-32768, 68,-32768, 88,-32768, - 74, 61, 75, 74,-32768, 61, 74,-32768,-32768, 72, - 89, 99, 1,-32768, 101,-32768, 90, 91, 92,-32768, - 96,-32768, 94,-32768,-32768,-32768, 74, 74,-32768,-32768, --32768,-32768,-32768, 97, 56,-32768, 9, 93, 105, -4, - 96,-32768, 9,-32768,-32768, 98, 99,-32768, 95,-32768, - 100,-32768,-32768, 68,-32768,-32768, 103,-32768, 21,-32768, --32768,-32768, 104,-32768,-32768,-32768,-32768, 106, 107, -8, - 70,-32768,-32768,-32768, 108,-32768, 109, 110,-32768, 110, - -8, 70, 70,-32768, 110,-32768, 123, 125,-32768 -}; - -static const short definitionpgoto[] = {-32768, --32768, 133,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 14,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 111, --32768,-32768,-32768,-32768,-32768, -15, -39,-32768, -36,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, -21, -20,-32768, --32768,-32768,-32768, -59, -35, -123, -54,-32768,-32768,-32768, --32768, 115,-32768,-32768, -113,-32768,-32768, -84, 39, -72, --32768,-32768,-32768, 23,-32768,-32768,-32768, 51, 2, -73 -}; - - -#define YYLAST 183 - - -static const short yytable[] = { 61, - 57, 111, 61, 145, 97, 8, 42, 35, 9, 112, - 35, 10, 11, 61, 53, 112, 55, 55, 137, 23, - 192, 193, 194, 33, 132, 133, 187, 36, 26, 98, - 123, 128, 37, 134, 12, 37, 29, 168, 169, 156, - 136, 138, 77, 78, 79, 80, 81, 82, 128, 170, - 185, 58, 128, 83, 84, 85, 61, 118, 96, 119, - 182, 186, 66, 86, 31, 121, 124, 200, 127, 43, - 167, 77, 78, 79, 80, 81, 82, 46, 205, 1, - -1, 1, 2, 84, 2, 147, 48, 90, 51, 148, - 91, 55, 86, 149, 150, 151, 152, 153, 192, 193, - 194, 107, 108, 122, 126, 62, 64, 67, 70, 71, - 75, 93, 109, 112, 113, 120, 129, 115, 119, 160, - 175, 110, 208, 114, 209, 164, 155, 157, 172, 146, - 159, 163, 158, 173, 179, 7, 178, 180, 187, 176, - 183, 204, 177, 190, 191, 201, 202, 189, 206, 54, - 135, 0, 203, 125, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 95 -}; - -static const short yycheck[] = { 39, - 37, 86, 42, 117, 77, 3, 22, 12, 6, 15, - 12, 9, 10, 53, 30, 15, 31, 31, 13, 29, - 29, 30, 31, 5, 109, 110, 35, 29, 29, 44, - 44, 105, 37, 39, 32, 37, 29, 29, 30, 39, - 113, 36, 16, 17, 18, 19, 20, 21, 122, 41, - 30, 38, 126, 27, 28, 29, 96, 42, 74, 44, - 174, 41, 49, 37, 29, 102, 103, 191, 105, 29, - 155, 16, 17, 18, 19, 20, 21, 29, 202, 1, - 0, 1, 4, 28, 4, 122, 7, 30, 29, 126, - 33, 31, 37, 22, 23, 24, 25, 26, 29, 30, - 31, 79, 80, 102, 103, 29, 29, 40, 38, 8, - 29, 29, 37, 15, 14, 42, 30, 34, 44, 24, - 160, 37, 0, 38, 0, 29, 38, 38, 36, 42, - 39, 38, 42, 29, 40, 3, 39, 38, 35, 161, - 38, 201, 163, 38, 38, 38, 38, 183, 203, 35, - 112, -1, 43, 103, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 72 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "bison.simple" - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -#ifndef alloca -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) -#include -#else /* not sparc */ -#if defined (MSDOS) && !defined (__TURBOC__) -#include -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -#include - #pragma alloca -#else /* not MSDOS, __TURBOC__, or _AIX */ -#ifdef __hpux -#ifdef __cplusplus -extern "C" { -void *alloca (unsigned int); -}; -#else /* not __cplusplus */ -void *alloca (); -#endif /* not __cplusplus */ -#endif /* __hpux */ -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc. */ -#endif /* not GNU C. */ -#endif /* alloca not defined. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define definitionerrok (yyerrstatus = 0) -#define definitionclearin (definitionchar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto definitionerrlab1 -/* Like YYERROR except do call definitionerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto definitionerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (definitionchar == YYEMPTY && yylen == 1) \ - { definitionchar = (token), definitionlval = (value); \ - definitionchar1 = YYTRANSLATE (definitionchar); \ - YYPOPSTACK; \ - goto definitionbackup; \ - } \ - else \ - { definitionerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX definitionlex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX definitionlex(&definitionlval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX definitionlex(&definitionlval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX definitionlex(&definitionlval, YYLEX_PARAM) -#else -#define YYLEX definitionlex(&definitionlval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int definitionchar; /* the lookahead symbol */ -YYSTYPE definitionlval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int definitionnerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int definitiondebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -int definitionparse (void); -#endif - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (from, to, count) - char *from; - char *to; - int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *from, char *to, int count) -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 192 "bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into definitionparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#else -#define YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#endif - -int -definitionparse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL -{ - register int definitionstate; - register int yyn; - register short *definitionssp; - register YYSTYPE *definitionvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int definitionchar1 = 0; /* lookahead token as an internal (translated) token number */ - - short definitionssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE definitionvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *definitionss = definitionssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *definitionvs = definitionvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *definitionlsp; - -#define YYPOPSTACK (definitionvsp--, definitionssp--, definitionlsp--) -#else -#define YYPOPSTACK (definitionvsp--, definitionssp--) -#endif - - int definitionstacksize = YYINITDEPTH; - -#ifdef YYPURE - int definitionchar; - YYSTYPE definitionlval; - int definitionnerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE definitionval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (definitiondebug) - fprintf(stderr, "Starting parse\n"); -#endif - - definitionstate = 0; - yyerrstatus = 0; - definitionnerrs = 0; - definitionchar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - definitionssp = definitionss - 1; - definitionvsp = definitionvs; -#ifdef YYLSP_NEEDED - definitionlsp = yyls; -#endif - -/* Push a new state, which is found in definitionstate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++definitionssp = definitionstate; - - if (definitionssp >= definitionss + definitionstacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *definitionvs1 = definitionvs; - short *definitionss1 = definitionss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = definitionssp - definitionss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &definitionss1, size * sizeof (*definitionssp), - &definitionvs1, size * sizeof (*definitionvsp), - &yyls1, size * sizeof (*definitionlsp), - &definitionstacksize); -#else - yyoverflow("parser stack overflow", - &definitionss1, size * sizeof (*definitionssp), - &definitionvs1, size * sizeof (*definitionvsp), - &definitionstacksize); -#endif - - definitionss = definitionss1; definitionvs = definitionvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (definitionstacksize >= YYMAXDEPTH) - { - definitionerror("parser stack overflow"); - return 2; - } - definitionstacksize *= 2; - if (definitionstacksize > YYMAXDEPTH) - definitionstacksize = YYMAXDEPTH; - definitionss = (short *) alloca (definitionstacksize * sizeof (*definitionssp)); - __yy_memcpy ((char *)definitionss1, (char *)definitionss, size * sizeof (*definitionssp)); - definitionvs = (YYSTYPE *) alloca (definitionstacksize * sizeof (*definitionvsp)); - __yy_memcpy ((char *)definitionvs1, (char *)definitionvs, size * sizeof (*definitionvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (definitionstacksize * sizeof (*definitionlsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*definitionlsp)); -#endif -#endif /* no yyoverflow */ - - definitionssp = definitionss + size - 1; - definitionvsp = definitionvs + size - 1; -#ifdef YYLSP_NEEDED - definitionlsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (definitiondebug) - fprintf(stderr, "Stack size increased to %d\n", definitionstacksize); -#endif - - if (definitionssp >= definitionss + definitionstacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (definitiondebug) - fprintf(stderr, "Entering state %d\n", definitionstate); -#endif - - goto definitionbackup; - definitionbackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = definitionpact[definitionstate]; - if (yyn == YYFLAG) - goto definitiondefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* definitionchar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (definitionchar == YYEMPTY) - { -#if YYDEBUG != 0 - if (definitiondebug) - fprintf(stderr, "Reading a token: "); -#endif - definitionchar = YYLEX; - } - - /* Convert token to internal form (in definitionchar1) for indexing tables with */ - - if (definitionchar <= 0) /* This means end of input. */ - { - definitionchar1 = 0; - definitionchar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (definitiondebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - definitionchar1 = YYTRANSLATE(definitionchar); - -#if YYDEBUG != 0 - if (definitiondebug) - { - fprintf (stderr, "Next token is %d (%s", definitionchar, yytname[definitionchar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, definitionchar, definitionlval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += definitionchar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != definitionchar1) - goto definitiondefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto definitionerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto definitionerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (definitiondebug) - fprintf(stderr, "Shifting token %d (%s), ", definitionchar, yytname[definitionchar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (definitionchar != YYEOF) - definitionchar = YYEMPTY; - - *++definitionvsp = definitionlval; -#ifdef YYLSP_NEEDED - *++definitionlsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - definitionstate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -definitiondefault: - - yyn = definitiondefact[definitionstate]; - if (yyn == 0) - goto definitionerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = definitionr2[yyn]; - if (yylen > 0) - definitionval = definitionvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (definitiondebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[definitionr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 1: -#line 158 "definition_parse.y" -{ - ResolveMacroReferences(); - ResetVariables(); - ; - break;} -case 5: -#line 171 "definition_parse.y" -{ - definitionwarn("Skipping to next define"); - definitionParseOnly = true; - YYABORT; - ; - break;} -case 8: -#line 185 "definition_parse.y" -{ - // reset the skip definition parameter to allow more than - // 1 sopclass definition in 1 file - skipDefinition = false; - ; - break;} -case 16: -#line 204 "definition_parse.y" -{ - if (!definitionParseOnly) - { - defFileContent_ptr->SetSystem(lsystemname, lsystemversion); - } - ; - break;} -case 17: -#line 213 "definition_parse.y" -{ - strcpy(lsystemname, definitionval.string); - ; - break;} -case 18: -#line 219 "definition_parse.y" -{ - strcpy(lsystemversion, definitionval.string); - ; - break;} -case 19: -#line 226 "definition_parse.y" -{ - if (!definitionParseOnly) - { - defFileContent_ptr->SetAE(lAEname, lAEversion); - } - ; - break;} -case 20: -#line 235 "definition_parse.y" -{ - strcpy(lAEname, definitionval.string); - ; - break;} -case 21: -#line 241 "definition_parse.y" -{ - strcpy(lAEversion, definitionval.string); - ; - break;} -case 22: -#line 248 "definition_parse.y" -{ - if (!definitionParseOnly) - { - defFileContent_ptr->SetMetaSop(currentMetaSopClass_ptr); - definitionfileempty = false; - } - ; - break;} -case 23: -#line 258 "definition_parse.y" -{ - if (!definitionParseOnly) - { - currentMetaSopClass_ptr = new DEF_METASOPCLASS_CLASS(lMetaSOPClassUID, lMetaSOPClassName); - } - ; - break;} -case 24: -#line 267 "definition_parse.y" -{ - strcpy(lMetaSOPClassUID, definitionval.string); - ; - break;} -case 25: -#line 273 "definition_parse.y" -{ - strcpy(lMetaSOPClassName, definitionval.string); - ; - break;} -case 26: -#line 279 "definition_parse.y" -{ - if (!definitionParseOnly) - { - currentMetaSopClass_ptr->AddSopClass(lSOPClassUID, lSOPClassName); - } - ; - break;} -case 27: -#line 286 "definition_parse.y" -{ - if (!definitionParseOnly) - { - currentMetaSopClass_ptr->AddSopClass(lSOPClassUID, lSOPClassName); - } - ; - break;} -case 29: -#line 298 "definition_parse.y" -{ - strcpy(lSOPClassUID, definitionval.string); - ; - break;} -case 30: -#line 304 "definition_parse.y" -{ - strcpy(lSOPClassName, definitionval.string); - ; - break;} -case 31: -#line 310 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentCommand_ptr->AddModule(currentModule_ptr); - defFileContent_ptr->AddCommand(currentCommand_ptr); - definitionfileempty = false; - } - ; - break;} -case 33: -#line 324 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - // assume we have a command definition - currentCommand_ptr = new DEF_COMMAND_CLASS(); - currentCommand_ptr->SetDimseCmd(definitionval.commandField); - currentDICOMObject_ptr = currentCommand_ptr; - - lDimseCmd = definitionval.commandField; - - // create module for command attributes. - currentModule_ptr = new DEF_MODULE_CLASS(); - currentModule_ptr->SetUsage(MOD_USAGE_M); - currentModule_ptr->SetName(mapCommandName(lDimseCmd)); - currentAttributeGroup_ptr = currentModule_ptr; - } - ; - break;} -case 34: -#line 344 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionfileempty = false; - } - ; - break;} -case 35: -#line 353 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - // we're dealing with a dataset - // delete previously created command & module - if (currentCommand_ptr) - { - delete currentCommand_ptr; - currentCommand_ptr = NULL; - } - if (currentModule_ptr) - { - delete currentModule_ptr; - currentModule_ptr = NULL; - } - - strcpy(lIodName, definitionval.string); - currentDataset_ptr = new DEF_DATASET_CLASS(lIodName); - currentDataset_ptr->SetDimseCmd(lDimseCmd); - currentDICOMObject_ptr = currentDataset_ptr; - } - ; - break;} -case 36: -#line 378 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - // add the dataset to the SOPClass Definition - currentSopClass_ptr->AddDataset(currentDataset_ptr); - } - ; - break;} -case 37: -#line 386 "definition_parse.y" -{ - // the dataset is empty - ; - break;} -case 38: -#line 392 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - if ((currentSopClass_ptr != NULL) && - (currentSopClass_ptr->GetUid() == lSOPClassUID) && - (currentSopClass_ptr->GetName() == lSOPClassName)) - { - // Do not add a new SOP CLASS to the File Content as - // the existing one has the same UID and Name. - // We are probably adding another Command / Dataset - // for the same SOP Class. - } - else - { - currentSopClass_ptr = new DEF_SOPCLASS_CLASS(lSOPClassUID, lSOPClassName); - defFileContent_ptr->AddSopClass(currentSopClass_ptr); - } - } - ; - break;} -case 41: -#line 418 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentDICOMObject_ptr->AddModule(currentModule_ptr); - } - ; - break;} -case 42: -#line 425 "definition_parse.y" -{ - // the module is empty - ignore it - ; - break;} -case 43: -#line 431 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentModule_ptr = new DEF_MODULE_CLASS(lModuleName, lModuleUsage); - currentModule_ptr->SetCondition(currentCondition_ptr); - currentModule_ptr->SetTextualCondition(lTextualCondition); - - // reset condition - currentCondition_ptr = NULL; - lTextualCondition.erase(); - currentAttributeGroup_ptr = currentModule_ptr; - } - ; - break;} -case 44: -#line 445 "definition_parse.y" -{ - // the module name and usage not present - ignore it - ; - break;} -case 45: -#line 451 "definition_parse.y" -{ - strcpy(lModuleName, definitionval.string); - ; - break;} -case 47: -#line 461 "definition_parse.y" -{ - lModuleUsage = definitionval.usage; - ; - break;} -case 51: -#line 474 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttributeGroup_ptr->AddAttribute(currentAttribute_ptr); - } - ; - break;} -case 53: -#line 485 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr = new DEF_ATTRIBUTE_CLASS(lAttrGroup, lAttrElement); - } - ; - break;} -case 54: -#line 494 "definition_parse.y" -{ - lAttrGroup = (UINT16) (definitionlval.hex >> 16); - lAttrElement = (UINT16) (definitionval.hex & 0x0000FFFF); - ; - break;} -case 55: -#line 501 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - switch(definitionval.integer) - { - case 1: - currentAttribute_ptr->SetType(ATTR_TYPE_1); - break; - case 2: - currentAttribute_ptr->SetType(ATTR_TYPE_2); - break; - case 3: - currentAttribute_ptr->SetType(ATTR_TYPE_3); - break; - default: - break; - } - } - ; - break;} -case 56: -#line 521 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetType(definitionval.type); - } - ; - break;} -case 57: -#line 530 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetName(definitionval.string); - } - ; - break;} -case 58: -#line 539 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - if (currentCondition_ptr != NULL) - { - currentAttribute_ptr->SetCondition(currentCondition_ptr); - - // reset condition pointer - currentCondition_ptr = NULL; - } - else - { - if (!lTextualCondition.empty()) - { - currentAttribute_ptr->SetTextualCondition(lTextualCondition); - - // reset textual condition - lTextualCondition.erase(); - } - } - } - ; - break;} -case 61: -#line 568 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - // restore attribute group and remove from stack - currentAttributeGroup_ptr = groups.top(); - groups.pop(); - - // restore current attribute (the sequence attribute) - currentAttribute_ptr = attributes.top(); - attributes.pop(); - } - ; - break;} -case 62: -#line 581 "definition_parse.y" -{ - // we were dealing with an empty item - if (!definitionParseOnly && !skipDefinition) - { - // restore attribute group and remove from stack - currentAttributeGroup_ptr = groups.top(); - groups.pop(); - - // restore current attribute (the sequence attribute) - currentAttribute_ptr = attributes.top(); - attributes.pop(); - } - ; - break;} -case 63: -#line 597 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetVR(ATTR_VR_SQ); - - currentItem_ptr = new DEF_ITEM_CLASS(); - - // create new value and value list, add item - currentValue_ptr = CreateNewValue(ATTR_VR_SQ); - currentValue_ptr->Set(currentItem_ptr); - - // add value to attribute - indexed by value list index - currentAttribute_ptr->AddValue(currentValue_ptr, currentValueListIndex); - currentAttribute_ptr->SetValueType(ATTR_VAL_TYPE_NOVALUE, currentValueListIndex); - - // the item is the new current attribute group. - // store the old one - groups.push(currentAttributeGroup_ptr); - currentAttributeGroup_ptr = currentItem_ptr; - - // store currentAttribute_ptr - attributes.push(currentAttribute_ptr); - } - ; - break;} -case 68: -#line 635 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetVmMin((UINT) definitionvsp[0].integer); - currentAttribute_ptr->SetVmMax((UINT) definitionvsp[0].integer); - } - ; - break;} -case 69: -#line 643 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetVmMin((UINT) definitionvsp[-2].integer); - currentAttribute_ptr->SetVmMax((UINT) definitionvsp[0].integer); - } - ; - break;} -case 70: -#line 651 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetVmMin((UINT) definitionvsp[-2].integer); - currentAttribute_ptr->SetVmMax((UINT) MAXVM); - } - ; - break;} -case 71: -#line 659 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - CreateVMFromString(definitionval.string, currentAttribute_ptr); - } - ; - break;} -case 72: -#line 666 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetVmMin((UINT) 0); - currentAttribute_ptr->SetVmMax((UINT) MAXVM); - } - ; - break;} -case 73: -#line 676 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - lAttrVr = definitionval.vr; - currentAttribute_ptr->SetVR(lAttrVr); - } - ; - break;} -case 74: -#line 684 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - lAttrVr = definitionvsp[-2].vr; - currentAttribute_ptr->SetVR(lAttrVr); - currentAttribute_ptr->SetSecondVR(definitionvsp[0].vr); - } - ; - break;} -case 75: -#line 695 "definition_parse.y" -{ - // empty - ; - break;} -case 76: -#line 699 "definition_parse.y" -{ - // reset the list index for the next attribute values - currentValueListIndex = 0; - ; - break;} -case 77: -#line 704 "definition_parse.y" -{ - // reset the list index for the next attribute values - currentValueListIndex = 0; - ; - break;} -case 78: -#line 711 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - // remember type of the first value list - // this is the default type for other - // value lists - // add value to attribute - indexed by value list index - currentAttribute_ptr->SetValueType(currentValueType, currentValueListIndex); - currentValueListIndex++; - - lFirstValueType = currentValueType; - } - ; - break;} -case 81: -#line 731 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetValueType(currentValueType, currentValueListIndex); - currentValueListIndex++; - } - ; - break;} -case 82: -#line 739 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - // a ValuesList with no specified type gets the type - // of the first ValuesList specified - // add value to attribute - indexed by value list index - currentAttribute_ptr->SetValueType(lFirstValueType, currentValueListIndex); - currentValueListIndex++; - } - ; - break;} -case 83: -#line 752 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentValueType = definitionval.valueType; - } - ; - break;} -case 84: -#line 761 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->AddValue(currentValue_ptr, currentValueListIndex); - } - ; - break;} -case 85: -#line 768 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->AddValue(currentValue_ptr, currentValueListIndex); - } - ; - break;} -case 86: -#line 777 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentValue_ptr = CreateValueFromString(definitionval.string, lAttrVr); - } - ; - break;} -case 87: -#line 784 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentValue_ptr = CreateValueFromHex(definitionval.hex, lAttrVr); - } - ; - break;} -case 88: -#line 791 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentValue_ptr = CreateValueFromInt(definitionval.integer, lAttrVr); - } - ; - break;} -case 90: -#line 803 "definition_parse.y" -{ - ; - break;} -case 91: -#line 808 "definition_parse.y" -{ - if (!definitionParseOnly) - { - if (currentSopClass_ptr) - { - currentSopClass_ptr->AddMacro(currentMacro_ptr); - } - - // store macro pointers to be able to resolve references - macros.push_back(currentMacro_ptr); - } - ; - break;} -case 92: -#line 821 "definition_parse.y" -{ - // Macro is empty - ignore it - ; - break;} -case 93: -#line 827 "definition_parse.y" -{ - if (!definitionParseOnly) - { - currentMacro_ptr = new DEF_MACRO_CLASS(definitionvsp[0].string); - currentAttributeGroup_ptr = currentMacro_ptr; - } - ; - break;} -case 94: -#line 835 "definition_parse.y" -{ - // Macro name is not present - ignore it - if (!definitionParseOnly) - { - currentMacro_ptr = new DEF_MACRO_CLASS("NO MACRO NAME - IGNORED"); - currentAttributeGroup_ptr = currentMacro_ptr; - } - ; - break;} -case 96: -#line 849 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttributeGroup_ptr->AddMacroReference(definitionvsp[-1].string, currentCondition_ptr, lTextualCondition); - groups_with_refs.push_back(currentAttributeGroup_ptr); - - // reset condition pointer - currentCondition_ptr = NULL; - - // reset textual condition - lTextualCondition.erase(); - } - ; - break;} -case 99: -#line 870 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - lTextualCondition = definitionvsp[0].string; - - // reset condition pointer - currentCondition_ptr = NULL; - } - ; - break;} -case 100: -#line 880 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - // create new condition - currentCondition_ptr = new CONDITION_CLASS(); - - // add the primary root node to the condition - condition_node_ptr = definitionvsp[0].node_ptr; - currentCondition_ptr->SetPrimaryNode(condition_node_ptr); - - // reset textual condition - lTextualCondition.erase(); - } - ; - break;} -case 101: -#line 895 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - // create new condition - currentCondition_ptr = new CONDITION_CLASS(); - - // add the primary root node to the condition - condition_node_ptr = definitionvsp[-3].node_ptr; - currentCondition_ptr->SetPrimaryNode(condition_node_ptr); - - // add the secondary root node to the condition - condition_node_ptr = definitionvsp[-1].node_ptr; - currentCondition_ptr->SetSecondaryNode(condition_node_ptr); - - // reset textual condition - lTextualCondition.erase(); - } - ; - break;} -case 102: -#line 916 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[0].node_ptr; - ; - break;} -case 103: -#line 922 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[0].node_ptr; - ; - break;} -case 104: -#line 928 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[0].node_ptr; - ; - break;} -case 105: -#line 932 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.node_ptr = new CONDITION_OR_NODE_CLASS(definitionvsp[-2].node_ptr, definitionvsp[0].node_ptr); - definitionval.node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 106: -#line 942 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[0].node_ptr; - ; - break;} -case 107: -#line 946 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.node_ptr = new CONDITION_AND_NODE_CLASS(definitionvsp[-2].node_ptr, definitionvsp[0].node_ptr); - definitionval.node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 108: -#line 956 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.node_ptr = new CONDITION_PRESENT_NODE_CLASS(definitionvsp[0].unary_node_ptr); - definitionval.node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 109: -#line 964 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { -// node_ptr = new CONDITION_NAVIGATION_TAG_CLASS(lAttrGroup, lAttrElement); -// node_ptr->SetLogger(definitionfilelogger_ptr); - -// $$ = new CONDITION_EMPTY_NODE_CLASS(node_ptr); - definitionval.node_ptr = new CONDITION_EMPTY_NODE_CLASS(definitionvsp[0].unary_node_ptr); - definitionval.node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 110: -#line 976 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { -// node_left_ptr = new CONDITION_NAVIGATION_TAG_CLASS(lAttrGroup, lAttrElement); -// node_left_ptr->SetLogger(definitionfilelogger_ptr); - - node_right_ptr = new CONDITION_LEAF_VALUE_NR_CLASS((UINT16)definitionvsp[-2].integer); - node_right_ptr->SetLogger(definitionfilelogger_ptr); - -// node_left_ptr = new CONDITION_VALUE_NODE_CLASS(node_left_ptr, node_right_ptr); - node_left_ptr = new CONDITION_VALUE_NODE_CLASS(definitionvsp[-3].unary_node_ptr, node_right_ptr); - node_left_ptr->SetLogger(definitionfilelogger_ptr); - - node_right_ptr = new CONDITION_LEAF_CONST_CLASS(definitionvsp[0].string); - node_right_ptr->SetLogger(definitionfilelogger_ptr); - - definitionvsp[-1].binary_node_ptr->SetLeft(node_left_ptr); - definitionvsp[-1].binary_node_ptr->SetRight(node_right_ptr); - - definitionval.node_ptr = definitionvsp[-1].binary_node_ptr; - } - ; - break;} -case 111: -#line 999 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.node_ptr = new CONDITION_NOT_NODE_CLASS(definitionvsp[0].node_ptr); - definitionval.node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 112: -#line 1007 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[-1].node_ptr; - ; - break;} -case 113: -#line 1011 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[-1].node_ptr; - definitionval.node_ptr->SetConditionType(CONDITION_TYPE_WARNING); - ; - break;} -case 114: -#line 1016 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.node_ptr = new CONDITION_LEAF_TRUE_CLASS(true); - definitionval.node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 115: -#line 1024 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.node_ptr = new CONDITION_LEAF_TRUE_CLASS(false); - definitionval.node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 116: -#line 1034 "definition_parse.y" -{ - definitionval.integer = APPLY_TO_ANY_VALUE; - ; - break;} -case 117: -#line 1038 "definition_parse.y" -{ - definitionval.integer = definitionvsp[0].integer; - ; - break;} -case 119: -#line 1047 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.binary_node_ptr = new CONDITION_EQ_NODE_CLASS(); - definitionval.binary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 120: -#line 1055 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.binary_node_ptr = new CONDITION_LESS_NODE_CLASS(); - definitionval.binary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 121: -#line 1063 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.binary_node_ptr = new CONDITION_GREATER_NODE_CLASS(); - definitionval.binary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 122: -#line 1071 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.binary_node_ptr = new CONDITION_LESS_EQ_NODE_CLASS(); - definitionval.binary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 123: -#line 1079 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.binary_node_ptr = new CONDITION_GREATER_EQ_NODE_CLASS(); - definitionval.binary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 124: -#line 1089 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - node_ptr = new CONDITION_NAVIGATION_TAG_CLASS(lAttrGroup, lAttrElement); - node_ptr->SetLogger(definitionfilelogger_ptr); - definitionval.unary_node_ptr = new CONDITION_NAVIGATION_HERE_NODE_CLASS(); - definitionval.unary_node_ptr->SetLogger(definitionfilelogger_ptr); - definitionval.unary_node_ptr->SetNode(node_ptr); - } - ; - break;} -case 125: -#line 1100 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = definitionvsp[0].unary_node_ptr; - } - ; - break;} -case 126: -#line 1109 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - node_ptr = new CONDITION_NAVIGATION_TAG_CLASS(lAttrGroup, lAttrElement); - node_ptr->SetLogger(definitionfilelogger_ptr); - definitionvsp[-1].unary_node_ptr->SetNode(node_ptr); - definitionval.unary_node_ptr = definitionvsp[-1].unary_node_ptr; - } - ; - break;} -case 127: -#line 1119 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - node_ptr = new CONDITION_NAVIGATION_TAG_CLASS(lAttrGroup, lAttrElement); - node_ptr->SetLogger(definitionfilelogger_ptr); - - CONDITION_UNARY_NODE_CLASS* lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) definitionvsp[-1].unary_node_ptr; - while(lNode_ptr->GetNode()) - { - lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) lNode_ptr->GetNode(); - } - lNode_ptr->SetNode(node_ptr); - definitionval.unary_node_ptr = definitionvsp[-1].unary_node_ptr; - } - ; - break;} -case 128: -#line 1135 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - node_ptr = new CONDITION_NAVIGATION_TAG_CLASS(lAttrGroup, lAttrElement); - node_ptr->SetLogger(definitionfilelogger_ptr); - - CONDITION_UNARY_NODE_CLASS* lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) definitionvsp[-1].unary_node_ptr; - while(lNode_ptr->GetNode()) - { - lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) lNode_ptr->GetNode(); - } - lNode_ptr->SetNode(node_ptr); - definitionval.unary_node_ptr = definitionvsp[-1].unary_node_ptr; - } - ; - break;} -case 129: -#line 1151 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - node_ptr = new CONDITION_NAVIGATION_TAG_CLASS(lAttrGroup, lAttrElement); - node_ptr->SetLogger(definitionfilelogger_ptr); - - CONDITION_UNARY_NODE_CLASS* lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) definitionvsp[-1].unary_node_ptr; - while(lNode_ptr->GetNode()) - { - lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) lNode_ptr->GetNode(); - } - lNode_ptr->SetNode(node_ptr); - definitionvsp[-2].unary_node_ptr->SetNode(definitionvsp[-1].unary_node_ptr); - definitionval.unary_node_ptr = definitionvsp[-2].unary_node_ptr; - } - ; - break;} -case 130: -#line 1168 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - node_ptr = new CONDITION_NAVIGATION_TAG_CLASS(lAttrGroup, lAttrElement); - node_ptr->SetLogger(definitionfilelogger_ptr); - - CONDITION_UNARY_NODE_CLASS* lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) definitionvsp[-2].unary_node_ptr; - while(lNode_ptr->GetNode()) - { - lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) lNode_ptr->GetNode(); - } - lNode_ptr->SetNode(definitionvsp[-1].unary_node_ptr); - - lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) definitionvsp[-1].unary_node_ptr; - while(lNode_ptr->GetNode()) - { - lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) lNode_ptr->GetNode(); - } - lNode_ptr->SetNode(node_ptr); - definitionval.unary_node_ptr = definitionvsp[-2].unary_node_ptr; - } - ; - break;} -case 131: -#line 1193 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = new CONDITION_NAVIGATION_HERE_NODE_CLASS(); - definitionval.unary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 132: -#line 1203 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = definitionvsp[0].unary_node_ptr; - } - ; - break;} -case 133: -#line 1210 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - CONDITION_UNARY_NODE_CLASS* lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) definitionvsp[-1].unary_node_ptr; - while(lNode_ptr->GetNode()) - { - lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) lNode_ptr->GetNode(); - } - lNode_ptr->SetNode(definitionvsp[0].unary_node_ptr); - definitionval.unary_node_ptr = definitionvsp[-1].unary_node_ptr; - } - ; - break;} -case 134: -#line 1225 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = new CONDITION_NAVIGATION_UP_NODE_CLASS(); - definitionval.unary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 135: -#line 1235 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = definitionvsp[0].unary_node_ptr; - } - ; - break;} -case 136: -#line 1242 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - CONDITION_UNARY_NODE_CLASS* lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) definitionvsp[-1].unary_node_ptr; - while(lNode_ptr->GetNode()) - { - lNode_ptr = (CONDITION_UNARY_NODE_CLASS*) lNode_ptr->GetNode(); - } - lNode_ptr->SetNode(definitionvsp[0].unary_node_ptr); - definitionval.unary_node_ptr = definitionvsp[-1].unary_node_ptr; - } - ; - break;} -case 137: -#line 1257 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = new CONDITION_NAVIGATION_DOWN_NODE_CLASS(lAttrGroup, lAttrElement); - definitionval.unary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "bison.simple" - - definitionvsp -= yylen; - definitionssp -= yylen; -#ifdef YYLSP_NEEDED - definitionlsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (definitiondebug) - { - short *ssp1 = definitionss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != definitionssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++definitionvsp = definitionval; - -#ifdef YYLSP_NEEDED - definitionlsp++; - if (yylen == 0) - { - definitionlsp->first_line = yylloc.first_line; - definitionlsp->first_column = yylloc.first_column; - definitionlsp->last_line = (definitionlsp-1)->last_line; - definitionlsp->last_column = (definitionlsp-1)->last_column; - definitionlsp->text = 0; - } - else - { - definitionlsp->last_line = (definitionlsp+yylen-1)->last_line; - definitionlsp->last_column = (definitionlsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = definitionr1[yyn]; - - definitionstate = definitionpgoto[yyn - YYNTBASE] + *definitionssp; - if (definitionstate >= 0 && definitionstate <= YYLAST && yycheck[definitionstate] == *definitionssp) - definitionstate = yytable[definitionstate]; - else - definitionstate = definitiondefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -definitionerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++definitionnerrs; - -#ifdef YYERROR_VERBOSE - yyn = definitionpact[definitionstate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - definitionerror(msg); - free(msg); - } - else - definitionerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - definitionerror("parse error"); - } - - goto definitionerrlab1; -definitionerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (definitionchar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (definitiondebug) - fprintf(stderr, "Discarding token %d (%s).\n", definitionchar, yytname[definitionchar1]); -#endif - - definitionchar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = definitiondefact[definitionstate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto definitiondefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (definitionssp == definitionss) YYABORT; - definitionvsp--; - definitionstate = *--definitionssp; -#ifdef YYLSP_NEEDED - definitionlsp--; -#endif - -#if YYDEBUG != 0 - if (definitiondebug) - { - short *ssp1 = definitionss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != definitionssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = definitionpact[definitionstate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (definitiondebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++definitionvsp = definitionlval; -#ifdef YYLSP_NEEDED - *++definitionlsp = yylloc; -#endif - - definitionstate = yyn; - goto yynewstate; -} -#line 1265 "definition_parse.y" - - - -/*****************************************************************************/ -/* -/* Private functions -/* -/*****************************************************************************/ - -static BASE_VALUE_CLASS* CreateValueFromString(NAME_STRING string_val, ATTR_VR_ENUM vr) -{ - BASE_VALUE_CLASS* value_ptr = NULL; - - switch (vr) - { - case ATTR_VR_AE: - case ATTR_VR_AS: - case ATTR_VR_CS: - case ATTR_VR_DA: - case ATTR_VR_DS: - case ATTR_VR_DT: - case ATTR_VR_IS: - case ATTR_VR_LO: - case ATTR_VR_LT: - case ATTR_VR_OB: - case ATTR_VR_OF: - case ATTR_VR_OW: - case ATTR_VR_OL: - case ATTR_VR_OD: - case ATTR_VR_OV: - case ATTR_VR_PN: - case ATTR_VR_SH: - case ATTR_VR_ST: - case ATTR_VR_TM: - case ATTR_VR_UI: - case ATTR_VR_UN: - case ATTR_VR_UR: - case ATTR_VR_UC: - case ATTR_VR_UT: - { - string data = string_val; - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - - case ATTR_VR_AT: - definitionwarn("Attribute AT Value should be expressed in HEX format"); - definitionwarn("Value not used - zero length taken"); - break; - case ATTR_VR_FL: - { - float data = (float) atof(string_val); - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - case ATTR_VR_FD: - { - double data = atof(string_val); - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - case ATTR_VR_SL: - definitionwarn("Attribute SL Value should be expressed in INTEGER format"); - definitionwarn("Value not used - zero length taken"); - break; - case ATTR_VR_SS: - definitionwarn("Attribute SS Value should be expressed in INTEGER format"); - definitionwarn("Value not used - zero length taken"); - break; - case ATTR_VR_UL: - definitionwarn("Attribute UL Value should be expressed in INTEGER or HEX format"); - definitionwarn("Value not used - zero length taken"); - break; - case ATTR_VR_US: - definitionwarn("Attribute US Value should be expressed in INTEGER or HEX format"); - definitionwarn("Value not used - zero length taken"); - break; - default: - definitionwarn("Attribute Value not expected"); - definitionwarn("Value not used - zero length taken"); - break; - } - - return value_ptr; -} - -static BASE_VALUE_CLASS* CreateValueFromHex(unsigned long hexValue, ATTR_VR_ENUM vr) -{ - BASE_VALUE_CLASS* value_ptr = NULL; - - switch (vr) - { - case ATTR_VR_AT: - { - UINT32 data = (UINT32) hexValue; - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - case ATTR_VR_US: - { - UINT16 data = (UINT16) hexValue; - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - case ATTR_VR_UL: - { - UINT32 data = (UINT32) hexValue; - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - case ATTR_VR_SL: - case ATTR_VR_SS: - definitionwarn("Attribute SL/SS Value should be expressed in INTEGER format", false); - definitionwarn("Value not used - zero length taken", false); - break; - default: - definitionwarn("Attribute Value should be expressed in STRING format", false); - definitionwarn("Value not used - zero length taken", false); - break; - } - - return value_ptr; -} - -static BASE_VALUE_CLASS* CreateValueFromInt(int intValue, ATTR_VR_ENUM vr) -{ - BASE_VALUE_CLASS* value_ptr = NULL; - - switch (vr) { - case ATTR_VR_SS: - { - INT16 data = (INT16) intValue; - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - case ATTR_VR_SL: - { - INT32 data = (INT32) intValue; - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - case ATTR_VR_US: - { - UINT16 data = (UINT16) intValue; - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - case ATTR_VR_UL: - { - UINT32 data = (UINT32) intValue; - value_ptr = CreateNewValue(vr); - value_ptr->Set(data); - } - break; - default: - definitionwarn("Attribute Value should be expressed in STRING format", false); - definitionwarn("Value not used - zero length taken", false); - break; - } - - return value_ptr; -} - -static void CreateVMFromString(NAME_STRING vmstring, DEF_ATTRIBUTE_CLASS* attr_ptr) -{ - string vm = vmstring; - string upper_vm = "0"; - string lower_vm = "0"; - string::size_type pos = 0; - - // check presence of ':' - pos = vm.find(":"); - if (pos != string::npos) - { - lower_vm = vm.substr(0, pos); - upper_vm = vm.substr(pos+1); - - // only allow single integers in lower vm - if ((pos = lower_vm.find_first_of("0123456789")) == string::npos || - lower_vm.length() == 0 || - lower_vm.length() > 1 ) - { - definitionwarn("Illegal Attribute VM, Only single integers for lower VM allowed", false); - } - else - { - attr_ptr->SetVmMin( atoi(lower_vm.c_str()) ); - } - - // check whether upper vm is symmetric with lower vm - if (upper_vm.substr(0,1) != lower_vm) - { - definitionwarn("Illegal Attribute VM, lower vm and upper vm should be symmetric", false); - } - //only allow 1n, 2n, 3n in upper vm - if (upper_vm == "1n") - { - attr_ptr->SetVmMax((UINT) MAXVM); - attr_ptr->SetVmRestriction(ATTR_VM_RESTRICT_NONE); - } - else if (upper_vm == "2n") - { - attr_ptr->SetVmMax((UINT) MAXVM); - attr_ptr->SetVmRestriction(ATTR_VM_RESTRICT_EVEN); - } - else if (upper_vm == "3n") - { - attr_ptr->SetVmMax((UINT) MAXVM); - attr_ptr->SetVmRestriction(ATTR_VM_RESTRICT_TRIPLE); - } - else - { - definitionwarn("Illegal Attribute VM, only 1n, 2n or 3n allowed for upper vm", false); - } - } - else - { - definitionwarn("Illegal Attribute VM, should contain ':' ", false); - } -} - -static void ResolveMacroReferences() -{ - for (UINT i = 0; i < groups_with_refs.size(); i++) - { - for (UINT j = 0; j < macros.size(); j++) - { - string name = macros[j]->GetName(); - groups_with_refs[i]->ResolveMacroReference(name, macros[j]); - } - } -} - -static void ResetVariables() -{ - // Reset static variables for next definition file parsing - currentMetaSopClass_ptr = NULL; - currentSopClass_ptr = NULL; - currentDICOMObject_ptr = NULL; - currentCommand_ptr = NULL; - currentDataset_ptr = NULL; - currentAttributeGroup_ptr = NULL; - currentModule_ptr = NULL; - currentItem_ptr = NULL; - currentMacro_ptr = NULL; - currentAttribute_ptr = NULL; - currentValueListIndex = 0; - currentValue_ptr = NULL; - currentCondition_ptr = NULL; - condition_node_ptr = NULL; - node_left_ptr = NULL; - node_right_ptr = NULL; - - lsystemname[0] = '\0'; - lsystemversion[0] = '\0'; - lAEname[0] = '\0'; - lAEversion[0] = '\0'; - lMetaSOPClassUID[0] = '\0'; - lMetaSOPClassName[0] = '\0'; - lSOPClassUID[0] = '\0'; - lSOPClassName[0] = '\0'; - lIodName[0] = '\0'; - lModuleName[0] = '\0'; - - // clear stacks and references - for (UINT i = 0; i < groups.size(); i++) - { - groups.pop(); - } - - for (UINT i = 0; i < attributes.size(); i++) - { - attributes.pop(); - } - - groups_with_refs.clear(); - macros.clear(); - - definitionfilename.empty(); - definitionnewfile = false; - - definitionParseOnly = false; - skipDefinition = false; -} - -void resetDefinitionParser() -{ - ResetVariables(); -} \ No newline at end of file diff --git a/DVTk_Library/Source/Libraries/Definition/definition_parse.cpp.h b/DVTk_Library/Source/Libraries/Definition/definition_parse.cpp.h deleted file mode 100644 index 35f19bd..0000000 --- a/DVTk_Library/Source/Libraries/Definition/definition_parse.cpp.h +++ /dev/null @@ -1,51 +0,0 @@ -typedef union { - bool boolean; - DIMSE_CMD_ENUM commandField; - unsigned long hex; - int integer; - NAME_STRING string; - ATTR_TYPE_ENUM type; - MOD_USAGE_ENUM usage; - ATTR_VAL_TYPE_ENUM valueType; - ATTR_VR_ENUM vr; - CONDITION_NODE_CLASS* node_ptr; - CONDITION_UNARY_NODE_CLASS* unary_node_ptr; - CONDITION_BINARY_NODE_CLASS* binary_node_ptr; -} YYSTYPE; -#define T_SYSTEM 258 -#define T_DEFINE 259 -#define T_ENDDEFINE 260 -#define T_METASOPCLASS 261 -#define T_SOPCLASS 262 -#define T_MODULE 263 -#define T_ITEM 264 -#define T_MACRO 265 -#define T_INCLUDEITEM 266 -#define T_INCLUDEMACRO 267 -#define T_SQ 268 -#define T_AND 269 -#define T_OR 270 -#define T_NOT 271 -#define T_PRESENT 272 -#define T_VALUE 273 -#define T_EMPTY 274 -#define T_TRUE 275 -#define T_FALSE 276 -#define T_EQUAL 277 -#define T_LESS 278 -#define T_GREATER 279 -#define T_LESS_OR_EQUAL 280 -#define T_GREATER_OR_EQUAL 281 -#define T_WEAK 282 -#define T_WARN 283 -#define STRING 284 -#define INTEGER 285 -#define HEX 286 -#define COMMANDFIELD 287 -#define TYPE 288 -#define USAGE 289 -#define VALUETYPE 290 -#define VR 291 - - -extern YYSTYPE definitionlval; diff --git a/DVTk_Library/Source/Libraries/Emulator/imagedisplay_parse.cpp b/DVTk_Library/Source/Libraries/Emulator/imagedisplay_parse.cpp deleted file mode 100644 index 8592738..0000000 --- a/DVTk_Library/Source/Libraries/Emulator/imagedisplay_parse.cpp +++ /dev/null @@ -1,890 +0,0 @@ - -/* A Bison parser, made from imagedisplay_parse.y with Bison version GNU Bison version 1.24 - */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define T_SYSTEM 258 -#define T_DEFINE 259 -#define T_ENDDEFINE 260 -#define T_IMAGEDISPLAYFORMAT 261 -#define T_ANNOTATIONDISPLAYFORMATID 262 -#define STRING 263 -#define INTEGER 264 - -#line 1 "imagedisplay_parse.y" - -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright © 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -/* - * A parser for the imagedisplay files - */ - -#include - -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "print.h" - -// flex / bison error and warning functions -extern void imagedisplayerror(char* msg); -extern void imagedisplaywarn(char* msg); -extern int imagedisplaylex(void); - - -#line 23 "imagedisplay_parse.y" -typedef union { - int integer; - NAME_STRING string; -} YYSTYPE; - -#ifndef YYLTYPE -typedef - struct yyltype - { - int timestamp; - int first_line; - int first_column; - int last_line; - int last_column; - char *text; - } - yyltype; - -#define YYLTYPE yyltype -#endif - -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 27 -#define YYFLAG -32768 -#define YYNTBASE 10 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 264 ? yytranslate[x] : 21) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 7, 8, 9 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 7, 9, 11, 13, 17, 19, 21, - 25, 28, 31, 35 -}; - -static const short yyrhs[] = { 11, - 0, 12, 0, 11, 12, 0, 13, 0, 19, 0, - 20, 0, 14, 16, 15, 0, 4, 0, 5, 0, - 3, 17, 18, 0, 8, 8, 0, 8, 8, 0, - 6, 8, 9, 0, 7, 8, 9, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 35, 38, 39, 42, 43, 44, 47, 50, 53, 56, - 59, 64, 69, 75 -}; - -static const char * const yytname[] = { "$","error","$undefined.","T_SYSTEM", -"T_DEFINE","T_ENDDEFINE","T_IMAGEDISPLAYFORMAT","T_ANNOTATIONDISPLAYFORMATID", -"STRING","INTEGER","DefinitionGrammar","DefinitionComponents","DefinitionChoice", -"Definition","BeginDefine","EndDefine","SystemDef","SystemDefinition","AEDefinition", -"ImageDisplayFormatDef","AnnotationDisplayFormatIDDef","" -}; -#endif - -static const short imagedisplayr1[] = { 0, - 10, 11, 11, 12, 12, 12, 13, 14, 15, 16, - 17, 18, 19, 20 -}; - -static const short imagedisplayr2[] = { 0, - 1, 1, 2, 1, 1, 1, 3, 1, 1, 3, - 2, 2, 3, 3 -}; - -static const short imagedisplaydefact[] = { 0, - 8, 0, 0, 1, 2, 4, 0, 5, 6, 0, - 0, 3, 0, 0, 13, 14, 0, 0, 9, 7, - 11, 0, 10, 12, 0, 0, 0 -}; - -static const short imagedisplaydefgoto[] = { 25, - 4, 5, 6, 7, 20, 14, 18, 23, 8, 9 -}; - -static const short imagedisplaypact[] = { -4, --32768, -7, -3, -4,-32768,-32768, 1,-32768,-32768, -2, - -1,-32768, 2, 4,-32768,-32768, 3, 5,-32768,-32768, --32768, 6,-32768,-32768, 12, 15,-32768 -}; - -static const short imagedisplaypgoto[] = {-32768, --32768, 13,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768 -}; - - -#define YYLAST 17 - - -static const short yytable[] = { 1, - 10, 2, 3, 13, 11, 0, 15, 16, 19, 17, - 21, 26, 22, 24, 27, 0, 12 -}; - -static const short yycheck[] = { 4, - 8, 6, 7, 3, 8, -1, 9, 9, 5, 8, - 8, 0, 8, 8, 0, -1, 4 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "bison.simple" - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -#ifndef alloca -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) -#include -#else /* not sparc */ -#if defined (MSDOS) && !defined (__TURBOC__) -#include -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -#include - #pragma alloca -#else /* not MSDOS, __TURBOC__, or _AIX */ -#ifdef __hpux -#ifdef __cplusplus -extern "C" { -void *alloca (unsigned int); -}; -#else /* not __cplusplus */ -void *alloca (); -#endif /* not __cplusplus */ -#endif /* __hpux */ -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc. */ -#endif /* not GNU C. */ -#endif /* alloca not defined. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define imagedisplayerrok (yyerrstatus = 0) -#define imagedisplayclearin (imagedisplaychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto imagedisplayerrlab1 -/* Like YYERROR except do call imagedisplayerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto imagedisplayerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (imagedisplaychar == YYEMPTY && yylen == 1) \ - { imagedisplaychar = (token), imagedisplaylval = (value); \ - imagedisplaychar1 = YYTRANSLATE (imagedisplaychar); \ - YYPOPSTACK; \ - goto imagedisplaybackup; \ - } \ - else \ - { imagedisplayerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX imagedisplaylex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX imagedisplaylex(&imagedisplaylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX imagedisplaylex(&imagedisplaylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX imagedisplaylex(&imagedisplaylval, YYLEX_PARAM) -#else -#define YYLEX imagedisplaylex(&imagedisplaylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int imagedisplaychar; /* the lookahead symbol */ -YYSTYPE imagedisplaylval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int imagedisplaynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int imagedisplaydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -int imagedisplayparse (void); -#endif - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (from, to, count) - char *from; - char *to; - int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *from, char *to, int count) -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 192 "bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into imagedisplayparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#else -#define YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#endif - -int -imagedisplayparse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL -{ - register int imagedisplaystate; - register int yyn; - register short *imagedisplayssp; - register YYSTYPE *imagedisplayvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int imagedisplaychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short imagedisplayssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE imagedisplayvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *imagedisplayss = imagedisplayssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *imagedisplayvs = imagedisplayvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *imagedisplaylsp; - -#define YYPOPSTACK (imagedisplayvsp--, imagedisplayssp--, imagedisplaylsp--) -#else -#define YYPOPSTACK (imagedisplayvsp--, imagedisplayssp--) -#endif - - int imagedisplaystacksize = YYINITDEPTH; - -#ifdef YYPURE - int imagedisplaychar; - YYSTYPE imagedisplaylval; - int imagedisplaynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE imagedisplayval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (imagedisplaydebug) - fprintf(stderr, "Starting parse\n"); -#endif - - imagedisplaystate = 0; - yyerrstatus = 0; - imagedisplaynerrs = 0; - imagedisplaychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - imagedisplayssp = imagedisplayss - 1; - imagedisplayvsp = imagedisplayvs; -#ifdef YYLSP_NEEDED - imagedisplaylsp = yyls; -#endif - -/* Push a new state, which is found in imagedisplaystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++imagedisplayssp = imagedisplaystate; - - if (imagedisplayssp >= imagedisplayss + imagedisplaystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *imagedisplayvs1 = imagedisplayvs; - short *imagedisplayss1 = imagedisplayss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = imagedisplayssp - imagedisplayss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &imagedisplayss1, size * sizeof (*imagedisplayssp), - &imagedisplayvs1, size * sizeof (*imagedisplayvsp), - &yyls1, size * sizeof (*imagedisplaylsp), - &imagedisplaystacksize); -#else - yyoverflow("parser stack overflow", - &imagedisplayss1, size * sizeof (*imagedisplayssp), - &imagedisplayvs1, size * sizeof (*imagedisplayvsp), - &imagedisplaystacksize); -#endif - - imagedisplayss = imagedisplayss1; imagedisplayvs = imagedisplayvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (imagedisplaystacksize >= YYMAXDEPTH) - { - imagedisplayerror("parser stack overflow"); - return 2; - } - imagedisplaystacksize *= 2; - if (imagedisplaystacksize > YYMAXDEPTH) - imagedisplaystacksize = YYMAXDEPTH; - imagedisplayss = (short *) alloca (imagedisplaystacksize * sizeof (*imagedisplayssp)); - __yy_memcpy ((char *)imagedisplayss1, (char *)imagedisplayss, size * sizeof (*imagedisplayssp)); - imagedisplayvs = (YYSTYPE *) alloca (imagedisplaystacksize * sizeof (*imagedisplayvsp)); - __yy_memcpy ((char *)imagedisplayvs1, (char *)imagedisplayvs, size * sizeof (*imagedisplayvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (imagedisplaystacksize * sizeof (*imagedisplaylsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*imagedisplaylsp)); -#endif -#endif /* no yyoverflow */ - - imagedisplayssp = imagedisplayss + size - 1; - imagedisplayvsp = imagedisplayvs + size - 1; -#ifdef YYLSP_NEEDED - imagedisplaylsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (imagedisplaydebug) - fprintf(stderr, "Stack size increased to %d\n", imagedisplaystacksize); -#endif - - if (imagedisplayssp >= imagedisplayss + imagedisplaystacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (imagedisplaydebug) - fprintf(stderr, "Entering state %d\n", imagedisplaystate); -#endif - - goto imagedisplaybackup; - imagedisplaybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = imagedisplaypact[imagedisplaystate]; - if (yyn == YYFLAG) - goto imagedisplaydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* imagedisplaychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (imagedisplaychar == YYEMPTY) - { -#if YYDEBUG != 0 - if (imagedisplaydebug) - fprintf(stderr, "Reading a token: "); -#endif - imagedisplaychar = YYLEX; - } - - /* Convert token to internal form (in imagedisplaychar1) for indexing tables with */ - - if (imagedisplaychar <= 0) /* This means end of input. */ - { - imagedisplaychar1 = 0; - imagedisplaychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (imagedisplaydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - imagedisplaychar1 = YYTRANSLATE(imagedisplaychar); - -#if YYDEBUG != 0 - if (imagedisplaydebug) - { - fprintf (stderr, "Next token is %d (%s", imagedisplaychar, yytname[imagedisplaychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, imagedisplaychar, imagedisplaylval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += imagedisplaychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != imagedisplaychar1) - goto imagedisplaydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto imagedisplayerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto imagedisplayerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (imagedisplaydebug) - fprintf(stderr, "Shifting token %d (%s), ", imagedisplaychar, yytname[imagedisplaychar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (imagedisplaychar != YYEOF) - imagedisplaychar = YYEMPTY; - - *++imagedisplayvsp = imagedisplaylval; -#ifdef YYLSP_NEEDED - *++imagedisplaylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - imagedisplaystate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -imagedisplaydefault: - - yyn = imagedisplaydefact[imagedisplaystate]; - if (yyn == 0) - goto imagedisplayerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = imagedisplayr2[yyn]; - if (yylen > 0) - imagedisplayval = imagedisplayvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (imagedisplaydebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[imagedisplayr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 11: -#line 60 "imagedisplay_parse.y" -{ - ; - break;} -case 12: -#line 65 "imagedisplay_parse.y" -{ - ; - break;} -case 13: -#line 70 "imagedisplay_parse.y" -{ - MYPRINTER->addImageDisplayFormat(imagedisplayvsp[-1].string, imagedisplayvsp[0].integer); - ; - break;} -case 14: -#line 76 "imagedisplay_parse.y" -{ - MYPRINTER->addAnnotationDisplayFormatId(imagedisplayvsp[-1].string, imagedisplayvsp[0].integer); - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "bison.simple" - - imagedisplayvsp -= yylen; - imagedisplayssp -= yylen; -#ifdef YYLSP_NEEDED - imagedisplaylsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (imagedisplaydebug) - { - short *ssp1 = imagedisplayss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != imagedisplayssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++imagedisplayvsp = imagedisplayval; - -#ifdef YYLSP_NEEDED - imagedisplaylsp++; - if (yylen == 0) - { - imagedisplaylsp->first_line = yylloc.first_line; - imagedisplaylsp->first_column = yylloc.first_column; - imagedisplaylsp->last_line = (imagedisplaylsp-1)->last_line; - imagedisplaylsp->last_column = (imagedisplaylsp-1)->last_column; - imagedisplaylsp->text = 0; - } - else - { - imagedisplaylsp->last_line = (imagedisplaylsp+yylen-1)->last_line; - imagedisplaylsp->last_column = (imagedisplaylsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = imagedisplayr1[yyn]; - - imagedisplaystate = imagedisplaypgoto[yyn - YYNTBASE] + *imagedisplayssp; - if (imagedisplaystate >= 0 && imagedisplaystate <= YYLAST && yycheck[imagedisplaystate] == *imagedisplayssp) - imagedisplaystate = yytable[imagedisplaystate]; - else - imagedisplaystate = imagedisplaydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -imagedisplayerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++imagedisplaynerrs; - -#ifdef YYERROR_VERBOSE - yyn = imagedisplaypact[imagedisplaystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - imagedisplayerror(msg); - free(msg); - } - else - imagedisplayerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - imagedisplayerror("parse error"); - } - - goto imagedisplayerrlab1; -imagedisplayerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (imagedisplaychar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (imagedisplaydebug) - fprintf(stderr, "Discarding token %d (%s).\n", imagedisplaychar, yytname[imagedisplaychar1]); -#endif - - imagedisplaychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = imagedisplaydefact[imagedisplaystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto imagedisplaydefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (imagedisplayssp == imagedisplayss) YYABORT; - imagedisplayvsp--; - imagedisplaystate = *--imagedisplayssp; -#ifdef YYLSP_NEEDED - imagedisplaylsp--; -#endif - -#if YYDEBUG != 0 - if (imagedisplaydebug) - { - short *ssp1 = imagedisplayss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != imagedisplayssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = imagedisplaypact[imagedisplaystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (imagedisplaydebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++imagedisplayvsp = imagedisplaylval; -#ifdef YYLSP_NEEDED - *++imagedisplaylsp = yylloc; -#endif - - imagedisplaystate = yyn; - goto yynewstate; -} -#line 80 "imagedisplay_parse.y" - diff --git a/DVTk_Library/Source/Libraries/Emulator/imagedisplay_parse.cpp.h b/DVTk_Library/Source/Libraries/Emulator/imagedisplay_parse.cpp.h deleted file mode 100644 index 3de4301..0000000 --- a/DVTk_Library/Source/Libraries/Emulator/imagedisplay_parse.cpp.h +++ /dev/null @@ -1,14 +0,0 @@ -typedef union { - int integer; - NAME_STRING string; -} YYSTYPE; -#define T_SYSTEM 258 -#define T_DEFINE 259 -#define T_ENDDEFINE 260 -#define T_IMAGEDISPLAYFORMAT 261 -#define T_ANNOTATIONDISPLAYFORMATID 262 -#define STRING 263 -#define INTEGER 264 - - -extern YYSTYPE imagedisplaylval; diff --git a/DVTk_Library/Source/Libraries/Scripting/script_parser.cpp b/DVTk_Library/Source/Libraries/Scripting/script_parser.cpp deleted file mode 100644 index 67f1ee1..0000000 --- a/DVTk_Library/Source/Libraries/Scripting/script_parser.cpp +++ /dev/null @@ -1,5668 +0,0 @@ - -/* A Bison parser, made from script_parser.y with Bison version GNU Bison version 1.24 - */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define T_LANGUAGE 258 -#define T_RESET 259 -#define T_ALL 260 -#define T_WAREHOUSE 261 -#define T_ASSOCIATION 262 -#define T_RELATION 263 -#define T_EXECUTION_CONTEXT 264 -#define T_COMPARE 265 -#define T_COMPARE_NOT 266 -#define T_CONFIRM 267 -#define T_COPY 268 -#define T_CREATE 269 -#define T_DELAY 270 -#define T_DELETE 271 -#define T_DISPLAY 272 -#define T_ECHO 273 -#define T_POPULATE 274 -#define T_READ 275 -#define T_RECEIVE 276 -#define T_ROLE 277 -#define T_SEND 278 -#define T_SET 279 -#define T_SYSTEM 280 -#define T_TIME 281 -#define T_VALIDATE 282 -#define T_VERBOSE 283 -#define T_WRITE 284 -#define T_IMPORT 285 -#define T_EXPORT 286 -#define T_VALIDATION 287 -#define T_DEF_SQ_LENGTH 288 -#define T_ADD_GROUP_LENGTH 289 -#define T_STRICT 290 -#define T_APPL_ENTITY 291 -#define T_ASSOCIATE_RQ 292 -#define T_ASSOCIATE_AC 293 -#define T_ASSOCIATE_RJ 294 -#define T_RELEASE_RQ 295 -#define T_RELEASE_RP 296 -#define T_ABORT_RQ 297 -#define T_PROT_VER 298 -#define T_CALLED_AE 299 -#define T_CALLING_AE 300 -#define T_APPL_CTX 301 -#define T_PRES_CTX 302 -#define T_MAX_LEN 303 -#define T_IMPL_CLASS 304 -#define T_IMPL_VER 305 -#define T_SOP_EXTEND_NEG 306 -#define T_SCPSCU_ROLE 307 -#define T_ASYNC_WINDOW 308 -#define T_USER_ID_NEG 309 -#define T_RESULT 310 -#define T_SOURCE 311 -#define T_REASON 312 -#define T_DEFINED_LENGTH 313 -#define T_AUTOSET 314 -#define T_FILEHEAD 315 -#define T_FILETAIL 316 -#define T_FILE_PREAMBLE 317 -#define T_DICOM_PREFIX 318 -#define T_TRANSFER_SYNTAX 319 -#define T_DATASET_TRAILING_PADDING 320 -#define T_SECTOR_SIZE 321 -#define T_PADDING_VALUE 322 -#define T_SQ 323 -#define T_OPEN_BRACKET 324 -#define T_CLOSE_BRACKET 325 -#define T_YES 326 -#define T_NO 327 -#define T_ON 328 -#define T_OFF 329 -#define T_OR 330 -#define T_AND 331 -#define COMMANDFIELD 332 -#define HEXADECIMAL 333 -#define IDENTIFIER 334 -#define INTEGER 335 -#define VALIDATIONFLAG 336 -#define IOMLEVEL 337 -#define STRING 338 -#define USERPROVIDER 339 -#define VR 340 - -#line 1 "script_parser.y" - -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright � 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -//***************************************************************************** -// DESCRIPTION : Script Parser -//***************************************************************************** - -//***************************************************************************** -// EXTERNAL DECLARATIONS -//***************************************************************************** -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Logger component interface -#include "Idefinition.h" // Definition component interface -#include "Idicom.h" // Dicom component interface -#include "Imedia.h" // Media File component interface -#include "Isession.h" // Test Session component interface - -#ifdef _WINDOWS -#include -#else -#include -#include -#endif - -#define UNDEFINED_SCU_ROLE 256 // undefined SCU role - from VTS -#define UNDEFINED_SCP_ROLE 256 // undefined SCP role - from VTS - -#define MAX_ND 100 // maximum nesting depth - -extern void scripterror(char*); -extern int scriptlex(void); -extern int scriptlineno; - -extern SCRIPT_SESSION_CLASS *scriptSession_ptr; - -typedef enum -{ - OPERAND_OR, - OPERAND_AND -} OPERAND_ENUM; - - -bool scriptIsNativeVts = false; -char scriptCurrentFilename[_MAX_PATH] = {" (not defined) "}; -long scriptCurrentFileOffset = 0; -long scriptCurrentLineNo = 0; -bool scriptParseOnly = false; - -//***************************************************************************** -// LOCAL DEFINITIONS -//***************************************************************************** -// local variables - unfortunately these structures are needed for YACC / LEX -static DIMSE_CMD_ENUM commandField; -static DCM_VALUE_SQ_CLASS *sq_ptr[MAX_ND]; -static DCM_ITEM_CLASS *item_ptr[MAX_ND]; -static DCM_ATTRIBUTE_CLASS *attribute_ptr[MAX_ND]; -static BASE_VALUE_CLASS *value_ptr = NULL; - -static string identifier; -static string datasetidentifier; -static string iodName; -static UINT16 group, group1, group2; -static UINT16 element, element1, element2; -static ATTR_VR_ENUM vr; -static bool definedLength; -static TRANSFER_ATTR_VR_ENUM transferVr; -static bool assocAcScuScpRolesDefined = false; -static UINT itemNumber = 0; - -static PRESENTATION_CONTEXT_RQ_CLASS presRqContext; -static PRESENTATION_CONTEXT_AC_CLASS presAcContext; -static BYTE presContextId = 0; -static TRANSFER_SYNTAX_NAME_CLASS transferSyntaxName; -static USER_INFORMATION_CLASS userInformation; -static SOP_CLASS_EXTENDED_CLASS sopClassExtended; -static SCP_SCU_ROLE_SELECT_CLASS scpScuRoleSelect; - - -static DCM_COMMAND_CLASS *command_ptr = NULL; -static DCM_COMMAND_CLASS *ref_command_ptr = NULL; -static DCM_DATASET_CLASS *dataset_ptr = NULL; -static DCM_DATASET_CLASS *ref_dataset_ptr = NULL; -static ITEM_HANDLE_CLASS *item_handle_ptr = NULL; -static BASE_WAREHOUSE_ITEM_DATA_CLASS *wid1_ptr = NULL, *wid2_ptr = NULL; -static FILEHEAD_CLASS *fileHead_ptr = NULL; -static FILETAIL_CLASS *fileTail_ptr = NULL; - -static BYTE acseType; -static ASSOCIATE_RQ_CLASS *associateRq_ptr = NULL; -static ASSOCIATE_AC_CLASS *associateAc_ptr = NULL; -static ASSOCIATE_RJ_CLASS *associateRj_ptr = NULL; -static RELEASE_RQ_CLASS *releaseRq_ptr = NULL; -static RELEASE_RP_CLASS *releaseRp_ptr = NULL; -static ABORT_RQ_CLASS *abortRq_ptr = NULL; -static UNKNOWN_PDU_CLASS *unknownPdu_ptr = NULL; - -static int nd = 0; // nesting depth - -extern bool compareDatasetValueWithWarehouse(LOG_CLASS*, const char*, DCM_DATASET_CLASS*); -extern bool storeObjectInWarehouse(LOG_CLASS*, const char*, BASE_WAREHOUSE_ITEM_DATA_CLASS*); -extern bool updateObjectInWarehouse(LOG_CLASS*, const char*, BASE_WAREHOUSE_ITEM_DATA_CLASS*); -extern bool removeObjectFromWarehouse(LOG_CLASS*, const char*, WID_ENUM); -extern BASE_WAREHOUSE_ITEM_DATA_CLASS *retrieveFromWarehouse(LOG_CLASS*, const char*, WID_ENUM); - -extern bool displayAttribute(LOG_CLASS*, BASE_SERIALIZER*, BASE_WAREHOUSE_ITEM_DATA_CLASS*, UINT16, UINT16); -extern bool compareAttributes(LOG_CLASS*, BASE_WAREHOUSE_ITEM_DATA_CLASS*, UINT16, UINT16, BASE_WAREHOUSE_ITEM_DATA_CLASS*, UINT16, UINT16); -extern bool copyAttribute(LOG_CLASS*, BASE_WAREHOUSE_ITEM_DATA_CLASS*, UINT16, UINT16, BASE_WAREHOUSE_ITEM_DATA_CLASS*, UINT16, UINT16); - -extern bool readFileDataset(SCRIPT_SESSION_CLASS *session_ptr, string, DCM_DATASET_CLASS*); -extern bool readFileDataset(SCRIPT_SESSION_CLASS *session_ptr, string, UINT32); - -extern bool writeFileHead(LOG_CLASS*, string, bool); -extern bool writeFileTail(LOG_CLASS*, string, bool); -extern bool writeFileDataset(LOG_CLASS*, string, DCM_DATASET_CLASS*, bool); - -extern bool receiveAcse(SCRIPT_SESSION_CLASS*, ASSOCIATE_RQ_CLASS*, string); -extern bool receiveAcse(SCRIPT_SESSION_CLASS*, ASSOCIATE_AC_CLASS*, string); -extern bool receiveAcse(SCRIPT_SESSION_CLASS*, ASSOCIATE_RJ_CLASS*, string); -extern bool receiveAcse(SCRIPT_SESSION_CLASS*, RELEASE_RQ_CLASS*, string); -extern bool receiveAcse(SCRIPT_SESSION_CLASS*, RELEASE_RP_CLASS*, string); -extern bool receiveAcse(SCRIPT_SESSION_CLASS*, ABORT_RQ_CLASS*, string); -extern bool receiveAcse(SCRIPT_SESSION_CLASS*, UNKNOWN_PDU_CLASS*, string); -extern bool receiveSop(SCRIPT_SESSION_CLASS*, DCM_COMMAND_CLASS*, DCM_DATASET_CLASS*); - -extern bool importCommand(SCRIPT_SESSION_CLASS*, DIMSE_CMD_ENUM, string); -extern bool importCommandDataset(SCRIPT_SESSION_CLASS*, DIMSE_CMD_ENUM, string, string, string); - -extern bool sendAcse(SCRIPT_SESSION_CLASS*, ASSOCIATE_RQ_CLASS*, string); -extern bool sendAcse(SCRIPT_SESSION_CLASS*, ASSOCIATE_AC_CLASS*, string); -extern bool sendAcse(SCRIPT_SESSION_CLASS*, ASSOCIATE_RJ_CLASS*, string); -extern bool sendAcse(SCRIPT_SESSION_CLASS*, RELEASE_RQ_CLASS*, string); -extern bool sendAcse(SCRIPT_SESSION_CLASS*, RELEASE_RP_CLASS*, string); -extern bool sendAcse(SCRIPT_SESSION_CLASS*, ABORT_RQ_CLASS*, string); -extern bool sendAcse(SCRIPT_SESSION_CLASS*, UNKNOWN_PDU_CLASS*, string); -extern bool sendSop(SCRIPT_SESSION_CLASS*, DCM_COMMAND_CLASS*, DCM_DATASET_CLASS*); - -extern bool validateSopAgainstList(SCRIPT_SESSION_CLASS*, DCM_COMMAND_CLASS*, DCM_DATASET_CLASS*); -extern void setLogicalOperand(OPERAND_ENUM); -extern void addReferenceObjects(SCRIPT_SESSION_CLASS*, DCM_COMMAND_CLASS*, DCM_DATASET_CLASS*, LOG_CLASS*); -extern void clearValidationObjects(SCRIPT_SESSION_CLASS*); - -extern bool systemCall(SCRIPT_SESSION_CLASS*, char*); - -extern BASE_VALUE_CLASS *stringValue(SCRIPT_SESSION_CLASS*, char*, ATTR_VR_ENUM, UINT16, UINT16); -extern BASE_VALUE_CLASS *byteArrayValue(char*); -extern BASE_VALUE_CLASS *hexValue(SCRIPT_SESSION_CLASS*, unsigned long, ATTR_VR_ENUM, UINT16, UINT16); -extern BASE_VALUE_CLASS *integerValue(SCRIPT_SESSION_CLASS*, int, ATTR_VR_ENUM, UINT16, UINT16); -extern BASE_VALUE_CLASS *autoSetValue(SCRIPT_SESSION_CLASS*, ATTR_VR_ENUM, UINT16, UINT16); - -//The following may only be called for native VTS scripts!!! -extern void resolveVTSUidMappings(DCM_ATTRIBUTE_GROUP_CLASS*); -extern void clearVTSUidMappings(void); - - -#line 178 "script_parser.y" -typedef union { - DIMSE_CMD_ENUM commandField; - unsigned long hex; - char identifier[MAX_ID_LEN]; - int integer; - IOM_LEVEL_ENUM iomLevel; - char *string_ptr; -// char string[MAX_STRING_LEN]; - UP_ENUM userProvider; - ATTR_VR_ENUM vr; - VALIDATION_CONTROL_FLAG_ENUM validationFlag; -} YYSTYPE; - -#ifndef YYLTYPE -typedef - struct yyltype - { - int timestamp; - int first_line; - int first_column; - int last_line; - int last_column; - char *text; - } - yyltype; - -#define YYLTYPE yyltype -#endif - -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 507 -#define YYFLAG -32768 -#define YYNTBASE 91 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 340 ? yytranslate[x] : 236) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 86, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 89, 90, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 87, 2, 88, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 1, 3, 5, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 67, 70, 73, 76, 79, 82, 88, - 94, 96, 102, 105, 108, 111, 113, 116, 119, 122, - 125, 127, 129, 131, 133, 135, 137, 139, 141, 144, - 149, 156, 159, 162, 167, 170, 173, 176, 179, 182, - 185, 188, 191, 193, 196, 199, 202, 205, 209, 212, - 215, 218, 221, 224, 227, 230, 232, 234, 236, 239, - 242, 244, 246, 248, 250, 252, 254, 256, 260, 263, - 266, 269, 271, 273, 275, 277, 281, 285, 289, 291, - 293, 295, 297, 299, 302, 305, 310, 311, 313, 317, - 320, 325, 326, 328, 332, 336, 339, 342, 345, 347, - 349, 351, 353, 355, 357, 359, 361, 363, 365, 367, - 369, 371, 376, 378, 381, 384, 387, 390, 393, 396, - 399, 402, 405, 408, 411, 415, 418, 420, 423, 427, - 429, 431, 437, 449, 451, 455, 457, 459, 462, 468, - 470, 474, 476, 478, 481, 489, 493, 498, 500, 502, - 507, 509, 512, 515, 518, 521, 524, 527, 530, 533, - 536, 539, 542, 546, 548, 551, 555, 557, 559, 566, - 567, 570, 579, 580, 587, 589, 594, 596, 599, 602, - 605, 608, 610, 612, 614, 619, 621, 624, 627, 630, - 632, 634, 636, 638, 640, 642, 644, 647, 649, 652, - 654, 658, 663, 665, 668, 670, 672, 674, 676, 680, - 685, 687, 689, 692, 694, 697, 699, 701, 703, 705, - 707, 710, 716, 720, 722, 724, 726, 728, 732, 734, - 738, 740, 742, 744, 748, 750, 752, 756, 757, 759, - 761, 764, 767, 770, 771, 774, 776, 780, 784, 790, - 795, 802, 803, 805, 807, 811, 813, 815, 817, 819, - 821, 823, 825, 827, 829, 831, 833, 835, 841, 847, - 848, 852, 854, 859, 861, 863, 866, 868, 870, 872, - 875, 878, 881, 883, 888, 890, 892, 895, 897, 899, - 901, 904, 907, 910 -}; - -static const short yyrhs[] = { -1, - 92, 0, 93, 0, 92, 93, 0, 94, 0, 95, - 0, 96, 0, 97, 0, 98, 0, 99, 0, 100, - 0, 101, 0, 102, 0, 103, 0, 104, 0, 108, - 0, 110, 0, 111, 0, 112, 0, 113, 0, 114, - 0, 115, 0, 116, 0, 117, 0, 118, 0, 119, - 0, 120, 0, 121, 0, 122, 0, 123, 0, 124, - 0, 125, 0, 3, 83, 0, 4, 5, 0, 4, - 6, 0, 4, 7, 0, 4, 8, 0, 4, 9, - 0, 10, 218, 215, 219, 216, 0, 11, 218, 215, - 219, 216, 0, 12, 0, 13, 218, 215, 219, 216, - 0, 14, 126, 0, 15, 80, 0, 16, 127, 0, - 128, 0, 17, 218, 0, 17, 6, 0, 18, 83, - 0, 31, 105, 0, 106, 0, 107, 0, 175, 0, - 176, 0, 177, 0, 178, 0, 179, 0, 180, 0, - 185, 186, 0, 185, 186, 191, 194, 0, 185, 186, - 191, 194, 47, 132, 0, 30, 109, 0, 185, 186, - 0, 185, 186, 191, 194, 0, 19, 73, 0, 19, - 74, 0, 20, 129, 0, 21, 130, 0, 22, 84, - 0, 23, 131, 0, 24, 133, 0, 25, 83, 0, - 26, 0, 27, 134, 0, 28, 73, 0, 28, 74, - 0, 29, 139, 0, 36, 83, 83, 0, 32, 81, - 0, 33, 73, 0, 33, 74, 0, 34, 73, 0, - 34, 74, 0, 35, 73, 0, 35, 74, 0, 140, - 0, 181, 0, 190, 0, 190, 58, 0, 220, 190, - 0, 223, 0, 230, 0, 140, 0, 184, 0, 190, - 0, 60, 0, 61, 0, 17, 218, 217, 0, 128, - 217, 0, 83, 190, 0, 83, 78, 0, 141, 0, - 138, 0, 141, 0, 182, 0, 182, 47, 132, 0, - 69, 78, 70, 0, 69, 80, 70, 0, 141, 0, - 183, 0, 188, 0, 222, 0, 229, 0, 135, 136, - 0, 185, 186, 0, 185, 186, 191, 194, 0, 0, - 137, 0, 136, 75, 137, 0, 185, 186, 0, 185, - 186, 191, 194, 0, 0, 182, 0, 138, 75, 182, - 0, 138, 76, 182, 0, 83, 60, 0, 83, 61, - 0, 83, 190, 0, 175, 0, 176, 0, 177, 0, - 178, 0, 179, 0, 180, 0, 142, 0, 158, 0, - 167, 0, 170, 0, 171, 0, 172, 0, 175, 0, - 175, 69, 143, 70, 0, 144, 0, 143, 144, 0, - 43, 80, 0, 44, 83, 0, 45, 83, 0, 46, - 83, 0, 47, 145, 0, 48, 80, 0, 49, 83, - 0, 50, 83, 0, 51, 151, 0, 52, 155, 0, - 53, 80, 80, 0, 54, 157, 0, 146, 0, 145, - 146, 0, 145, 86, 146, 0, 147, 0, 148, 0, - 69, 83, 86, 149, 70, 0, 69, 80, 86, 83, - 86, 80, 86, 80, 86, 149, 70, 0, 150, 0, - 149, 86, 150, 0, 83, 0, 152, 0, 151, 152, - 0, 69, 83, 86, 153, 70, 0, 154, 0, 153, - 86, 154, 0, 80, 0, 156, 0, 155, 156, 0, - 69, 83, 86, 80, 86, 80, 70, 0, 80, 80, - 83, 0, 80, 80, 83, 83, 0, 83, 0, 176, - 0, 176, 69, 159, 70, 0, 160, 0, 159, 160, - 0, 43, 80, 0, 44, 83, 0, 45, 83, 0, - 46, 83, 0, 47, 161, 0, 48, 80, 0, 49, - 83, 0, 50, 83, 0, 51, 151, 0, 52, 155, - 0, 53, 80, 80, 0, 162, 0, 161, 162, 0, - 161, 86, 162, 0, 163, 0, 165, 0, 69, 83, - 86, 80, 164, 70, 0, 0, 86, 150, 0, 69, - 80, 86, 80, 86, 83, 166, 70, 0, 0, 86, - 80, 86, 80, 86, 150, 0, 177, 0, 177, 69, - 168, 70, 0, 169, 0, 168, 169, 0, 55, 80, - 0, 56, 80, 0, 57, 80, 0, 178, 0, 179, - 0, 180, 0, 180, 69, 173, 70, 0, 174, 0, - 173, 174, 0, 56, 80, 0, 57, 80, 0, 37, - 0, 38, 0, 39, 0, 40, 0, 41, 0, 42, - 0, 184, 0, 184, 190, 0, 183, 0, 184, 188, - 0, 184, 0, 187, 69, 70, 0, 187, 69, 195, - 70, 0, 185, 0, 185, 186, 0, 77, 0, 79, - 0, 184, 0, 190, 0, 189, 69, 70, 0, 189, - 69, 195, 70, 0, 190, 0, 191, 0, 191, 194, - 0, 193, 0, 192, 193, 0, 82, 0, 83, 0, - 79, 0, 83, 0, 196, 0, 195, 196, 0, 69, - 197, 86, 199, 70, 0, 69, 217, 70, 0, 198, - 0, 78, 0, 200, 0, 209, 0, 201, 86, 202, - 0, 68, 0, 87, 68, 88, 0, 203, 0, 205, - 0, 204, 0, 203, 86, 204, 0, 83, 0, 206, - 0, 205, 86, 206, 0, 0, 207, 0, 208, 0, - 207, 208, 0, 89, 196, 0, 210, 212, 0, 0, - 211, 86, 0, 85, 0, 87, 85, 88, 0, 69, - 85, 70, 0, 69, 87, 85, 88, 70, 0, 69, - 85, 90, 70, 0, 69, 87, 85, 88, 90, 70, - 0, 0, 213, 0, 214, 0, 213, 86, 214, 0, - 83, 0, 78, 0, 80, 0, 59, 0, 217, 0, - 217, 0, 198, 0, 83, 0, 184, 0, 190, 0, - 184, 0, 190, 0, 69, 190, 217, 221, 70, 0, - 69, 220, 217, 221, 70, 0, 0, 87, 80, 88, - 0, 223, 0, 223, 69, 224, 70, 0, 60, 0, - 225, 0, 224, 225, 0, 226, 0, 227, 0, 228, - 0, 62, 83, 0, 63, 83, 0, 64, 150, 0, - 230, 0, 230, 69, 231, 70, 0, 61, 0, 232, - 0, 231, 232, 0, 233, 0, 234, 0, 235, 0, - 65, 71, 0, 65, 72, 0, 66, 80, 0, 67, - 80, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 202, 203, 210, 217, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 256, 268, 294, 307, 321, 338, 355, 384, - 415, 433, 448, 451, 479, 482, 483, 559, 574, 594, - 597, 598, 601, 608, 615, 622, 629, 636, 645, 680, - 728, 782, 785, 795, 807, 824, 843, 846, 849, 886, - 889, 892, 908, 937, 940, 972, 1006, 1009, 1035, 1066, - 1083, 1102, 1119, 1138, 1155, 1174, 1213, 1263, 1289, 1310, - 1347, 1357, 1369, 1418, 1437, 1461, 1470, 1481, 1492, 1505, - 1516, 1528, 1615, 1634, 1714, 1730, 1761, 1768, 1777, 1816, - 1843, 1887, 1897, 1909, 1933, 1948, 1985, 1986, 1993, 2003, - 2018, 2056, 2074, 2081, 2089, 2099, 2109, 2119, 2131, 2132, - 2133, 2134, 2135, 2136, 2139, 2140, 2141, 2142, 2143, 2144, - 2147, 2148, 2159, 2160, 2163, 2171, 2195, 2219, 2243, 2244, - 2252, 2276, 2288, 2289, 2290, 2298, 2301, 2302, 2303, 2306, - 2307, 2310, 2357, 2426, 2434, 2444, 2482, 2483, 2486, 2528, - 2529, 2532, 2542, 2543, 2546, 2594, 2605, 2617, 2630, 2631, - 2642, 2643, 2646, 2654, 2678, 2702, 2726, 2727, 2735, 2759, - 2771, 2772, 2773, 2783, 2784, 2785, 2788, 2789, 2792, 2847, - 2855, 2858, 2928, 2936, 2957, 2958, 2961, 2962, 2965, 2973, - 2981, 2991, 2994, 2997, 2998, 3001, 3002, 3005, 3013, 3023, - 3048, 3073, 3093, 3113, 3134, 3154, 3155, 3158, 3159, 3162, - 3163, 3164, 3167, 3180, 3194, 3204, 3214, 3217, 3218, 3219, - 3222, 3225, 3251, 3274, 3278, 3283, 3290, 3310, 3318, 3332, - 3350, 3370, 3371, 3395, 3415, 3426, 3427, 3430, 3454, 3490, - 3528, 3529, 3532, 3575, 3619, 3634, 3672, 3712, 3713, 3716, - 3717, 3720, 3730, 3733, 3766, 3778, 3788, 3798, 3808, 3818, - 3828, 3840, 3841, 3844, 3871, 3900, 3938, 3946, 3954, 3963, - 3974, 3985, 3988, 4002, 4027, 4066, 4091, 4130, 4149, 4166, - 4174, 4184, 4185, 4188, 4202, 4203, 4206, 4207, 4208, 4211, - 4227, 4243, 4255, 4256, 4259, 4273, 4274, 4277, 4278, 4279, - 4282, 4292, 4304, 4316 -}; - -static const char * const yytname[] = { "$","error","$undefined.","T_LANGUAGE", -"T_RESET","T_ALL","T_WAREHOUSE","T_ASSOCIATION","T_RELATION","T_EXECUTION_CONTEXT", -"T_COMPARE","T_COMPARE_NOT","T_CONFIRM","T_COPY","T_CREATE","T_DELAY","T_DELETE", -"T_DISPLAY","T_ECHO","T_POPULATE","T_READ","T_RECEIVE","T_ROLE","T_SEND","T_SET", -"T_SYSTEM","T_TIME","T_VALIDATE","T_VERBOSE","T_WRITE","T_IMPORT","T_EXPORT", -"T_VALIDATION","T_DEF_SQ_LENGTH","T_ADD_GROUP_LENGTH","T_STRICT","T_APPL_ENTITY", -"T_ASSOCIATE_RQ","T_ASSOCIATE_AC","T_ASSOCIATE_RJ","T_RELEASE_RQ","T_RELEASE_RP", -"T_ABORT_RQ","T_PROT_VER","T_CALLED_AE","T_CALLING_AE","T_APPL_CTX","T_PRES_CTX", -"T_MAX_LEN","T_IMPL_CLASS","T_IMPL_VER","T_SOP_EXTEND_NEG","T_SCPSCU_ROLE","T_ASYNC_WINDOW", -"T_USER_ID_NEG","T_RESULT","T_SOURCE","T_REASON","T_DEFINED_LENGTH","T_AUTOSET", -"T_FILEHEAD","T_FILETAIL","T_FILE_PREAMBLE","T_DICOM_PREFIX","T_TRANSFER_SYNTAX", -"T_DATASET_TRAILING_PADDING","T_SECTOR_SIZE","T_PADDING_VALUE","T_SQ","T_OPEN_BRACKET", -"T_CLOSE_BRACKET","T_YES","T_NO","T_ON","T_OFF","T_OR","T_AND","COMMANDFIELD", -"HEXADECIMAL","IDENTIFIER","INTEGER","VALIDATIONFLAG","IOMLEVEL","STRING","USERPROVIDER", -"VR","','","'['","']'","'>'","'?'","Language","LanguageGrammar","LanguageComponents", -"LanguageSpecifier","ResetCommand","CompareCommand","ConfirmCommand","CopyCommand", -"CreateCommand","DelayCommand","DeleteCommand","DisplayCommand","EchoCommand", -"ExportCommand","ExportList","ExportAcseObject","ExportDimseObjects","ImportCommand", -"ImportList","PopulateCommand","ReadCommand","ReceiveCommand","RoleCommand", -"SendCommand","SetCommand","SystemCommand","TimeCommand","ValidateCommand","VerboseCommand", -"WriteCommand","ApplicationEntityFlagCommand","ValidationFlagCommand","DefineSqLengthFlagCommand", -"AddGroupLengthFlagCommand","StrictValidationFlagCommand","CreateList","DeleteList", -"DisplayTagList","ReadList","ReceiveList","SendList","PresentationContextId", -"SetList","ValidateList","SourceSopRef","ReferenceSopList","ReferenceSopRef", -"SopList","WriteList","Acse","AcseContents","AssociateRqContents","AssociateRqParameterList", -"AssociateRqParameter","AssociateRqPresCtxList","AssociateRqPresCtx","RqPresCtx", -"VtsRqPresCtx","RqTransferSyntaxList","TransferSyntax","SopClassExtendedList", -"SopClassExtended","ApplicationInfoList","ApplicationInfoByte","ScpScuRoleList", -"ScpScuRole","UserIdentityNegotiation","AssociateAcContents","AssociateAcParameterList", -"AssociateAcParameter","AssociateAcPresCtxList","AssociateAcPresCtx","AcPresCtx", -"AcTransferSyntax","VtsAcPresCtx","MoreAcPresentationContext","AssociateRjContents", -"AssociateRjParameterList","AssociateRjParameter","ReleaseRqContents","ReleaseRpContents", -"AbortRqContents","AbortRqParameterList","AbortRqParameter","AssociateRq","AssociateAc", -"AssociateRj","ReleaseRq","ReleaseRp","AbortRq","Sop","SopContents","CommandContents", -"Command","DimseCmd","CommandIdentifier","CommandRef","DatasetContents","DatasetRef", -"Dataset","IomIod","IomLevel","IodName","DatasetIdentifier","AttributeList", -"Attribute","AttributeIdentification","AttributeTag","AttributeValue","SequenceValue", -"SequenceVR","ItemList","ItemByReferenceList","ItemByReference","ItemByValueList", -"ItemByValue","ItemAttributeList","ItemAttribute","OtherValue","OptionalVR", -"AttributeVR","Values","VMList","Value","TagRef1","TagRef2","TagRef","ObjectRef1", -"ObjectRef2","SequenceRef","ItemNumber","FileheadContents","Filehead","FileheadParameterList", -"FileheadParameter","FilePreamble","DicomPrefix","FileTransferSyntax","FiletailContents", -"Filetail","FiletailParameterList","FiletailParameter","DatasetTrailingPadding", -"SectorSize","PaddingValue","" -}; -#endif - -static const short scriptr1[] = { 0, - 91, 91, 92, 92, 93, 93, 93, 93, 93, 93, - 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, - 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, - 93, 93, 94, 95, 95, 95, 95, 95, 96, 96, - 97, 98, 99, 100, 101, 102, 102, 102, 103, 104, - 105, 105, 106, 106, 106, 106, 106, 106, 107, 107, - 107, 108, 109, 109, 110, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, - 123, 124, 124, 125, 125, 126, 126, 126, 126, 126, - 126, 126, 127, 127, 127, 127, 127, 128, 128, 129, - 129, 130, 130, 131, 131, 131, 132, 132, 133, 133, - 133, 133, 133, 134, 135, 135, 136, 136, 136, 137, - 137, 138, 138, 138, 138, 139, 139, 139, 140, 140, - 140, 140, 140, 140, 141, 141, 141, 141, 141, 141, - 142, 142, 143, 143, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 145, 145, 145, 146, - 146, 147, 148, 149, 149, 150, 151, 151, 152, 153, - 153, 154, 155, 155, 156, 157, 157, 157, 158, 158, - 159, 159, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 161, 161, 161, 162, 162, 163, 164, - 164, 165, 166, 166, 167, 167, 168, 168, 169, 169, - 169, 170, 171, 172, 172, 173, 173, 174, 174, 175, - 176, 177, 178, 179, 180, 181, 181, 182, 182, 183, - 183, 183, 184, 184, 185, 186, 187, 188, 188, 188, - 189, 190, 190, 191, 191, 192, 193, 194, 194, 195, - 195, 196, 196, 197, 198, 199, 199, 200, 201, 201, - 202, 202, 203, 203, 204, 205, 205, 206, 206, 207, - 207, 208, 209, 210, 210, 211, 211, 211, 211, 211, - 211, 212, 212, 213, 213, 214, 214, 214, 214, 215, - 216, 217, 217, 218, 218, 219, 219, 220, 220, 221, - 221, 222, 222, 223, 224, 224, 225, 225, 225, 226, - 227, 228, 229, 229, 230, 231, 231, 232, 232, 232, - 233, 233, 234, 235 -}; - -static const short scriptr2[] = { 0, - 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 2, 5, 5, - 1, 5, 2, 2, 2, 1, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, - 6, 2, 2, 4, 2, 2, 2, 2, 2, 2, - 2, 2, 1, 2, 2, 2, 2, 3, 2, 2, - 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, - 2, 1, 1, 1, 1, 3, 3, 3, 1, 1, - 1, 1, 1, 2, 2, 4, 0, 1, 3, 2, - 4, 0, 1, 3, 3, 2, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 1, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 3, 2, 1, 2, 3, 1, - 1, 5, 11, 1, 3, 1, 1, 2, 5, 1, - 3, 1, 1, 2, 7, 3, 4, 1, 1, 4, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 3, 1, 2, 3, 1, 1, 6, 0, - 2, 8, 0, 6, 1, 4, 1, 2, 2, 2, - 2, 1, 1, 1, 4, 1, 2, 2, 2, 1, - 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, - 3, 4, 1, 2, 1, 1, 1, 1, 3, 4, - 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, - 2, 5, 3, 1, 1, 1, 1, 3, 1, 3, - 1, 1, 1, 3, 1, 1, 3, 0, 1, 1, - 2, 2, 2, 0, 2, 1, 3, 3, 5, 4, - 6, 0, 1, 1, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 5, 5, 0, - 3, 1, 4, 1, 1, 2, 1, 1, 1, 2, - 2, 2, 1, 4, 1, 1, 2, 1, 1, 1, - 2, 2, 2, 2 -}; - -static const short scriptdefact[] = { 1, - 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, - 0, 0, 0, 122, 0, 0, 0, 0, 73, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 46, - 33, 34, 35, 36, 37, 38, 235, 246, 247, 294, - 233, 295, 242, 0, 244, 0, 0, 0, 220, 221, - 222, 223, 224, 225, 304, 315, 0, 43, 86, 129, - 130, 131, 132, 133, 134, 87, 226, 88, 0, 91, - 92, 44, 96, 97, 45, 93, 94, 95, 48, 47, - 49, 65, 66, 0, 67, 68, 103, 102, 135, 136, - 137, 138, 139, 140, 141, 179, 205, 212, 213, 214, - 123, 228, 230, 0, 69, 70, 104, 105, 71, 109, - 110, 230, 111, 0, 238, 112, 302, 113, 313, 72, - 74, 117, 0, 75, 76, 0, 77, 62, 0, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 0, 79, - 80, 81, 82, 83, 84, 85, 0, 4, 255, 293, - 292, 99, 236, 234, 248, 249, 243, 245, 0, 290, - 0, 0, 0, 0, 227, 89, 90, 98, 101, 100, - 0, 0, 0, 0, 0, 0, 229, 0, 0, 0, - 0, 0, 114, 118, 0, 115, 126, 127, 128, 63, - 59, 78, 296, 297, 0, 0, 0, 300, 300, 124, - 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 143, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 181, 0, 0, - 0, 0, 207, 0, 0, 0, 216, 0, 231, 0, - 250, 0, 106, 239, 0, 0, 0, 0, 0, 305, - 307, 308, 309, 0, 0, 0, 0, 316, 318, 319, - 320, 0, 120, 0, 0, 0, 39, 291, 40, 42, - 0, 0, 0, 145, 146, 147, 148, 0, 149, 157, - 160, 161, 150, 151, 152, 0, 153, 167, 0, 154, - 173, 0, 0, 178, 156, 142, 144, 183, 184, 185, - 186, 0, 187, 194, 197, 198, 188, 189, 190, 191, - 192, 0, 180, 182, 209, 210, 211, 206, 208, 218, - 219, 215, 217, 0, 254, 0, 232, 251, 0, 0, - 240, 310, 311, 166, 312, 303, 306, 321, 322, 323, - 324, 314, 317, 119, 0, 116, 64, 60, 0, 298, - 299, 0, 0, 0, 158, 0, 168, 0, 174, 155, - 0, 0, 0, 0, 195, 193, 274, 253, 107, 108, - 121, 0, 301, 0, 0, 159, 0, 0, 176, 0, - 0, 196, 259, 0, 276, 0, 0, 256, 0, 257, - 282, 0, 61, 0, 0, 164, 172, 0, 170, 0, - 177, 0, 200, 0, 0, 0, 0, 252, 268, 289, - 287, 288, 286, 273, 283, 284, 275, 0, 162, 0, - 169, 0, 0, 0, 0, 0, 278, 0, 0, 260, - 277, 265, 0, 258, 261, 263, 262, 266, 269, 270, - 0, 0, 165, 171, 0, 203, 201, 199, 280, 0, - 272, 0, 268, 271, 285, 0, 175, 0, 0, 279, - 0, 264, 267, 0, 0, 202, 281, 0, 0, 0, - 0, 163, 0, 204, 0, 0, 0 -}; - -static const short scriptdefgoto[] = { 505, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 160, 161, 162, 43, 158, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 88, 105, 60, 115, 116, 136, - 273, 139, 151, 152, 213, 214, 117, 157, 89, 118, - 119, 244, 245, 309, 310, 311, 312, 425, 426, 317, - 318, 428, 429, 320, 321, 325, 120, 257, 258, 333, - 334, 335, 456, 336, 489, 121, 262, 263, 122, 123, - 124, 266, 267, 125, 126, 127, 128, 129, 130, 96, - 131, 132, 70, 71, 184, 134, 143, 144, 72, 73, - 74, 75, 187, 270, 271, 354, 181, 417, 418, 419, - 464, 465, 466, 467, 468, 469, 470, 420, 421, 422, - 444, 445, 446, 189, 297, 190, 76, 225, 99, 302, - 146, 100, 279, 280, 281, 282, 283, 148, 101, 287, - 288, 289, 290, 291 -}; - -static const short scriptpact[] = { 217, - -50, 208, -48, -48,-32768, -48, 3, -11, 66, 10, - 6, 36, 81, 18, 109, 18, 77, 103,-32768, 127, - 47, 128, 127, 18, 144, 124, 145, 203, 187, 217, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -13, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 195,-32768, 62, 197,-32768, -13, -13, -13,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 83,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 196, 271, 196,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -13, --32768,-32768,-32768, -46,-32768,-32768, 230,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 272, 273, 274,-32768,-32768, 275, --32768,-32768, 102, 276,-32768,-32768,-32768, 293,-32768,-32768, --32768, 277,-32768, 278, 279,-32768, 280,-32768, 281,-32768, --32768, 127, 195,-32768,-32768, -7,-32768,-32768, 195,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 195,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 268,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -48,-32768, - -48, -48, -13, -13,-32768,-32768,-32768,-32768,-32768,-32768, - 127, 127, 250, 267, 125, 251,-32768, 252, 283, 254, - 160, 201, 282,-32768, 195, 196,-32768,-32768,-32768, 196, - 196,-32768,-32768,-32768, -13, -13, -13, 266, 266,-32768, --32768, 284, 285, 286, 287, 289, 291, 290, 292, 294, - 296, 297, 19, 211,-32768, 298, 299, 300, 301, 303, - 305, 304, 306, 294, 296, 308, 239,-32768, 310, 311, - 312, 106,-32768, 313, 314, 118,-32768, -13,-32768, 256, --32768, 191,-32768,-32768, 258, 315, 317, 318, 132,-32768, --32768,-32768,-32768, 259, 319, 322, 142,-32768,-32768,-32768, --32768, 127, 196, 62, 62, 62,-32768,-32768,-32768,-32768, - 323, 309, 325,-32768,-32768,-32768,-32768, 50, 5,-32768, --32768,-32768,-32768,-32768,-32768, 321, 294,-32768, 324, 296, --32768, 326, 328,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 73, 65,-32768,-32768,-32768,-32768,-32768,-32768, 294, - 296, 329,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 269, 327, 335,-32768,-32768, 340, 341, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 62,-32768,-32768, 307, 288,-32768, --32768, 270, 295, 289,-32768, 330,-32768, 331,-32768,-32768, - 332, 333, 334, 303,-32768,-32768, 13,-32768,-32768,-32768, --32768, 283,-32768, 338, 318,-32768, 342, 343, 344, 345, - 346,-32768,-32768, 188,-32768, -6, 348,-32768, 347,-32768, - -32, 349,-32768, 350, -9,-32768,-32768, 26,-32768, 351, --32768, 352, 353, -40, 339, 354, 355,-32768, 61,-32768, --32768,-32768,-32768,-32768, 358,-32768,-32768, 360,-32768, 318, --32768, 342, 361, 362, 318, 359,-32768, 364, 363,-32768, --32768,-32768, 377,-32768, 366,-32768, 367,-32768, 365,-32768, - -32, 369,-32768,-32768, 378, 370,-32768,-32768,-32768, -23, --32768, 374, 365,-32768,-32768, 379,-32768, 380, 388,-32768, - 391,-32768,-32768, 376, 381,-32768,-32768, 318, 383, 72, - 382,-32768, 318,-32768, 386, 396,-32768 -}; - -static const short scriptpgoto[] = {-32768, --32768, 336,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -43,-32768,-32768,-32768,-32768, 68,-32768,-32768, 371, 316, --32768,-32768, 117,-32768, -290,-32768,-32768, -136, -277, 113, - -291,-32768, -78, 157, -302,-32768,-32768,-32768, 156,-32768, - -316,-32768,-32768,-32768,-32768,-32768,-32768, 152,-32768,-32768, --32768,-32768, 162, 59, 64, 115, 116, 122, 148,-32768, - -10, 413, -2, -20, -131,-32768, 337,-32768, 14, -196, --32768, 357, -285, 222, -262,-32768, 179,-32768,-32768,-32768, --32768,-32768, -33,-32768, -19,-32768, -4,-32768,-32768,-32768, --32768,-32768, -21, 257, 110, -58, 173, 147, 384, 237, --32768, 452,-32768, 193,-32768,-32768,-32768,-32768, 456,-32768, - 189,-32768,-32768,-32768 -}; - - -#define YYLAST 476 - - -static const short yytable[] = { 153, - 365, 182, 159, 169, 97, 138, 107, 358, 376, 377, - 378, 133, 358, 133, 142, 109, 395, 389, 385, 294, - 98, 216, 108, 295, 296, 387, 440, 220, 67, 457, - 145, 199, 61, 68, 69, 68, 69, 221, 389, 79, - 80, 81, 82, 83, 84, 441, 490, 442, 387, 458, - 443, 198, 217, 218, 79, 80, 81, 82, 83, 84, - 449, 436, 85, 86, 179, 90, 491, 90, 102, 180, - 91, 87, 91, 308, 68, 69, 450, 412, 437, 67, - 413, 414, 163, 293, 68, 69, 67, 164, 111, 401, - 384, 68, 69, 406, 67, 451, 375, 415, 323, 416, - 193, 324, 79, 80, 81, 82, 83, 84, 112, 113, - 195, 452, 197, 79, 80, 81, 82, 83, 84, 154, - 155, 92, 93, 92, 93, 103, 104, 200, 94, 382, - 94, 215, 383, 332, 228, 229, 85, 86, 165, 166, - 185, 502, 67, 462, 186, 167, 145, 68, 69, 463, - 394, 87, 392, 67, 95, 393, 95, 450, 68, 69, - 259, 260, 261, 114, 68, 69, 298, 298, 298, 219, - -237, 168, 473, 264, 265, 348, 77, 477, 78, 259, - 260, 261, 110, 68, 69, 150, 223, 352, 223, 223, - 230, 231, 135, 276, 277, 278, 171, 172, 133, 133, - 481, 366, 224, 67, 224, 224, 284, 285, 286, 356, - 156, 372, 62, 63, 64, 65, 66, 173, 174, 1, - 2, 276, 277, 278, 170, 504, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 284, 285, 286, 359, 177, - 360, 215, 434, 183, 435, 175, 176, 68, 69, 69, - 326, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 201, 202, 264, 265, 343, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 268, 269, 268, 274, 268, 357, 268, 361, 196, 368, - 369, 137, 140, 191, 192, 299, 300, 226, 227, 209, - 203, 204, 205, 206, 208, -237, 210, -241, 211, 212, - 222, 272, 301, 402, 397, 404, 292, 308, 423, 374, - 327, 500, 316, 304, 319, 178, 340, 305, 306, 307, - 313, 332, 314, 474, 315, 403, 322, 328, 380, 106, - 405, 329, 330, 331, 337, 506, 338, 342, 339, 345, - 346, 347, 350, 351, 381, 507, -292, 362, 370, 363, - 364, 371, 379, 386, 398, 390, 388, 391, 396, 399, - 400, 341, 344, 349, 409, 407, 408, 438, 410, 411, - 424, 427, 430, 459, 432, 433, 431, 353, 478, 141, - 188, 275, 439, 479, 447, 448, 453, 454, 455, 472, - 475, 460, 461, 471, 476, 268, 355, 487, 492, 485, - 480, 482, 483, 463, 486, 488, 462, 496, 494, 495, - 497, 498, 501, 493, 484, 303, 499, 503, 147, 207, - 194, 367, 149, 0, 0, 373 -}; - -static const short yycheck[] = { 20, - 278, 60, 23, 24, 7, 16, 9, 270, 294, 295, - 296, 14, 275, 16, 17, 6, 333, 320, 309, 216, - 7, 153, 9, 220, 221, 317, 59, 159, 77, 70, - 17, 78, 83, 82, 83, 82, 83, 169, 341, 37, - 38, 39, 40, 41, 42, 78, 70, 80, 340, 90, - 83, 110, 60, 61, 37, 38, 39, 40, 41, 42, - 70, 68, 60, 61, 78, 7, 90, 9, 80, 83, - 7, 69, 9, 69, 82, 83, 86, 394, 85, 77, - 68, 69, 24, 215, 82, 83, 77, 24, 83, 375, - 86, 82, 83, 384, 77, 70, 293, 85, 80, 87, - 87, 83, 37, 38, 39, 40, 41, 42, 73, 74, - 97, 86, 99, 37, 38, 39, 40, 41, 42, 73, - 74, 7, 7, 9, 9, 60, 61, 114, 7, 80, - 9, 152, 83, 69, 193, 194, 60, 61, 24, 24, - 79, 70, 77, 83, 83, 24, 133, 82, 83, 89, - 86, 69, 80, 77, 7, 83, 9, 86, 82, 83, - 55, 56, 57, 83, 82, 83, 225, 226, 227, 156, - 69, 24, 450, 56, 57, 70, 4, 455, 6, 55, - 56, 57, 10, 82, 83, 83, 189, 70, 191, 192, - 201, 202, 84, 62, 63, 64, 73, 74, 201, 202, - 463, 70, 189, 77, 191, 192, 65, 66, 67, 268, - 83, 70, 5, 6, 7, 8, 9, 73, 74, 3, - 4, 62, 63, 64, 81, 503, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 65, 66, 67, 78, 83, - 80, 292, 85, 79, 87, 73, 74, 82, 83, 83, - 70, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 75, 76, 56, 57, 70, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 69, 70, 69, 70, 69, 70, 69, 70, 58, 71, - 72, 16, 17, 77, 78, 226, 227, 191, 192, 47, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 83, 69, 87, 47, 86, 86, 75, 69, 402, 292, - 244, 498, 69, 80, 69, 30, 254, 83, 83, 83, - 80, 69, 83, 452, 83, 88, 80, 80, 70, 9, - 86, 83, 83, 83, 80, 0, 83, 80, 83, 80, - 80, 80, 80, 80, 70, 0, 70, 83, 80, 83, - 83, 80, 80, 83, 70, 80, 83, 80, 80, 70, - 70, 255, 257, 262, 83, 86, 86, 70, 86, 86, - 83, 80, 80, 85, 80, 80, 83, 266, 70, 17, - 74, 210, 86, 70, 86, 86, 86, 86, 86, 80, - 80, 88, 88, 86, 83, 69, 268, 70, 482, 471, - 88, 86, 86, 89, 86, 86, 83, 70, 80, 80, - 70, 86, 80, 483, 469, 229, 86, 86, 17, 133, - 87, 279, 17, -1, -1, 287 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "bison.simple" - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -#ifndef alloca -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) -#include -#else /* not sparc */ -#if defined (MSDOS) && !defined (__TURBOC__) -#include -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -#include - #pragma alloca -#else /* not MSDOS, __TURBOC__, or _AIX */ -#ifdef __hpux -#ifdef __cplusplus -extern "C" { -void *alloca (unsigned int); -}; -#else /* not __cplusplus */ -void *alloca (); -#endif /* not __cplusplus */ -#endif /* __hpux */ -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc. */ -#endif /* not GNU C. */ -#endif /* alloca not defined. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define scripterrok (yyerrstatus = 0) -#define scriptclearin (scriptchar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto scripterrlab1 -/* Like YYERROR except do call scripterror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto scripterrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (scriptchar == YYEMPTY && yylen == 1) \ - { scriptchar = (token), scriptlval = (value); \ - scriptchar1 = YYTRANSLATE (scriptchar); \ - YYPOPSTACK; \ - goto scriptbackup; \ - } \ - else \ - { scripterror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX scriptlex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX scriptlex(&scriptlval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX scriptlex(&scriptlval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX scriptlex(&scriptlval, YYLEX_PARAM) -#else -#define YYLEX scriptlex(&scriptlval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int scriptchar; /* the lookahead symbol */ -YYSTYPE scriptlval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int scriptnerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int scriptdebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -int scriptparse (void); -#endif - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (from, to, count) - char *from; - char *to; - int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *from, char *to, int count) -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 192 "bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into scriptparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#else -#define YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#endif - -int -scriptparse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL -{ - register int scriptstate; - register int yyn; - register short *scriptssp; - register YYSTYPE *scriptvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int scriptchar1 = 0; /* lookahead token as an internal (translated) token number */ - - short scriptssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE scriptvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *scriptss = scriptssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *scriptvs = scriptvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *scriptlsp; - -#define YYPOPSTACK (scriptvsp--, scriptssp--, scriptlsp--) -#else -#define YYPOPSTACK (scriptvsp--, scriptssp--) -#endif - - int scriptstacksize = YYINITDEPTH; - -#ifdef YYPURE - int scriptchar; - YYSTYPE scriptlval; - int scriptnerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE scriptval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (scriptdebug) - fprintf(stderr, "Starting parse\n"); -#endif - - scriptstate = 0; - yyerrstatus = 0; - scriptnerrs = 0; - scriptchar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - scriptssp = scriptss - 1; - scriptvsp = scriptvs; -#ifdef YYLSP_NEEDED - scriptlsp = yyls; -#endif - -/* Push a new state, which is found in scriptstate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++scriptssp = scriptstate; - - if (scriptssp >= scriptss + scriptstacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *scriptvs1 = scriptvs; - short *scriptss1 = scriptss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = scriptssp - scriptss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &scriptss1, size * sizeof (*scriptssp), - &scriptvs1, size * sizeof (*scriptvsp), - &yyls1, size * sizeof (*scriptlsp), - &scriptstacksize); -#else - yyoverflow("parser stack overflow", - &scriptss1, size * sizeof (*scriptssp), - &scriptvs1, size * sizeof (*scriptvsp), - &scriptstacksize); -#endif - - scriptss = scriptss1; scriptvs = scriptvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (scriptstacksize >= YYMAXDEPTH) - { - scripterror("parser stack overflow"); - return 2; - } - scriptstacksize *= 2; - if (scriptstacksize > YYMAXDEPTH) - scriptstacksize = YYMAXDEPTH; - scriptss = (short *) alloca (scriptstacksize * sizeof (*scriptssp)); - __yy_memcpy ((char *)scriptss1, (char *)scriptss, size * sizeof (*scriptssp)); - scriptvs = (YYSTYPE *) alloca (scriptstacksize * sizeof (*scriptvsp)); - __yy_memcpy ((char *)scriptvs1, (char *)scriptvs, size * sizeof (*scriptvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (scriptstacksize * sizeof (*scriptlsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*scriptlsp)); -#endif -#endif /* no yyoverflow */ - - scriptssp = scriptss + size - 1; - scriptvsp = scriptvs + size - 1; -#ifdef YYLSP_NEEDED - scriptlsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (scriptdebug) - fprintf(stderr, "Stack size increased to %d\n", scriptstacksize); -#endif - - if (scriptssp >= scriptss + scriptstacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (scriptdebug) - fprintf(stderr, "Entering state %d\n", scriptstate); -#endif - - goto scriptbackup; - scriptbackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = scriptpact[scriptstate]; - if (yyn == YYFLAG) - goto scriptdefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* scriptchar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (scriptchar == YYEMPTY) - { -#if YYDEBUG != 0 - if (scriptdebug) - fprintf(stderr, "Reading a token: "); -#endif - scriptchar = YYLEX; - } - - /* Convert token to internal form (in scriptchar1) for indexing tables with */ - - if (scriptchar <= 0) /* This means end of input. */ - { - scriptchar1 = 0; - scriptchar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (scriptdebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - scriptchar1 = YYTRANSLATE(scriptchar); - -#if YYDEBUG != 0 - if (scriptdebug) - { - fprintf (stderr, "Next token is %d (%s", scriptchar, yytname[scriptchar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, scriptchar, scriptlval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += scriptchar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != scriptchar1) - goto scriptdefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto scripterrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto scripterrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (scriptdebug) - fprintf(stderr, "Shifting token %d (%s), ", scriptchar, yytname[scriptchar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (scriptchar != YYEOF) - scriptchar = YYEMPTY; - - *++scriptvsp = scriptlval; -#ifdef YYLSP_NEEDED - *++scriptlsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - scriptstate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -scriptdefault: - - yyn = scriptdefact[scriptstate]; - if (yyn == 0) - goto scripterrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = scriptr2[yyn]; - if (yylen > 0) - scriptval = scriptvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (scriptdebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[scriptr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 2: -#line 204 "script_parser.y" -{ - //cleanup - clearVTSUidMappings(); - ; - break;} -case 3: -#line 211 "script_parser.y" -{ - if (scriptSession_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 4: -#line 218 "script_parser.y" -{ - if (scriptSession_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 33: -#line 257 "script_parser.y" -{ - if (strcmp(scriptvsp[0].string_ptr, "NATIVE_VTS") == 0) - { - scriptIsNativeVts = true; - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 34: -#line 269 "script_parser.y" -{ - // data warehouse should be emptied - // and association reset - // - backwards compatibility with VTS - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // log action - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "RESET ALL"); - logger_ptr->text(LOG_DEBUG, 1, "Warehouse content has been deleted."); - logger_ptr->text(LOG_DEBUG, 1, "Association has been reset."); - logger_ptr->text(LOG_DEBUG, 1, "Object(Image) Relationship has been reset."); - logger_ptr->text(LOG_DEBUG, 1, "Script Execution Context has been reset."); - } - WAREHOUSE->empty(); - scriptSession_ptr->resetAssociation(); - - // cleanup any outstanding relationships - // - from previous emulations / script executions - RELATIONSHIP->cleanup(); - - // reset the script execution context - scriptSession_ptr->resetScriptExecutionContext(); - ; - break;} -case 35: -#line 295 "script_parser.y" -{ - // data warehouse should be emptied - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // log action - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "RESET WAREHOUSE"); - logger_ptr->text(LOG_DEBUG, 1, "Warehouse content has been deleted."); - } - WAREHOUSE->empty(); - ; - break;} -case 36: -#line 308 "script_parser.y" -{ - // association reset - // - backwards compatibility with VTS - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // log action - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "RESET ASSOCIATION"); - logger_ptr->text(LOG_DEBUG, 1, "Association has been reset."); - } - scriptSession_ptr->resetAssociation(); - ; - break;} -case 37: -#line 322 "script_parser.y" -{ - // relation reset - // - backwards compatibility with VTS - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // log action - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "RESET RELATION"); - logger_ptr->text(LOG_DEBUG, 1, "Object(Image) Relationship has been reset."); - } - - // cleanup any outstanding relationships - // - from previous emulations / script executions - RELATIONSHIP->cleanup(); - ; - break;} -case 38: -#line 339 "script_parser.y" -{ - // script execution context reset - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // log action - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "RESET SCRIPT-EXECUTION-CONTEXT"); - logger_ptr->text(LOG_DEBUG, 1, "Script Execution Context has been reset."); - } - - // reset the script execution context - scriptSession_ptr->resetScriptExecutionContext(); - ; - break;} -case 39: -#line 356 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if ((wid1_ptr) && - (wid2_ptr)) - { - // compare the attribute in object 1 with that in object 2 - expect that they are the same - if (!compareAttributes(logger_ptr, wid1_ptr, group1, element1, wid2_ptr, group2, element2)) - { - // attributes are different - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Compared attributes should be equal but are not: (%04X,%04X) != (%04X,%04X)", group1, element1, group2, element2); - } - } - else - { - // attributes are the same - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 1, "Compared attributes are equal: (%04X,%04X) == (%04X,%04X)", group1, element1, group2, element2); - } - } - } - } - ; - break;} -case 40: -#line 385 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if ((wid1_ptr) && - (wid2_ptr)) - { - // compare the attribute in object 1 with that in object 2 - expect that they are different - if (compareAttributes(logger_ptr, wid1_ptr, group1, element1, wid2_ptr, group2, element2)) - { - // attributes are different - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Compared attributes should not be equal but are: (%04X,%04X) == (%04X,%04X)", group1, element1, group2, element2); - } - } - else - { - // attributes are the same - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 1, "Compared attributes are not equal: (%04X,%04X) != (%04X,%04X)", group1, element1, group2, element2); - } - } - } - } - ; - break;} -case 41: -#line 416 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - BASE_CONFIRMER *confirmer_ptr = scriptSession_ptr->getConfirmer(); - - // ask user to confirm action through interaction with logger and confirmer - if ((logger_ptr) && - (confirmer_ptr)) - { - logger_ptr->text(LOG_SCRIPT, 2, "CONFIRM"); - confirmer_ptr->ConfirmInteraction(); - } - } - ; - break;} -case 42: -#line 435 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - BASE_CONFIRMER *confirmer_ptr = scriptSession_ptr->getConfirmer(); - - // ask user to confirm action through interaction with logger and confirmer - if ((logger_ptr) && - (confirmer_ptr)) - { - logger_ptr->text(LOG_SCRIPT, 2, "CONFIRM \"%s\"", scriptvsp[0].string_ptr); - confirmer_ptr->ConfirmInteraction(scriptvsp[0].string_ptr); - } - } - - // free malloced string buffer - free(scriptvsp[0].string_ptr); - ; - break;} -case 43: -#line 460 "script_parser.y" -{ - if (!scriptParseOnly) - { - if ((wid1_ptr) && - (wid2_ptr)) - { - // copy the attribute in object 1 to that in object 2 - // - don't stop on returned error - copyAttribute(scriptSession_ptr->getLogger(), wid1_ptr, group1, element1, wid2_ptr, group2, element2); - } - } - ; - break;} -case 45: -#line 478 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // delay for given number of seconds - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DELAY %d seconds", scriptvsp[0].integer); - } - - for (int sec = 0; sec < scriptvsp[0].integer; sec++) - { - if (scriptSession_ptr->isSessionStopped()) - { - YYACCEPT; - } -#ifdef _WINDOWS - Sleep(1000); -#else - sleep(1); -#endif - } - } - ; - break;} -case 47: -#line 484 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (wid1_ptr) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY object"); - } - - // display the referenced warehouse object - wid1_ptr->setLogger(scriptSession_ptr->getLogger()); - - BASE_SERIALIZER *serializer_ptr = scriptSession_ptr->getSerializer(); - if (serializer_ptr) - { - switch(wid1_ptr->getWidType()) - { - case WID_C_ECHO_RQ: - case WID_C_ECHO_RSP: - case WID_C_FIND_RQ: - case WID_C_FIND_RSP: - case WID_C_GET_RQ: - case WID_C_GET_RSP: - case WID_C_MOVE_RQ: - case WID_C_MOVE_RSP: - case WID_C_STORE_RQ: - case WID_C_STORE_RSP: - case WID_C_CANCEL_RQ: - case WID_N_ACTION_RQ: - case WID_N_ACTION_RSP: - case WID_N_CREATE_RQ: - case WID_N_CREATE_RSP: - case WID_N_DELETE_RQ: - case WID_N_DELETE_RSP: - case WID_N_EVENT_REPORT_RQ: - case WID_N_EVENT_REPORT_RSP: - case WID_N_GET_RQ: - case WID_N_GET_RSP: - case WID_N_SET_RQ: - case WID_N_SET_RSP: - { - // retrieve the command from the warehouse - DCM_COMMAND_CLASS *command_ptr = static_cast(wid1_ptr); - - // serialize it - serializer_ptr->SerializeDisplay(command_ptr, NULL); - } - break; - case WID_DATASET: - { - // retrieve the dataset from the warehouse - DCM_DATASET_CLASS *dataset_ptr = static_cast(wid1_ptr); - - // serialize it - serializer_ptr->SerializeDisplay(dataset_ptr); - } - break; - case WID_ITEM: - { - // retrieve the item from the warehouse - DCM_ITEM_CLASS *item_ptr = static_cast(wid1_ptr); - - // serialize it -// serializer_ptr->SerializeDisplay(item_ptr); - } - break; - default: break; - } - } - } - } - ; - break;} -case 48: -#line 560 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY WAREHOUSE"); - } - WAREHOUSE->serialize(scriptSession_ptr->getLogger()); - } - ; - break;} -case 49: -#line 575 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - // display string to user - logger_ptr->text(LOG_SCRIPT, 1, scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - - ; - break;} -case 53: -#line 602 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!sendAcse(scriptSession_ptr, associateRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 54: -#line 609 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!sendAcse(scriptSession_ptr, associateAc_ptr, identifier)) YYABORT; - } - ; - break;} -case 55: -#line 616 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!sendAcse(scriptSession_ptr, associateRj_ptr, identifier)) YYABORT; - } - ; - break;} -case 56: -#line 623 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!sendAcse(scriptSession_ptr, releaseRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 57: -#line 630 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!sendAcse(scriptSession_ptr, releaseRp_ptr, identifier)) YYABORT; - } - ; - break;} -case 58: -#line 637 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!sendAcse(scriptSession_ptr, abortRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 59: -#line 646 "script_parser.y" -{ - if (!scriptParseOnly) - { - /* Try to find the command object in the warehouse and send it */ - LOG_CLASS* logger_ptr = scriptSession_ptr->getLogger(); - DCM_COMMAND_CLASS* cmd_ptr = 0; - cmd_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - identifier.c_str(), - WAREHOUSE->dimse2widtype(commandField))); - if (cmd_ptr) - { - if (scriptIsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - resolveVTSUidMappings(cmd_ptr); - } - - if (!sendSop(scriptSession_ptr, cmd_ptr, 0)) - { - YYABORT; - } - - - } - else - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 2, "Can't send command object %s, because it has not been created!", - identifier.c_str()); - } - } - } - ; - break;} -case 60: -#line 681 "script_parser.y" -{ - if (!scriptParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = scriptSession_ptr->getLogger(); - DCM_COMMAND_CLASS* cmd_ptr = 0; - cmd_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - identifier.c_str(), - WAREHOUSE->dimse2widtype(commandField))); - DCM_DATASET_CLASS* data_ptr = 0; - data_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - datasetidentifier.c_str(), - WID_DATASET)); - if (!cmd_ptr) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 2, "Can't send command object %s, because it has not been created!", - identifier.c_str()); - } - } - if (!data_ptr) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 2, "Can't send dataset object %s, because it has not been created!", - datasetidentifier.c_str()); - } - } - - if (cmd_ptr && data_ptr) - { - if (scriptIsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(scriptSession_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 61: -#line 729 "script_parser.y" -{ - if (!scriptParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = scriptSession_ptr->getLogger(); - DCM_COMMAND_CLASS* cmd_ptr = 0; - cmd_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - identifier.c_str(), - WAREHOUSE->dimse2widtype(commandField))); - DCM_DATASET_CLASS* data_ptr = 0; - data_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - datasetidentifier.c_str(), - WID_DATASET)); - if (!cmd_ptr) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 2, "Can't send command object %s, because it has not been created!", - identifier.c_str()); - } - } - if (!data_ptr) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 2, "Can't send dataset object %s, because it has not been created!", - datasetidentifier.c_str()); - } - } - - if (cmd_ptr && data_ptr) - { - cmd_ptr->setEncodePresentationContextId(presContextId); - data_ptr->setEncodePresentationContextId(presContextId); - presContextId = 0; - - if (scriptIsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(scriptSession_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 63: -#line 786 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!importCommand(scriptSession_ptr, commandField, identifier)) - { - YYABORT; - } - } - ; - break;} -case 64: -#line 796 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!importCommandDataset(scriptSession_ptr, commandField, identifier, iodName, datasetidentifier)) - { - YYABORT; - } - } - ; - break;} -case 65: -#line 808 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setPopulateWithAttributes(true); - } - } - ; - break;} -case 66: -#line 825 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setPopulateWithAttributes(false); - } - } - ; - break;} -case 69: -#line 850 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // set product role based on new setting for tool - if (scriptvsp[0].userProvider == UP_REQUESTOR) - { - // tool role is now Requestor - // - product is therefore Acceptor - scriptSession_ptr->setProductRoleIsRequestor(false); - scriptSession_ptr->setProductRoleIsAcceptor(true); - } - else - { - // tool role is now Acceptor - // - product is therefore Requestor - scriptSession_ptr->setProductRoleIsRequestor(true); - scriptSession_ptr->setProductRoleIsAcceptor(false); - } - - if (logger_ptr) - { - if (scriptvsp[0].userProvider == UP_REQUESTOR) - { - logger_ptr->text(LOG_SCRIPT, 2, "DVT ROLE REQUESTOR - PRODUCT ROLE ACCEPTOR"); - } - else - { - logger_ptr->text(LOG_SCRIPT, 2, "DVT ROLE ACCEPTOR - PRODUCT ROLE REQUESTOR"); - } - } - } - ; - break;} -case 72: -#line 893 "script_parser.y" -{ - if (!scriptParseOnly) - { - // make system call within session - if (!systemCall(scriptSession_ptr, scriptvsp[0].string_ptr)) - { - YYABORT; - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 73: -#line 909 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - static time_t tprv=0; - time_t tnew; - - // get the time from the system - time(&tnew); - if (logger_ptr) - { - // on first call just display time now - if (tprv == 0) - { - logger_ptr->text(LOG_SCRIPT, 2, "TIME %s", ctime(&tnew)); - } - else - { - // on further calls display time now and difference since last call - logger_ptr->text(LOG_SCRIPT, 2, "TIME %s (+%ld sec.)", ctime(&tnew), tnew-tprv); - } - } - tprv = tnew; - } - ; - break;} -case 75: -#line 941 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE ON"); - } - - // ignore command in debug mode - if (scriptSession_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE ON"); - } - } - else - { - // enable the logger -// scriptSession_ptr->enableLogger(); - - // resume the serializer -// BASE_SERIALIZER *serializer_ptr = scriptSession_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Resume(); -// } - } - } - ; - break;} -case 76: -#line 973 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE OFF"); - } - - // ignore command in debug mode - if (scriptSession_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE OFF"); - } - } - else - { - // disable the logger -// scriptSession_ptr->disableLogger(); - - // pause the serializer -// BASE_SERIALIZER *serializer_ptr = scriptSession_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Pause(); -// } - } - } - ; - break;} -case 78: -#line 1010 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "APPLICATION-ENTITY %s %s", scriptvsp[-1].string_ptr, scriptvsp[0].string_ptr); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setApplicationEntityName(scriptvsp[-1].string_ptr); - scriptExecutionContext_ptr->setApplicationEntityVersion(scriptvsp[0].string_ptr); - } - } - // free malloced string buffers - free(scriptvsp[-1].string_ptr); - scriptvsp[-1].string_ptr = NULL; - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - - ; - break;} -case 79: -#line 1036 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - switch(scriptvsp[0].validationFlag) - { - case ALL: logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED"); break; - case USE_DEFINITION: logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-ONLY"); break; - case USE_VR: logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-VR-ONLY"); break; - case USE_REFERENCE: logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-REF-ONLY"); break; - case NONE: logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION DISABLED"); break; - default: - if (scriptvsp[0].validationFlag == (USE_DEFINITION | USE_VR)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-VR"); - else if (scriptvsp[0].validationFlag == (USE_DEFINITION | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-REF"); - else if (scriptvsp[0].validationFlag == (USE_VR | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-VR-AND-REF"); - break; - } - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setValidationFlag(scriptvsp[0].validationFlag); - } - } - ; - break;} -case 80: -#line 1067 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setDefineSqLength(true); - } - } - ; - break;} -case 81: -#line 1084 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setDefineSqLength(false); - } - } - ; - break;} -case 82: -#line 1103 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setAddGroupLength(true); - } - } - ; - break;} -case 83: -#line 1120 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setAddGroupLength(false); - } - } - ; - break;} -case 84: -#line 1139 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setStrictValidation(true); - } - } - ; - break;} -case 85: -#line 1156 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *scriptExecutionContext_ptr = scriptSession_ptr->getScriptExecutionContext(); - if (scriptExecutionContext_ptr) - { - scriptExecutionContext_ptr->setStrictValidation(false); - } - } - ; - break;} -case 86: -#line 1175 "script_parser.y" -{ - if (!scriptParseOnly) - { - BASE_WAREHOUSE_ITEM_DATA_CLASS *wid_ptr = NULL; - - // generate the warehouse item data type - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - wid_ptr = static_cast(associateRq_ptr); - break; - case PDU_ASSOCIATE_AC: - wid_ptr = static_cast(associateAc_ptr); - break; - case PDU_ASSOCIATE_RJ: - wid_ptr = static_cast(associateRj_ptr); - break; - case PDU_RELEASE_RQ: - wid_ptr = static_cast(releaseRq_ptr); - break; - case PDU_RELEASE_RP: - wid_ptr = static_cast(releaseRp_ptr); - break; - case PDU_ABORT_RQ: - wid_ptr = static_cast(abortRq_ptr); - break; - case PDU_UNKNOWN: - wid_ptr = static_cast(unknownPdu_ptr); - break; - default: break; - } - - if (wid_ptr) - { - if (!storeObjectInWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 87: -#line 1214 "script_parser.y" -{ - if (!scriptParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = scriptSession_ptr->getSerializer(); - if (serializer_ptr) - { - if ((command_ptr) && - (dataset_ptr)) - { - // serialize the command and dataset create - serializer_ptr->SerializeDSCreate(command_ptr->getIdentifier(), command_ptr, dataset_ptr->getIdentifier(), dataset_ptr); - } - else if (command_ptr) - { - // serialize the command create - serializer_ptr->SerializeDSCreate(command_ptr->getIdentifier(), command_ptr); - } - } - - if (command_ptr) - { - if (!storeObjectInWarehouse(scriptSession_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) YYABORT; - } - - if (dataset_ptr) - { - if (!command_ptr) - { - compareDatasetValueWithWarehouse(scriptSession_ptr->getLogger(), (char*)(iodName).c_str(), dataset_ptr); - } - - if (!storeObjectInWarehouse(scriptSession_ptr->getLogger(), dataset_ptr->getIdentifier(), dataset_ptr)) - { - YYABORT; - } - else - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if ((dataset_ptr->getIdentifier() == NULL) && - (logger_ptr)) - { - logger_ptr->text(LOG_WARNING, 1, "Unidentified Dataset added to Warehouse - beware!"); - } - } - } - } - ; - break;} -case 88: -#line 1264 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (dataset_ptr) - { - // morph the dataset into an item - DCM_ITEM_CLASS *item_ptr = new DCM_ITEM_CLASS(); - item_ptr->morph(dataset_ptr); - - // set defined length according to session setting - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // clean up - side effect of parser - delete dataset_ptr; - dataset_ptr = NULL; - - if (!storeObjectInWarehouse(scriptSession_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 89: -#line 1290 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (dataset_ptr) - { - // morph the dataset into an item - DCM_ITEM_CLASS *item_ptr = new DCM_ITEM_CLASS(); - item_ptr->morph(dataset_ptr); - - // indicate that the item should be encoded with a defined length - item_ptr->setDefinedLength(true); - - // clean up - side effect of parser - delete dataset_ptr; - dataset_ptr = NULL; - - if (!storeObjectInWarehouse(scriptSession_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 90: -#line 1311 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (dataset_ptr) - { - // set item handle name - if (item_handle_ptr) - { - // set the item handle name and identifier - item_handle_ptr->setName(dataset_ptr->getIodName()); - item_handle_ptr->setIdentifier(dataset_ptr->getIdentifier()); - - // cascade the logger - item_handle_ptr->setLogger(scriptSession_ptr->getLogger()); - - // use the item handle - if (item_handle_ptr->resolveReference() != NULL) - { - if (!storeObjectInWarehouse(scriptSession_ptr->getLogger(), item_handle_ptr->getIdentifier().c_str(), item_handle_ptr)) YYABORT; - } - else - { - // delete the unresolved item handle - delete item_handle_ptr; - } - - // clean up - side effect of parser - item_handle_ptr = NULL; - } - - // delete the dataset - delete dataset_ptr; - dataset_ptr = NULL; - } - } - ; - break;} -case 91: -#line 1348 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (fileHead_ptr) - { - if (!storeObjectInWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 92: -#line 1358 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (fileTail_ptr) - { - if (!storeObjectInWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 93: -#line 1370 "script_parser.y" -{ - if (!scriptParseOnly) - { - WID_ENUM wid = WID_UNKNOWN; - - // generate the warehouse item data type - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - wid = WID_ASSOCIATE_RQ; - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - wid = WID_ASSOCIATE_AC; - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - wid = WID_ASSOCIATE_RJ; - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - wid = WID_RELEASE_RQ; - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - wid = WID_RELEASE_RP; - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - wid = WID_ABORT_RQ; - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - wid = WID_UNKNOWN_PDU; - delete unknownPdu_ptr; - unknownPdu_ptr = NULL; - break; - default: break; - } - if (!removeObjectFromWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), wid)) YYABORT; - } - ; - break;} -case 94: -#line 1419 "script_parser.y" -{ - if (!scriptParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = scriptSession_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command delete - serializer_ptr->SerializeDSDeleteCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!removeObjectFromWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), command_ptr->getWidType())) YYABORT; - - // clean up - side effect of parser - delete command_ptr; - command_ptr = NULL; - } - ; - break;} -case 95: -#line 1438 "script_parser.y" -{ - if (!scriptParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = scriptSession_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the dataset delete - serializer_ptr->SerializeDSDeleteDataSet(dataset_ptr->getIdentifier(), dataset_ptr); - } - - // first try deleting as a dataset - leave explicit WID_DATASET in call - if (!removeObjectFromWarehouse(scriptSession_ptr->getLogger(), datasetidentifier.c_str(), WID_DATASET)) - { - // then try deleting as an item - leave explicit WID_ITEM in call - if (!removeObjectFromWarehouse(scriptSession_ptr->getLogger(), datasetidentifier.c_str(), WID_ITEM)) YYABORT; - } - - // clean up - side effect of parser - delete dataset_ptr; - dataset_ptr = NULL; - } - ; - break;} -case 96: -#line 1462 "script_parser.y" -{ - if (!scriptParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), WID_FILEHEAD)) YYABORT; - } - ; - break;} -case 97: -#line 1471 "script_parser.y" -{ - if (!scriptParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), WID_FILETAIL)) YYABORT; - } - ; - break;} -case 98: -#line 1482 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(scriptSession_ptr->getLogger(), scriptSession_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 99: -#line 1493 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(scriptSession_ptr->getLogger(), scriptSession_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 100: -#line 1506 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!readFileDataset(scriptSession_ptr, scriptvsp[-1].string_ptr, dataset_ptr)) YYABORT; - } - // free malloced string buffer - free(scriptvsp[-1].string_ptr); - scriptvsp[-1].string_ptr = NULL; - - ; - break;} -case 101: -#line 1517 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!readFileDataset(scriptSession_ptr, scriptvsp[-1].string_ptr, scriptvsp[0].hex)) YYABORT; - } - // free malloced string buffer - free(scriptvsp[-1].string_ptr); - scriptvsp[-1].string_ptr = NULL; - ; - break;} -case 102: -#line 1529 "script_parser.y" -{ - if (!scriptParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!receiveAcse(scriptSession_ptr, associateRq_ptr, identifier)) - { - clearValidationObjects(scriptSession_ptr); - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!receiveAcse(scriptSession_ptr, associateAc_ptr, identifier)) - { - clearValidationObjects(scriptSession_ptr); - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!receiveAcse(scriptSession_ptr, associateRj_ptr, identifier)) - { - clearValidationObjects(scriptSession_ptr); - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!receiveAcse(scriptSession_ptr, releaseRq_ptr, identifier)) - { - clearValidationObjects(scriptSession_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!receiveAcse(scriptSession_ptr, releaseRp_ptr, identifier)) - { - clearValidationObjects(scriptSession_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!receiveAcse(scriptSession_ptr, abortRq_ptr, identifier)) - { - clearValidationObjects(scriptSession_ptr); - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!receiveAcse(scriptSession_ptr, unknownPdu_ptr, identifier)) - { - clearValidationObjects(scriptSession_ptr); - YYABORT; - } - - // parser cleanup - delete unknownPdu_ptr; - unknownPdu_ptr = NULL; - break; - default: break; - } - } - ; - break;} -case 103: -#line 1616 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!receiveSop(scriptSession_ptr, command_ptr, dataset_ptr)) - { - clearValidationObjects(scriptSession_ptr); - YYABORT; - } - - // parser cleanup - delete command_ptr; - command_ptr = NULL; - delete dataset_ptr; - dataset_ptr = NULL; - } - ; - break;} -case 104: -#line 1635 "script_parser.y" -{ - if (!scriptParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!sendAcse(scriptSession_ptr, associateRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!sendAcse(scriptSession_ptr, associateAc_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!sendAcse(scriptSession_ptr, associateRj_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!sendAcse(scriptSession_ptr, releaseRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!sendAcse(scriptSession_ptr, releaseRp_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!sendAcse(scriptSession_ptr, abortRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!sendAcse(scriptSession_ptr, unknownPdu_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete unknownPdu_ptr; - unknownPdu_ptr = NULL; - break; - default: break; - } - } - ; - break;} -case 105: -#line 1715 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!sendSop(scriptSession_ptr, command_ptr, dataset_ptr)) - { - YYABORT; - } - - // parser cleanup - delete command_ptr; - command_ptr = NULL; - delete dataset_ptr; - dataset_ptr = NULL; - } - ; - break;} -case 106: -#line 1731 "script_parser.y" -{ - if (!scriptParseOnly) - { - // send command and dataset using the given presentation context id - if (command_ptr) - { - command_ptr->setEncodePresentationContextId(presContextId); - } - - if (dataset_ptr) - { - dataset_ptr->setEncodePresentationContextId(presContextId); - } - - presContextId = 0; - - if (!sendSop(scriptSession_ptr, command_ptr, dataset_ptr)) - { - YYABORT; - } - - // parser cleanup - delete command_ptr; - command_ptr = NULL; - delete dataset_ptr; - dataset_ptr = NULL; - } - ; - break;} -case 107: -#line 1762 "script_parser.y" -{ - if (!scriptParseOnly) - { - presContextId = (BYTE) scriptvsp[-1].hex; - } - ; - break;} -case 108: -#line 1769 "script_parser.y" -{ - if (!scriptParseOnly) - { - presContextId = (BYTE) scriptvsp[-1].integer; - } - ; - break;} -case 109: -#line 1778 "script_parser.y" -{ - if (!scriptParseOnly) - { - BASE_WAREHOUSE_ITEM_DATA_CLASS *wid_ptr = NULL; - - // generate the warehouse item data type - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - wid_ptr = static_cast(associateRq_ptr); - break; - case PDU_ASSOCIATE_AC: - wid_ptr = static_cast(associateAc_ptr); - break; - case PDU_ASSOCIATE_RJ: - wid_ptr = static_cast(associateRj_ptr); - break; - case PDU_RELEASE_RQ: - wid_ptr = static_cast(releaseRq_ptr); - break; - case PDU_RELEASE_RP: - wid_ptr = static_cast(releaseRp_ptr); - break; - case PDU_ABORT_RQ: - wid_ptr = static_cast(abortRq_ptr); - break; - case PDU_UNKNOWN: - wid_ptr = static_cast(unknownPdu_ptr); - break; - default: break; - } - - if (wid_ptr) - { - if (!updateObjectInWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 110: -#line 1817 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (command_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = scriptSession_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command set - serializer_ptr->SerializeDSSetCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!updateObjectInWarehouse(scriptSession_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "SET - Can't find COMMAND with id: %s in Data Warehouse", command_ptr->getIdentifier()); - } - - YYABORT; - } - } - } - ; - break;} -case 111: -#line 1844 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (dataset_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = scriptSession_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the dataset set - serializer_ptr->SerializeDSSetDataSet(dataset_ptr->getIdentifier(), dataset_ptr); - } - - // first try updating as a dataset - if (!updateObjectInWarehouse(scriptSession_ptr->getLogger(), dataset_ptr->getIdentifier(), dataset_ptr)) - { - // morph the dataset into an item - DCM_ITEM_CLASS *item_ptr = new DCM_ITEM_CLASS(); - item_ptr->morph(dataset_ptr); - - // set defined length according to session setting - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // then try updating as an item - if (!updateObjectInWarehouse(scriptSession_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "SET - Can't find DATASET/ITEM with id: %s in Data Warehouse", item_ptr->getIdentifier()); - } - - YYABORT; - } - } - } - } - ; - break;} -case 112: -#line 1888 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (fileHead_ptr) - { - if (!updateObjectInWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 113: -#line 1898 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (fileTail_ptr) - { - if (!updateObjectInWarehouse(scriptSession_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 114: -#line 1910 "script_parser.y" -{ - if (!scriptParseOnly) - { - // try to validate the Sop Class - if (!validateSopAgainstList(scriptSession_ptr, command_ptr, dataset_ptr)) - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(scriptSession_ptr); - YYABORT; - } - else - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(scriptSession_ptr); - } - } - ; - break;} -case 115: -#line 1934 "script_parser.y" -{ - if (!scriptParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = scriptSession_ptr->getLogger(); - - //re-initialize object pointers - command_ptr = 0; - dataset_ptr = 0; - command_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - identifier.c_str(), - WAREHOUSE->dimse2widtype(commandField))); - } - ; - break;} -case 116: -#line 1949 "script_parser.y" -{ - if (!scriptParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = scriptSession_ptr->getLogger(); - - //re-initialize object pointers - command_ptr = 0; - dataset_ptr = 0; - command_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - identifier.c_str(), - WAREHOUSE->dimse2widtype(commandField))); - - dataset_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - datasetidentifier.c_str(), - WID_DATASET)); - if (!command_ptr) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 2, "Can't validate command object %s, because it has not been created!", - identifier.c_str()); - } - } - if (!dataset_ptr) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 2, "Can't validate dataset object %s, because it has not been created!", - datasetidentifier.c_str()); - } - } - } - ; - break;} -case 118: -#line 1987 "script_parser.y" -{ - if (!scriptParseOnly) - { - addReferenceObjects(scriptSession_ptr,ref_command_ptr, ref_dataset_ptr, scriptSession_ptr->getLogger()); - } - ; - break;} -case 119: -#line 1994 "script_parser.y" -{ - if (!scriptParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(scriptSession_ptr,ref_command_ptr, ref_dataset_ptr, scriptSession_ptr->getLogger()); - } - ; - break;} -case 120: -#line 2004 "script_parser.y" -{ - if (!scriptParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = scriptSession_ptr->getLogger(); - - //re-initialize object pointers - ref_command_ptr = 0; - ref_dataset_ptr = 0; - ref_command_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - identifier.c_str(), - WAREHOUSE->dimse2widtype(commandField))); - } - ; - break;} -case 121: -#line 2019 "script_parser.y" -{ - if (!scriptParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = scriptSession_ptr->getLogger(); - - //re-initialize object pointers - ref_command_ptr = 0; - ref_dataset_ptr = 0; - ref_command_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - identifier.c_str(), - WAREHOUSE->dimse2widtype(commandField))); - - ref_dataset_ptr = static_cast(retrieveFromWarehouse(logger_ptr, - datasetidentifier.c_str(), - WID_DATASET)); - if (!ref_command_ptr) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 2, "Can't use reference command object %s, because it has not been created!", - identifier.c_str()); - } - } - if (!ref_dataset_ptr) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 2, "Can't use reference dataset object %s, because it has not been created!", - datasetidentifier.c_str()); - } - } - } - ; - break;} -case 122: -#line 2057 "script_parser.y" -{ - if (!scriptParseOnly) - { - // ensure that no command or dataset is defined - if (command_ptr) - { - delete command_ptr; - command_ptr = NULL; - } - - if (dataset_ptr) - { - delete dataset_ptr; - dataset_ptr = NULL; - } - } - ; - break;} -case 123: -#line 2075 "script_parser.y" -{ - if (!scriptParseOnly) - { - addReferenceObjects(scriptSession_ptr, command_ptr, dataset_ptr, scriptSession_ptr->getLogger()); - } - ; - break;} -case 124: -#line 2082 "script_parser.y" -{ - if (!scriptParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(scriptSession_ptr, command_ptr, dataset_ptr, scriptSession_ptr->getLogger()); - } - ; - break;} -case 125: -#line 2090 "script_parser.y" -{ - if (!scriptParseOnly) - { - setLogicalOperand(OPERAND_AND); - addReferenceObjects(scriptSession_ptr, command_ptr, dataset_ptr, scriptSession_ptr->getLogger()); - } - ; - break;} -case 126: -#line 2100 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!writeFileHead(scriptSession_ptr->getLogger(), scriptvsp[-1].string_ptr, scriptSession_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(scriptvsp[-1].string_ptr); - scriptvsp[-1].string_ptr = NULL; - ; - break;} -case 127: -#line 2110 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!writeFileTail(scriptSession_ptr->getLogger(), scriptvsp[-1].string_ptr, scriptSession_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(scriptvsp[-1].string_ptr); - scriptvsp[-1].string_ptr = NULL; - ; - break;} -case 128: -#line 2120 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (!writeFileDataset(scriptSession_ptr->getLogger(), scriptvsp[-1].string_ptr, dataset_ptr,scriptSession_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(scriptvsp[-1].string_ptr); - scriptvsp[-1].string_ptr = NULL; - ; - break;} -case 142: -#line 2149 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store the user information - associateRq_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 145: -#line 2164 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set associate request protocol version parameter - associateRq_ptr->setProtocolVersion((UINT16) scriptvsp[0].integer); - } - ; - break;} -case 146: -#line 2172 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - if (strlen(scriptvsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", scriptvsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request called Ae title parameter - associateRq_ptr->setCalledAeTitle((char*) scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 147: -#line 2196 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - if (strlen(scriptvsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", scriptvsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request calling Ae title parameter - associateRq_ptr->setCallingAeTitle((char*) scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 148: -#line 2220 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // set associate request application context parameter - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - associateRq_ptr->setApplicationContextName((char*) uid.c_str()); - } - else - { - // store given uid - associateRq_ptr->setApplicationContextName((char*) scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 150: -#line 2245 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) scriptvsp[0].integer); - } - ; - break;} -case 151: -#line 2253 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 152: -#line 2277 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) scriptvsp[0].string_ptr); - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 155: -#line 2291 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) scriptvsp[-1].integer, (UINT16) scriptvsp[0].integer); - } - ; - break;} -case 162: -#line 2311 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[-3].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) scriptvsp[-3].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", scriptvsp[-3].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - - // store the abstract syntax name - presRqContext.setAbstractSyntaxName(abstractSyntaxName); - - // add the presentation context to the associate request - associateRq_ptr->addPresentationContext(presRqContext); - - // free up the local presentation context - presRqContext.cleanup(); - presRqContext.setPresentationContextId(0); - } - ; - break;} -case 163: -#line 2358 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[-7].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[-7].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) scriptvsp[-7].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", scriptvsp[-7].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - - // store the presentation context id - presRqContext.setPresentationContextId((BYTE) scriptvsp[-9].integer); - - // store the abstract syntax name - presRqContext.setAbstractSyntaxName(abstractSyntaxName); - - // add the presentation context to the associate request - associateRq_ptr->addPresentationContext(presRqContext); - - // free up the local presentation context - presRqContext.cleanup(); - presRqContext.setPresentationContextId(0); - - int scuRole = scriptvsp[-5].integer; - int scpRole = scriptvsp[-3].integer; - - // check if roles explicitly defined by scripts - if ((scuRole != UNDEFINED_SCU_ROLE) && - (scpRole != UNDEFINED_SCP_ROLE)) - { - // handle scp scu role - scpScuRoleSelect.setUid(abstractSyntaxName.getUid()); - scpScuRoleSelect.setScuRole((BYTE) scuRole); - scpScuRoleSelect.setScpRole((BYTE) scpRole); - - // store scp scu role select - userInformation.addScpScuRoleSelect(scpScuRoleSelect); - } - } - // free malloced string buffer - free(scriptvsp[-7].string_ptr); - scriptvsp[-7].string_ptr = NULL; - ; - break;} -case 164: -#line 2427 "script_parser.y" -{ - if (!scriptParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 165: -#line 2435 "script_parser.y" -{ - if (!scriptParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 166: -#line 2445 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - transferSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - transferSyntaxName.setUid((char*) scriptvsp[0].string_ptr); - - // check that we now have a valid transfer syntax - if (!transferSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", scriptvsp[0].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 169: -#line 2487 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[-3].string_ptr); - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassExtended.setUid((char*) uid.c_str()); - } - else - { - // store given uid - sopClassExtended.setUid((char*) scriptvsp[-3].string_ptr); - - // check that we now have a valid transfer syntax - if (!sopClassExtended.isUidValid()) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", scriptvsp[-3].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - - // save the sop class extended information - userInformation.addSopClassExtended(sopClassExtended); - sopClassExtended.cleanup(); - } - // free malloced string buffer - free(scriptvsp[-3].string_ptr); - scriptvsp[-3].string_ptr = NULL; - ; - break;} -case 172: -#line 2533 "script_parser.y" -{ - if (!scriptParseOnly) - { - // handle application info bytes - sopClassExtended.addApplicationInformation((BYTE) scriptvsp[0].integer); - } - ; - break;} -case 175: -#line 2547 "script_parser.y" -{ - if (!scriptParseOnly) - { - UID_CLASS sopClassUid; - - convertHex(scriptvsp[-5].string_ptr); - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[-5].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassUid.set((char*) uid.c_str()); - } - else - { - // store given uid - sopClassUid.set((char*) scriptvsp[-5].string_ptr); - - // check that we now have a valid abstract syntax - if (!sopClassUid.isValid()) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", scriptvsp[-5].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - - // handle scp scu role - scpScuRoleSelect.setUid(sopClassUid); - scpScuRoleSelect.setScpRole((BYTE) scriptvsp[-3].integer); - scpScuRoleSelect.setScuRole((BYTE) scriptvsp[-1].integer); - - // store scp scu role select - userInformation.addScpScuRoleSelect(scpScuRoleSelect); - } - // free malloced string buffer - free(scriptvsp[-5].string_ptr); - scriptvsp[-5].string_ptr = NULL; - ; - break;} -case 176: -#line 2595 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) scriptvsp[-2].integer, (BYTE) scriptvsp[-1].integer, scriptvsp[0].string_ptr); - } - - // free malloced string buffer - free(scriptvsp[0].string_ptr); - ; - break;} -case 177: -#line 2606 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) scriptvsp[-3].integer, (BYTE) scriptvsp[-2].integer, scriptvsp[-1].string_ptr, scriptvsp[0].string_ptr); - } - - // free malloced string buffer - free(scriptvsp[-1].string_ptr); - free(scriptvsp[0].string_ptr); - ; - break;} -case 178: -#line 2618 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation(scriptvsp[0].string_ptr); - } - - // free malloced string buffer - free(scriptvsp[0].string_ptr); - ; - break;} -case 180: -#line 2632 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store the user information - associateAc_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 183: -#line 2647 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set associate accept protocol version parameter - associateAc_ptr->setProtocolVersion((UINT16) scriptvsp[0].integer); - } - ; - break;} -case 184: -#line 2655 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - if (strlen(scriptvsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", scriptvsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept called Ae title parameter - associateAc_ptr->setCalledAeTitle((char*) scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 185: -#line 2679 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - if (strlen(scriptvsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", scriptvsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept calling Ae title parameter - associateAc_ptr->setCallingAeTitle((char*) scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 186: -#line 2703 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // set associate accept application context parameter - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - associateAc_ptr->setApplicationContextName((char*) uid.c_str()); - } - else - { - // store given uid - associateAc_ptr->setApplicationContextName((char*) scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 188: -#line 2728 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) scriptvsp[0].integer); - } - ; - break;} -case 189: -#line 2736 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 190: -#line 2760 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) scriptvsp[0].string_ptr); - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 193: -#line 2774 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) scriptvsp[-1].integer, (UINT16) scriptvsp[0].integer); - } - ; - break;} -case 199: -#line 2793 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[-4].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[-4].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) scriptvsp[-4].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", scriptvsp[-4].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - - // store the abstract syntax name - presAcContext.setAbstractSyntaxName(abstractSyntaxName); - - // store the result - presAcContext.setResultReason((BYTE) scriptvsp[-2].integer); - - // store the transfer syntax name - presAcContext.setTransferSyntaxName(transferSyntaxName); - - // add the presentation context to the associate accept - associateAc_ptr->addPresentationContext(presAcContext); - - // free up the local presentation context - presAcContext.setPresentationContextId(0); - } - // free malloced string buffer - free(scriptvsp[-4].string_ptr); - scriptvsp[-4].string_ptr = NULL; - ; - break;} -case 200: -#line 2848 "script_parser.y" -{ - if (!scriptParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 202: -#line 2859 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[-2].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = scriptSession_ptr->getSopUid((char*) scriptvsp[-2].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) scriptvsp[-2].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", scriptvsp[-2].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - - // store the abstract syntax name - presAcContext.setAbstractSyntaxName(abstractSyntaxName); - - // store the presentation context id - presAcContext.setPresentationContextId((BYTE) scriptvsp[-6].integer); - - // store the result - presAcContext.setResultReason((BYTE) scriptvsp[-4].integer); - - // store the transfer syntax name - presAcContext.setTransferSyntaxName(transferSyntaxName); - - // add the presentation context to the associate accept - associateAc_ptr->addPresentationContext(presAcContext); - - // free up the local presentation context - presAcContext.setPresentationContextId(0); - - // handle scp scu role - if (((BYTE) scriptvsp[-4].integer == ACCEPTANCE) && - (assocAcScuScpRolesDefined)) - - { - // save abstract syntax name - scpScuRoleSelect.setUid(abstractSyntaxName.getUid()); - - // store scp scu role select - userInformation.addScpScuRoleSelect(scpScuRoleSelect); - } - } - // free malloced string buffer - free(scriptvsp[-2].string_ptr); - scriptvsp[-2].string_ptr = NULL; - ; - break;} -case 203: -#line 2929 "script_parser.y" -{ - if (!scriptParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 204: -#line 2937 "script_parser.y" -{ - if (!scriptParseOnly) - { - assocAcScuScpRolesDefined = false; - int scuRole = scriptvsp[-4].integer; - int scpRole = scriptvsp[-2].integer; - - // check if roles explicitly defined by scripts - if ((scuRole != UNDEFINED_SCU_ROLE) && - (scpRole != UNDEFINED_SCP_ROLE)) - { - // handle scp scu role - scpScuRoleSelect.setScuRole((BYTE) scuRole); - scpScuRoleSelect.setScpRole((BYTE) scpRole); - assocAcScuScpRolesDefined = true; - } - } - ; - break;} -case 209: -#line 2966 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set associate reject result parameter - associateRj_ptr->setResult((BYTE) scriptvsp[0].integer); - } - ; - break;} -case 210: -#line 2974 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set associate reject source parameter - associateRj_ptr->setSource((BYTE) scriptvsp[0].integer); - } - ; - break;} -case 211: -#line 2982 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set associate reject reason parameter - associateRj_ptr->setReason((BYTE) scriptvsp[0].integer); - } - ; - break;} -case 218: -#line 3006 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set abort request source parameter - abortRq_ptr->setSource((BYTE) scriptvsp[0].integer); - } - ; - break;} -case 219: -#line 3014 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set abort request reason parameter - abortRq_ptr->setReason((BYTE) scriptvsp[0].integer); - } - ; - break;} -case 220: -#line 3024 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set up default user information details - userInformation.setMaximumLengthReceived(UNDEFINED_MAXIMUM_LENGTH_RECEIVED); - userInformation.setImplementationClassUid((char*) ""); - userInformation.setImplementationVersionName((char*) ""); - - // set up test session associate request details - associateRq_ptr = new ASSOCIATE_RQ_CLASS(); - - // cascade the logger - associateRq_ptr->setLogger(scriptSession_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", scriptSession_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 221: -#line 3049 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set up default user information details - userInformation.setMaximumLengthReceived(UNDEFINED_MAXIMUM_LENGTH_RECEIVED); - userInformation.setImplementationClassUid((char*) ""); - userInformation.setImplementationVersionName((char*) ""); - - // set up test session associate accept details - associateAc_ptr = new ASSOCIATE_AC_CLASS(); - - // cascade the logger - associateAc_ptr->setLogger(scriptSession_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_AC; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", scriptSession_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 222: -#line 3074 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set up default associate reject details - associateRj_ptr = new ASSOCIATE_RJ_CLASS(); - - // cascade the logger - associateRj_ptr->setLogger(scriptSession_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RJ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", scriptSession_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 223: -#line 3094 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set up default release request details - releaseRq_ptr = new RELEASE_RQ_CLASS(); - - // cascade the logger - releaseRq_ptr->setLogger(scriptSession_ptr->getLogger()); - - acseType = PDU_RELEASE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", scriptSession_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 224: -#line 3114 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set up default release response details - releaseRp_ptr = new RELEASE_RP_CLASS(); - - // cascade the logger - releaseRp_ptr->setLogger(scriptSession_ptr->getLogger()); - - acseType = PDU_RELEASE_RP; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", scriptSession_ptr->getInstanceId()); - identifier = buffer; - - } - ; - break;} -case 225: -#line 3135 "script_parser.y" -{ - if (!scriptParseOnly) - { - // set up default abort request details - abortRq_ptr = new ABORT_RQ_CLASS(); - - // cascade the logger - abortRq_ptr->setLogger(scriptSession_ptr->getLogger()); - - acseType = PDU_ABORT_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", scriptSession_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 233: -#line 3168 "script_parser.y" -{ - if (!scriptParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField); - - // cascade the logger - command_ptr->setLogger(scriptSession_ptr->getLogger()); - dataset_ptr = NULL; - identifier = ""; - } - ; - break;} -case 234: -#line 3181 "script_parser.y" -{ - if (!scriptParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField, identifier); - - // cascade the logger - command_ptr->setLogger(scriptSession_ptr->getLogger()); - dataset_ptr = NULL; - } - ; - break;} -case 235: -#line 3195 "script_parser.y" -{ - if (!scriptParseOnly) - { - // save command field locally - commandField = scriptlval.commandField; - } - ; - break;} -case 236: -#line 3205 "script_parser.y" -{ - if (!scriptParseOnly) - { - // save identifier locally - identifier = scriptlval.identifier; - } - ; - break;} -case 242: -#line 3226 "script_parser.y" -{ - if (!scriptParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName); - - // cascade the logger - dataset_ptr->setLogger(scriptSession_ptr->getLogger()); - - bool addGroupLength = scriptSession_ptr->getAddGroupLength(); - bool populateWithAttributes = scriptSession_ptr->getAutoType2Attributes(); - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - addGroupLength = scriptSession_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = scriptSession_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - dataset_ptr->setDefineGroupLengths(addGroupLength); - dataset_ptr->setPopulateWithAttributes(populateWithAttributes); - dataset_ptr->setDefineSqLengths(definedLength); - - identifier = ""; - } - ; - break;} -case 243: -#line 3252 "script_parser.y" -{ - if (!scriptParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName, datasetidentifier); - - bool addGroupLength = scriptSession_ptr->getAddGroupLength(); - bool populateWithAttributes = scriptSession_ptr->getAutoType2Attributes(); - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - addGroupLength = scriptSession_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = scriptSession_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - dataset_ptr->setDefineGroupLengths(addGroupLength); - dataset_ptr->setPopulateWithAttributes(populateWithAttributes); - dataset_ptr->setDefineSqLengths(definedLength); - } - ; - break;} -case 244: -#line 3275 "script_parser.y" -{ - - ; - break;} -case 245: -#line 3279 "script_parser.y" -{ - ; - break;} -case 246: -#line 3284 "script_parser.y" -{ - // this rule introduces a shift/reduce warning in the parser - // - can't get rid of this due to sytax needed for backwards compatibility - ; - break;} -case 247: -#line 3291 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // save iod name locally - // - check first for iod name mapping - iodName = scriptSession_ptr->getIodName((char*) scriptvsp[0].string_ptr); - if (!iodName.length()) - { - // no name mapping - take iod name directly - iodName = (char*) scriptvsp[0].string_ptr; - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 248: -#line 3311 "script_parser.y" -{ - if (!scriptParseOnly) - { - // save identifier locally - datasetidentifier = scriptvsp[0].identifier; - } - ; - break;} -case 249: -#line 3319 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // save the identifier locally - datasetidentifier = scriptvsp[0].string_ptr; - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 250: -#line 3333 "script_parser.y" -{ - if (!scriptParseOnly) - { - // add attribute to local command or dataset - if ((group >= GROUP_TWO) && - (dataset_ptr)) - { - // save attribute in dataset - dataset_ptr->addAttribute(attribute_ptr[nd]); - } - else - { - // save attribute in command - command_ptr->addAttribute(attribute_ptr[nd]); - } - } - ; - break;} -case 251: -#line 3351 "script_parser.y" -{ - if (!scriptParseOnly) - { - // add attribute to local command or dataset - if ((group >= GROUP_TWO) && - (dataset_ptr)) - { - // save attribute in dataset - dataset_ptr->addAttribute(attribute_ptr[nd]); - } - else - { - // save attribute in command - command_ptr->addAttribute(attribute_ptr[nd]); - } - } - ; - break;} -case 253: -#line 3372 "script_parser.y" -{ - // attribute should be seen as deleted from the Command/Dataset - if (!scriptParseOnly) - { - // attribute deletion - // - instantiate a new attribute - attribute_ptr[nd] = new DCM_ATTRIBUTE_CLASS(group, element); - - // mark attribute as deleted - not present - attribute_ptr[nd]->SetPresent(false); - - // look up vr based on tag - need to look-up the VR in the definitions - vr = DEFINITION->GetAttributeVr(group, element); - - // store attribute vr - attribute_ptr[nd]->SetVR(vr); - - // cascade the logger - attribute_ptr[nd]->setLogger(scriptSession_ptr->getLogger()); - } - ; - break;} -case 254: -#line 3396 "script_parser.y" -{ - if (!scriptParseOnly) - { - // instantiate a new attribute - attribute_ptr[nd] = new DCM_ATTRIBUTE_CLASS(group, element); - - // cascade the logger - attribute_ptr[nd]->setLogger(scriptSession_ptr->getLogger()); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - attribute_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 255: -#line 3416 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store tag locally - group = (UINT16) (scriptlval.hex >> 16); - element = (UINT16) (scriptlval.hex & 0x0000FFFF); - } - ; - break;} -case 258: -#line 3431 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (nd == 0) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "DICOMScript SQ nesting corrupted"); - } - YYABORT; - } - - // clean up last (unused) item - delete item_ptr[nd]; - - // decrement nesting depth - nd--; - } - ; - break;} -case 259: -#line 3455 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // store vr locally - attribute_ptr[nd]->SetVR(ATTR_VR_SQ); - attribute_ptr[nd]->setDefinedLength(false); - sq_ptr[nd] = NULL; - - // increment nesting depth - nd++; - if (nd == MAX_ND) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "DICOMScript SQ nesting too deep - reached: %d", MAX_ND); - } - YYABORT; - } - - // instantiate the first item - item_ptr[nd] = new DCM_ITEM_CLASS(); - - // cascade the logger - item_ptr[nd]->setLogger(logger_ptr); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 260: -#line 3491 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // store vr locally - attribute_ptr[nd]->SetVR(ATTR_VR_SQ); - attribute_ptr[nd]->setDefinedLength(true); - sq_ptr[nd] = NULL; - - // increment nesting depth - nd++; - if (nd == MAX_ND) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "DICOMScript SQ nesting too deep - reached: %d", MAX_ND); - } - YYABORT; - } - - // instantiate the first item - item_ptr[nd] = new DCM_ITEM_CLASS(); - - // cascade the logger - item_ptr[nd]->setLogger(logger_ptr); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 263: -#line 3533 "script_parser.y" -{ - if (!scriptParseOnly) - { - // link item to parent sq attribute - // NOTE: Minus 1 here! - if (sq_ptr[nd - 1] == NULL) - { - sq_ptr[nd - 1] = new DCM_VALUE_SQ_CLASS(UNDEFINED_LENGTH); - - // cascade the logger - sq_ptr[nd - 1]->setLogger(scriptSession_ptr->getLogger()); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - sq_ptr[nd - 1]->setDefinedLength(definedLength); - - attribute_ptr[nd -1]->addSqValue(sq_ptr[nd -1]); - } - - // check that an item has been defined - could be a zero length SQ - if (item_ptr[nd]->getIdentifier()) - { - sq_ptr[nd - 1]->addItem(item_ptr[nd]); - - // instantiate the next item - item_ptr[nd] = new DCM_ITEM_CLASS(); - - // cascade the logger - item_ptr[nd]->setLogger(scriptSession_ptr->getLogger()); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 264: -#line 3576 "script_parser.y" -{ - if (!scriptParseOnly) - { - // link item to parent sq attribute - // NOTE: Minus 1 here! - if (sq_ptr[nd - 1] == NULL) - { - sq_ptr[nd - 1] = new DCM_VALUE_SQ_CLASS(UNDEFINED_LENGTH); - - // cascade the logger - sq_ptr[nd - 1]->setLogger(scriptSession_ptr->getLogger()); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - sq_ptr[nd - 1]->setDefinedLength(definedLength); - - attribute_ptr[nd -1]->addSqValue(sq_ptr[nd -1]); - } - // check that an item has been defined - could be a zero length SQ - if (item_ptr[nd]->getIdentifier()) - { - sq_ptr[nd - 1]->addItem(item_ptr[nd]); - - // instantiate the next item - item_ptr[nd] = new DCM_ITEM_CLASS(); - - // cascade the logger - item_ptr[nd]->setLogger(scriptSession_ptr->getLogger()); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 265: -#line 3620 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - // store item - identifier - item_ptr[nd]->setIdentifier(scriptvsp[0].string_ptr); - item_ptr[nd]->setValueByReference(true); - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 266: -#line 3635 "script_parser.y" -{ - if (!scriptParseOnly) - { - // link item to parent sq attribute - // NOTE: Minus 1 here! - if (sq_ptr[nd - 1] == NULL) - { - sq_ptr[nd - 1] = new DCM_VALUE_SQ_CLASS(UNDEFINED_LENGTH); - - // cascade the logger - sq_ptr[nd - 1]->setLogger(scriptSession_ptr->getLogger()); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - sq_ptr[nd - 1]->setDefinedLength(definedLength); - - attribute_ptr[nd -1]->addSqValue(sq_ptr[nd -1]); - } - sq_ptr[nd - 1]->addItem(item_ptr[nd]); - - // instantiate the next item - item_ptr[nd] = new DCM_ITEM_CLASS(); - - // cascade the logger - item_ptr[nd]->setLogger(scriptSession_ptr->getLogger()); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 267: -#line 3673 "script_parser.y" -{ - if (!scriptParseOnly) - { - // link item to parent sq attribute - // NOTE: Minus 1 here! - if (sq_ptr[nd - 1] == NULL) - { - sq_ptr[nd - 1] = new DCM_VALUE_SQ_CLASS(UNDEFINED_LENGTH); - - // cascade the logger - sq_ptr[nd - 1]->setLogger(scriptSession_ptr->getLogger()); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - sq_ptr[nd - 1]->setDefinedLength(definedLength); - - attribute_ptr[nd -1]->addSqValue(sq_ptr[nd -1]); - } - sq_ptr[nd - 1]->addItem(item_ptr[nd]); - - // instantiate the next item - item_ptr[nd] = new DCM_ITEM_CLASS(); - - // cascade the logger - item_ptr[nd]->setLogger(scriptSession_ptr->getLogger()); - - bool definedLength = scriptSession_ptr->getDefineSqLength(); - if (scriptSession_ptr->getScriptExecutionContext()) - { - definedLength = scriptSession_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 272: -#line 3721 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store item - attribute value - item_ptr[nd]->AddAttribute(attribute_ptr[nd]); - } - ; - break;} -case 274: -#line 3734 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - // look up vr based on tag - need to look-up the VR in the definitions - vr = DEFINITION->GetAttributeVr(group, element); - - if (vr == ATTR_VR_SQ) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Attribute VR of SQ must be specified explicity"); - logger_ptr->text(LOG_NONE, 1, "as (TAG, SQ, ...) - Script line no: %d", scriptlineno); - } - YYABORT; - } - else if (vr == ATTR_VR_UN) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Attribute (%04X,%04X) unknown in definitions - VR must be specified explicity", group, element); - logger_ptr->text(LOG_NONE, 1, "- on Script line no: %d", scriptlineno); - } - YYABORT; - } - - // store attribute vr - attribute_ptr[nd]->SetVR(vr); - attribute_ptr[nd]->setDefinedLength(false); - } - ; - break;} -case 275: -#line 3767 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store attribute vr - attribute_ptr[nd]->SetVR(vr); - attribute_ptr[nd]->setTransferVR(transferVr); - attribute_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 276: -#line 3779 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store vr, transfer vr & defined length locally - vr = scriptlval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = false; - } - ; - break;} -case 277: -#line 3789 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store vr, transfer vr & defined length locally - vr = scriptlval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = true; - } - ; - break;} -case 278: -#line 3799 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store vr, transfer vr & defined length locally - vr = scriptlval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = false; - } - ; - break;} -case 279: -#line 3809 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store vr, transfer vr & defined length locally - vr = scriptlval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = true; - } - ; - break;} -case 280: -#line 3819 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store vr, transfer vr & defined length locally - vr = scriptlval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = false; - } - ; - break;} -case 281: -#line 3829 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store vr, transfer vr & defined length locally - vr = scriptlval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = true; - } - ; - break;} -case 284: -#line 3845 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store attribute value - if (value_ptr != NULL) - { - // check if the attribute is Other Data and has values - if (((attribute_ptr[nd]->GetVR() == ATTR_VR_OB) || - (attribute_ptr[nd]->GetVR() == ATTR_VR_OF) || - (attribute_ptr[nd]->GetVR() == ATTR_VR_OW)) && - (attribute_ptr[nd]->GetNrValues() > 0)) - { - // get next data value and add to existing values - UINT32 data; - value_ptr->Get(data); - BASE_VALUE_CLASS *destValue_ptr = attribute_ptr[nd]->GetValue(0); - destValue_ptr->Add(data); - } - else - { - // add new attribute value - attribute_ptr[nd]->AddValue(value_ptr); - } - } - } - ; - break;} -case 285: -#line 3872 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store attribute value - if (value_ptr != NULL) - { - // check if the attribute is Other Data and has values - if (((attribute_ptr[nd]->GetVR() == ATTR_VR_OB) || - (attribute_ptr[nd]->GetVR() == ATTR_VR_OF) || - (attribute_ptr[nd]->GetVR() == ATTR_VR_OW)) && - (attribute_ptr[nd]->GetNrValues() > 0)) - { - // get next data value and add to existing values - UINT32 data; - value_ptr->Get(data); - BASE_VALUE_CLASS *destValue_ptr = attribute_ptr[nd]->GetValue(0); - destValue_ptr->Add(data); - } - else - { - // add new attribute value - attribute_ptr[nd]->AddValue(value_ptr); - } - } - } - ; - break;} -case 286: -#line 3901 "script_parser.y" -{ - if (!scriptParseOnly) - { - // special check for the Image Display Format ID / Pixel Data / FMI version attribute - // - these need to be handled differently for the ADVT scripts - if (((group == 0x2010) && - (element == 0x0010)) || - ((group == 0x7FE0) && - (element == 0x0010)) || - ((group == 0x0002) && - (element == 0x0001))) - { - convertDoubleBackslash(scriptvsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(scriptSession_ptr, scriptvsp[0].string_ptr, vr, group, element); - } - else if (vr == ATTR_VR_UN) - { - // although we have parsed a string from the DS Script - the UN value - // should be interpreted as a byte array - this can contain byte values of 0 - // (zero) which would normally be seen as a string terminator bu tin this - // case must be stored as part of the byte array - value_ptr = byteArrayValue(scriptvsp[0].string_ptr); - } - else - { - convertHex(scriptvsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(scriptSession_ptr, scriptvsp[0].string_ptr, vr, group, element); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 287: -#line 3939 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store hex attribute value locally - value_ptr = hexValue(scriptSession_ptr, scriptvsp[0].hex, vr, group, element); - } - ; - break;} -case 288: -#line 3947 "script_parser.y" -{ - if (!scriptParseOnly) - { - // store integer attribute value locally - value_ptr = integerValue(scriptSession_ptr, scriptvsp[0].integer, vr, group, element); - } - ; - break;} -case 289: -#line 3955 "script_parser.y" -{ - if (!scriptParseOnly) - { - // autoset attribute value - value_ptr = autoSetValue(scriptSession_ptr, vr, group, element); - } - ; - break;} -case 290: -#line 3964 "script_parser.y" -{ - if (!scriptParseOnly) - { - // copy tag to reference one - group1 = group; - element1 = element; - } - ; - break;} -case 291: -#line 3975 "script_parser.y" -{ - if (!scriptParseOnly) - { - // copy tag to reference two - group2 = group; - element2 = element; - } - ; - break;} -case 292: -#line 3986 "script_parser.y" -{ - ; - break;} -case 293: -#line 3989 "script_parser.y" -{ - if (!scriptParseOnly) - { - // look up tag by name and get group & element returned - group = 0; - element = 0; - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 294: -#line 4003 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid1_ptr = retrieveFromWarehouse(scriptSession_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr->getWidType()); - - if (wid1_ptr == NULL) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Can't find Command %s in Data Warehouse", command_ptr->getIdentifier()); - } - } - - // clean up - side effect of parser - delete command_ptr; - command_ptr = NULL; - } - } - ; - break;} -case 295: -#line 4028 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid1_ptr = retrieveFromWarehouse(scriptSession_ptr->getLogger(), dataset_ptr->getIdentifier(), dataset_ptr->getWidType()); - - //if we did not find the datset object try for an item - if (wid1_ptr == NULL) - { - wid1_ptr = retrieveFromWarehouse(scriptSession_ptr->getLogger(), dataset_ptr->getIdentifier(), WID_ITEM); - } - - // if we did not find the dataset object or item - try for an item handle - if (wid1_ptr == NULL) - { - wid1_ptr = retrieveFromWarehouse(scriptSession_ptr->getLogger(), dataset_ptr->getIdentifier(), WID_ITEM_HANDLE); - } - - if (wid1_ptr == NULL) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Can't find Dataset/Item %s in Data Warehouse", dataset_ptr->getIdentifier()); - } - } - - // clean up - side effect of parser - delete dataset_ptr; - dataset_ptr = NULL; - } - } - ; - break;} -case 296: -#line 4067 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid2_ptr = retrieveFromWarehouse(scriptSession_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr->getWidType()); - - if (wid2_ptr == NULL) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Can't find Command %s in Data Warehouse", command_ptr->getIdentifier()); - } - } - - // clean up - side effect of parser - delete command_ptr; - command_ptr = NULL; - } - } - ; - break;} -case 297: -#line 4092 "script_parser.y" -{ - if (!scriptParseOnly) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid2_ptr = retrieveFromWarehouse(scriptSession_ptr->getLogger(), dataset_ptr->getIdentifier(), dataset_ptr->getWidType()); - - // if we did not find the datset object try for an item - if (wid2_ptr == NULL) - { - wid2_ptr = retrieveFromWarehouse(scriptSession_ptr->getLogger(), dataset_ptr->getIdentifier(), WID_ITEM); - } - - // if we did not find the dataset object or item - try for an item handle - if (wid2_ptr == NULL) - { - wid2_ptr = retrieveFromWarehouse(scriptSession_ptr->getLogger(), dataset_ptr->getIdentifier(), WID_ITEM_HANDLE); - } - - if (wid2_ptr == NULL) - { - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Can't find Dataset/Item %s in Data Warehouse", dataset_ptr->getIdentifier()); - } - } - - // clean up - side effect of parser - delete dataset_ptr; - dataset_ptr = NULL; - } - } - ; - break;} -case 298: -#line 4131 "script_parser.y" -{ - if (!scriptParseOnly) - { - // ensure that we have an item handle - if (item_handle_ptr == NULL) - { - item_handle_ptr = new ITEM_HANDLE_CLASS(); - } - - // add the sequence reference to the item handle - SEQUENCE_REF_CLASS *sq_ref_ptr = new SEQUENCE_REF_CLASS(dataset_ptr->getIodName(), dataset_ptr->getIdentifier(), group, element, itemNumber); - item_handle_ptr->add(sq_ref_ptr); - - // delete the dataset - delete dataset_ptr; - dataset_ptr = NULL; - } - ; - break;} -case 299: -#line 4150 "script_parser.y" -{ - if (!scriptParseOnly) - { - // ensure that we have an item handle - if (item_handle_ptr == NULL) - { - item_handle_ptr = new ITEM_HANDLE_CLASS(); - } - - // add the sequence reference to the item handle - SEQUENCE_REF_CLASS *sq_ref_ptr = new SEQUENCE_REF_CLASS(group, element, itemNumber); - item_handle_ptr->add(sq_ref_ptr); - } - ; - break;} -case 300: -#line 4167 "script_parser.y" -{ - if (!scriptParseOnly) - { - // default Item Number is 1 - index is then zero - itemNumber = 0; - } - ; - break;} -case 301: -#line 4175 "script_parser.y" -{ - if (!scriptParseOnly) - { - // take given Item Number - index is one less - itemNumber = scriptvsp[-1].integer - 1; - } - ; - break;} -case 304: -#line 4189 "script_parser.y" -{ - if (!scriptParseOnly) - { - fileHead_ptr = new FILEHEAD_CLASS(); - - // cascade the logger - fileHead_ptr->setLogger(scriptSession_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 310: -#line 4212 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPreambleValue(scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 311: -#line 4228 "script_parser.y" -{ - if (!scriptParseOnly) - { - convertHex(scriptvsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPrefix(scriptvsp[0].string_ptr); - } - } - // free malloced string buffer - free(scriptvsp[0].string_ptr); - scriptvsp[0].string_ptr = NULL; - ; - break;} -case 312: -#line 4244 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (fileHead_ptr) - { - fileHead_ptr->setTransferSyntaxUid(transferSyntaxName.getUid()); - } - } - ; - break;} -case 315: -#line 4260 "script_parser.y" -{ - if (!scriptParseOnly) - { - fileTail_ptr = new FILETAIL_CLASS(); - - // cascade the logger - fileTail_ptr->setLogger(scriptSession_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 321: -#line 4283 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(true); - } - } - ; - break;} -case 322: -#line 4293 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(false); - } - } - ; - break;} -case 323: -#line 4305 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setSectorSize(scriptvsp[0].integer); - } - } - ; - break;} -case 324: -#line 4317 "script_parser.y" -{ - if (!scriptParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setPaddingValue((BYTE)scriptvsp[0].integer); - } - } - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "bison.simple" - - scriptvsp -= yylen; - scriptssp -= yylen; -#ifdef YYLSP_NEEDED - scriptlsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (scriptdebug) - { - short *ssp1 = scriptss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != scriptssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++scriptvsp = scriptval; - -#ifdef YYLSP_NEEDED - scriptlsp++; - if (yylen == 0) - { - scriptlsp->first_line = yylloc.first_line; - scriptlsp->first_column = yylloc.first_column; - scriptlsp->last_line = (scriptlsp-1)->last_line; - scriptlsp->last_column = (scriptlsp-1)->last_column; - scriptlsp->text = 0; - } - else - { - scriptlsp->last_line = (scriptlsp+yylen-1)->last_line; - scriptlsp->last_column = (scriptlsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = scriptr1[yyn]; - - scriptstate = scriptpgoto[yyn - YYNTBASE] + *scriptssp; - if (scriptstate >= 0 && scriptstate <= YYLAST && yycheck[scriptstate] == *scriptssp) - scriptstate = yytable[scriptstate]; - else - scriptstate = scriptdefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -scripterrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++scriptnerrs; - -#ifdef YYERROR_VERBOSE - yyn = scriptpact[scriptstate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - scripterror(msg); - free(msg); - } - else - scripterror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - scripterror("parse error"); - } - - goto scripterrlab1; -scripterrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (scriptchar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (scriptdebug) - fprintf(stderr, "Discarding token %d (%s).\n", scriptchar, yytname[scriptchar1]); -#endif - - scriptchar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = scriptdefact[scriptstate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto scriptdefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (scriptssp == scriptss) YYABORT; - scriptvsp--; - scriptstate = *--scriptssp; -#ifdef YYLSP_NEEDED - scriptlsp--; -#endif - -#if YYDEBUG != 0 - if (scriptdebug) - { - short *ssp1 = scriptss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != scriptssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = scriptpact[scriptstate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (scriptdebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++scriptvsp = scriptlval; -#ifdef YYLSP_NEEDED - *++scriptlsp = yylloc; -#endif - - scriptstate = yyn; - goto yynewstate; -} -#line 4327 "script_parser.y" - - diff --git a/DVTk_Library/Source/Libraries/Scripting/script_parser.cpp.h b/DVTk_Library/Source/Libraries/Scripting/script_parser.cpp.h deleted file mode 100644 index 3693af9..0000000 --- a/DVTk_Library/Source/Libraries/Scripting/script_parser.cpp.h +++ /dev/null @@ -1,98 +0,0 @@ -typedef union { - DIMSE_CMD_ENUM commandField; - unsigned long hex; - char identifier[MAX_ID_LEN]; - int integer; - IOM_LEVEL_ENUM iomLevel; - char *string_ptr; -// char string[MAX_STRING_LEN]; - UP_ENUM userProvider; - ATTR_VR_ENUM vr; - VALIDATION_CONTROL_FLAG_ENUM validationFlag; -} YYSTYPE; -#define T_LANGUAGE 258 -#define T_RESET 259 -#define T_ALL 260 -#define T_WAREHOUSE 261 -#define T_ASSOCIATION 262 -#define T_RELATION 263 -#define T_EXECUTION_CONTEXT 264 -#define T_COMPARE 265 -#define T_COMPARE_NOT 266 -#define T_CONFIRM 267 -#define T_COPY 268 -#define T_CREATE 269 -#define T_DELAY 270 -#define T_DELETE 271 -#define T_DISPLAY 272 -#define T_ECHO 273 -#define T_POPULATE 274 -#define T_READ 275 -#define T_RECEIVE 276 -#define T_ROLE 277 -#define T_SEND 278 -#define T_SET 279 -#define T_SYSTEM 280 -#define T_TIME 281 -#define T_VALIDATE 282 -#define T_VERBOSE 283 -#define T_WRITE 284 -#define T_IMPORT 285 -#define T_EXPORT 286 -#define T_VALIDATION 287 -#define T_DEF_SQ_LENGTH 288 -#define T_ADD_GROUP_LENGTH 289 -#define T_STRICT 290 -#define T_APPL_ENTITY 291 -#define T_ASSOCIATE_RQ 292 -#define T_ASSOCIATE_AC 293 -#define T_ASSOCIATE_RJ 294 -#define T_RELEASE_RQ 295 -#define T_RELEASE_RP 296 -#define T_ABORT_RQ 297 -#define T_PROT_VER 298 -#define T_CALLED_AE 299 -#define T_CALLING_AE 300 -#define T_APPL_CTX 301 -#define T_PRES_CTX 302 -#define T_MAX_LEN 303 -#define T_IMPL_CLASS 304 -#define T_IMPL_VER 305 -#define T_SOP_EXTEND_NEG 306 -#define T_SCPSCU_ROLE 307 -#define T_ASYNC_WINDOW 308 -#define T_USER_ID_NEG 309 -#define T_RESULT 310 -#define T_SOURCE 311 -#define T_REASON 312 -#define T_DEFINED_LENGTH 313 -#define T_AUTOSET 314 -#define T_FILEHEAD 315 -#define T_FILETAIL 316 -#define T_FILE_PREAMBLE 317 -#define T_DICOM_PREFIX 318 -#define T_TRANSFER_SYNTAX 319 -#define T_DATASET_TRAILING_PADDING 320 -#define T_SECTOR_SIZE 321 -#define T_PADDING_VALUE 322 -#define T_SQ 323 -#define T_OPEN_BRACKET 324 -#define T_CLOSE_BRACKET 325 -#define T_YES 326 -#define T_NO 327 -#define T_ON 328 -#define T_OFF 329 -#define T_OR 330 -#define T_AND 331 -#define COMMANDFIELD 332 -#define HEXADECIMAL 333 -#define IDENTIFIER 334 -#define INTEGER 335 -#define VALIDATIONFLAG 336 -#define IOMLEVEL 337 -#define STRING 338 -#define USERPROVIDER 339 -#define VR 340 - - -extern YYSTYPE scriptlval; diff --git a/DVTk_Library/Source/Libraries/Session/session_parser.cpp b/DVTk_Library/Source/Libraries/Session/session_parser.cpp deleted file mode 100644 index fa2acdc..0000000 --- a/DVTk_Library/Source/Libraries/Session/session_parser.cpp +++ /dev/null @@ -1,1717 +0,0 @@ - -/* A Bison parser, made from session_parser.y with Bison version GNU Bison version 1.24 - */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define T_SESSION 258 -#define T_ENDSESSION 259 -#define T_SESSION_FILE_VERSION 260 -#define T_SESSION_TYPE 261 -#define T_SESSION_TITLE 262 -#define T_SESSION_ID 263 -#define T_MANUFACT 264 -#define T_MODEL 265 -#define T_SOFTWARE 266 -#define T_TESTED 267 -#define T_DATE 268 -#define T_APPL_ENTITY_NAME 269 -#define T_APPL_ENTITY_VERSION 270 -#define T_PRODUCT_ROLE_ACCEPTOR 271 -#define T_PRODUCT_ROLE_REQUESTOR 272 -#define T_CALLED_AE 273 -#define T_CALLING_AE 274 -#define T_MAX_LEN 275 -#define T_IMPL_CLASS 276 -#define T_IMPL_VER 277 -#define T_REMOTE_HOST_NAME 278 -#define T_PORT 279 -#define T_REMOTE_PORT 280 -#define T_LOCAL_PORT 281 -#define T_SOCKET_TIMEOUT 282 -#define T_USE_SECURE_SOCKETS 283 -#define T_TLS_VERSION 284 -#define T_CHECK_REMOTE_CERTIFICATE 285 -#define T_CIPHER_LIST 286 -#define T_CACHE_TLS_SESSIONS 287 -#define T_TLS_CACHE_TIMEOUT 288 -#define T_DELAY 289 -#define T_CREDENTIALS_FILENAME 290 -#define T_CERTIFICATE_FILENAME 291 -#define T_VAL_RES 292 -#define T_DIMSE_MSG 293 -#define T_ACSE_MSG 294 -#define T_PDU_DUMP 295 -#define T_LABEL_DUMP 296 -#define T_IMAGE_SAVE 297 -#define T_STORAGE_MODE 298 -#define T_DEF_SQ_LENGTH 299 -#define T_ADD_GROUP_LENGTH 300 -#define T_SUPPORTED_TRANSFER_SYNTAX 301 -#define T_FORMAT 302 -#define T_STRICT 303 -#define T_DATA_DIRECTORY 304 -#define T_UN_VR_DEF_LOOKUP 305 -#define T_AUTO_TYPE 306 -#define T_AUTO_CREATE 307 -#define T_DEFINITION_DIRECTORY 308 -#define T_DEFINITION_ROOT 309 -#define T_DEFINITION 310 -#define T_DICOMSCRIPT_ROOT 311 -#define T_DICOMSCRIPT 312 -#define T_LOG_ERROR 313 -#define T_LOG_WARNING 314 -#define T_LOG_INFO 315 -#define T_LOG_RELATION 316 -#define T_LOG_DEBUG 317 -#define T_LOG_ACSE 318 -#define T_LOG_DICOM 319 -#define T_LOG_SCP_THREAD 320 -#define T_DULP_STATE 321 -#define T_CONTINUE 322 -#define T_DICOM_VAL_RES 323 -#define T_ACSE_VAL_RES 324 -#define T_RESULTS_ROOT 325 -#define T_DESCRIPTION_DIRECTORY 326 -#define T_APPEND_TO_FILE 327 -#define T_INCLUDE_PATH 328 -#define TRUE_OR_FALSE 329 -#define INTEGER 330 -#define STRING 331 -#define LOG_LEVEL 332 -#define SESSION_TYPE 333 -#define STORAGE_MODE 334 -#define SUT_ROLE 335 -#define T_ENSURE_EVEN_ATTRIBUTE_VALUE_LENGTH 336 -#define T_SUT_AE 337 -#define T_SUT_MAX_LEN 338 -#define T_SUT_IMPL_CLASS 339 -#define T_SUT_IMPL_VER 340 -#define T_SUT_HOSTNAME 341 -#define T_SUT_PORT 342 -#define T_SUT_ROLE 343 -#define T_DVT_AE 344 -#define T_DVT_MAX_LEN 345 -#define T_DVT_IMPL_CLASS 346 -#define T_DVT_IMPL_VER 347 -#define T_DVT_PORT 348 -#define T_DVT_SOCKET_TIMEOUT 349 -#define T_DETAILED_RESULTS 350 -#define T_SUMMARY_RESULTS 351 -#define T_INCLUDE_TYPE3_NOTPRESENT 352 -#define T_DUMP_ATTR_REFFILE 353 -#define T_PRIVATE_MAPPING 354 - -#line 1 "session_parser.y" - -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright © 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -//***************************************************************************** -// DESCRIPTION : Test Session Parser. -//***************************************************************************** - -//***************************************************************************** -// EXTERNAL DECLARATIONS -//***************************************************************************** -#include "Iglobal.h" // Global component interface -#include "Idefinition.h" -#include "Ilog.h" // Log component interface -#include "Iscripting.h" -#include "Iutility.h" // Utility component interface -#include "session.h" // Base Test Session - -extern void sessionerror(char*); -extern int sessionlex(void); -extern int sessionlineno; - -extern BASE_SESSION_CLASS *session_ptr; - - -#line 48 "session_parser.y" -typedef union { - bool trueOrFalse; - int integer; - char string[MAX_STRING_LEN]; - SESSION_TYPE_ENUM sessionType; - STORAGE_MODE_ENUM storageMode; - UP_ENUM sutRole; -} YYSTYPE; - -#ifndef YYLTYPE -typedef - struct yyltype - { - int timestamp; - int first_line; - int first_column; - int last_line; - int last_column; - char *text; - } - yyltype; - -#define YYLTYPE yyltype -#endif - -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 190 -#define YYFLAG -32768 -#define YYNTBASE 100 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 354 ? yytranslate[x] : 108) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 1, 3, 5, 8, 10, 14, 16, 18, 20, - 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, - 53, 56, 59, 62, 65, 68, 71, 74, 77, 80, - 83, 86, 89, 92, 95, 98, 101, 104, 107, 110, - 113, 116, 119, 122, 125, 128, 131, 134, 137, 140, - 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, - 173, 176, 179, 182, 185, 188, 191, 194, 197, 200, - 203, 206, 209, 212, 215, 218, 221, 224, 227, 230, - 233, 236, 239, 242, 245, 248, 251, 254, 257, 260, - 263, 266, 269, 272, 275, 278, 281, 284 -}; - -static const short yyrhs[] = { -1, - 101, 0, 102, 0, 101, 102, 0, 103, 0, 104, - 106, 105, 0, 3, 0, 4, 0, 107, 0, 106, - 107, 0, 5, 75, 0, 6, 78, 0, 7, 76, - 0, 8, 75, 0, 9, 76, 0, 10, 76, 0, - 11, 76, 0, 14, 76, 0, 15, 76, 0, 12, - 76, 0, 13, 76, 0, 16, 74, 0, 17, 74, - 0, 18, 76, 0, 19, 76, 0, 20, 75, 0, - 21, 76, 0, 22, 76, 0, 23, 76, 0, 24, - 75, 0, 25, 75, 0, 26, 75, 0, 27, 75, - 0, 82, 76, 0, 83, 75, 0, 84, 76, 0, - 85, 76, 0, 86, 76, 0, 87, 75, 0, 88, - 80, 0, 89, 76, 0, 90, 75, 0, 91, 76, - 0, 92, 76, 0, 93, 75, 0, 94, 75, 0, - 28, 74, 0, 29, 76, 0, 30, 74, 0, 31, - 76, 0, 32, 74, 0, 33, 75, 0, 34, 75, - 0, 35, 76, 0, 36, 76, 0, 37, 74, 0, - 38, 74, 0, 39, 74, 0, 40, 74, 0, 41, - 74, 0, 42, 74, 0, 44, 74, 0, 45, 74, - 0, 67, 74, 0, 46, 76, 0, 47, 74, 0, - 43, 79, 0, 48, 74, 0, 95, 74, 0, 96, - 74, 0, 97, 74, 0, 98, 74, 0, 99, 74, - 0, 51, 74, 0, 52, 74, 0, 81, 74, 0, - 58, 74, 0, 59, 74, 0, 60, 74, 0, 61, - 74, 0, 62, 74, 0, 64, 77, 0, 68, 77, - 0, 63, 77, 0, 65, 74, 0, 66, 74, 0, - 69, 77, 0, 53, 76, 0, 49, 76, 0, 50, - 74, 0, 54, 76, 0, 55, 76, 0, 56, 76, - 0, 57, 76, 0, 70, 76, 0, 71, 76, 0, - 72, 74, 0, 73, 76, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 66, 67, 70, 71, 74, 77, 80, 83, 86, 87, - 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, - 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, - 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, - 212, 216, 220, 224, 228, 232, 236, 240, 244, 248, - 252, 256, 260, 264, 268, 272, 276, 280, 284, 288, - 292, 303, 307, 311, 315, 319, 333, 337, 341, 345, - 349, 353, 357, 361, 365, 369, 373, 377, 381, 385, - 389, 393, 397, 401, 405, 409, 413, 417, 421, 425, - 429, 435, 463, 467, 478, 482, 486, 490 -}; - -static const char * const yytname[] = { "$","error","$undefined.","T_SESSION", -"T_ENDSESSION","T_SESSION_FILE_VERSION","T_SESSION_TYPE","T_SESSION_TITLE","T_SESSION_ID", -"T_MANUFACT","T_MODEL","T_SOFTWARE","T_TESTED","T_DATE","T_APPL_ENTITY_NAME", -"T_APPL_ENTITY_VERSION","T_PRODUCT_ROLE_ACCEPTOR","T_PRODUCT_ROLE_REQUESTOR", -"T_CALLED_AE","T_CALLING_AE","T_MAX_LEN","T_IMPL_CLASS","T_IMPL_VER","T_REMOTE_HOST_NAME", -"T_PORT","T_REMOTE_PORT","T_LOCAL_PORT","T_SOCKET_TIMEOUT","T_USE_SECURE_SOCKETS", -"T_TLS_VERSION","T_CHECK_REMOTE_CERTIFICATE","T_CIPHER_LIST","T_CACHE_TLS_SESSIONS", -"T_TLS_CACHE_TIMEOUT","T_DELAY","T_CREDENTIALS_FILENAME","T_CERTIFICATE_FILENAME", -"T_VAL_RES","T_DIMSE_MSG","T_ACSE_MSG","T_PDU_DUMP","T_LABEL_DUMP","T_IMAGE_SAVE", -"T_STORAGE_MODE","T_DEF_SQ_LENGTH","T_ADD_GROUP_LENGTH","T_SUPPORTED_TRANSFER_SYNTAX", -"T_FORMAT","T_STRICT","T_DATA_DIRECTORY","T_UN_VR_DEF_LOOKUP","T_AUTO_TYPE", -"T_AUTO_CREATE","T_DEFINITION_DIRECTORY","T_DEFINITION_ROOT","T_DEFINITION", -"T_DICOMSCRIPT_ROOT","T_DICOMSCRIPT","T_LOG_ERROR","T_LOG_WARNING","T_LOG_INFO", -"T_LOG_RELATION","T_LOG_DEBUG","T_LOG_ACSE","T_LOG_DICOM","T_LOG_SCP_THREAD", -"T_DULP_STATE","T_CONTINUE","T_DICOM_VAL_RES","T_ACSE_VAL_RES","T_RESULTS_ROOT", -"T_DESCRIPTION_DIRECTORY","T_APPEND_TO_FILE","T_INCLUDE_PATH","TRUE_OR_FALSE", -"INTEGER","STRING","LOG_LEVEL","SESSION_TYPE","STORAGE_MODE","SUT_ROLE","T_ENSURE_EVEN_ATTRIBUTE_VALUE_LENGTH", -"T_SUT_AE","T_SUT_MAX_LEN","T_SUT_IMPL_CLASS","T_SUT_IMPL_VER","T_SUT_HOSTNAME", -"T_SUT_PORT","T_SUT_ROLE","T_DVT_AE","T_DVT_MAX_LEN","T_DVT_IMPL_CLASS","T_DVT_IMPL_VER", -"T_DVT_PORT","T_DVT_SOCKET_TIMEOUT","T_DETAILED_RESULTS","T_SUMMARY_RESULTS", -"T_INCLUDE_TYPE3_NOTPRESENT","T_DUMP_ATTR_REFFILE","T_PRIVATE_MAPPING","Language", -"LanguageGrammar","LanguageComponents","Session","BeginSession","EndSession", -"SessionContentList","SessionContent","" -}; -#endif - -static const short sessionr1[] = { 0, - 100, 100, 101, 101, 102, 103, 104, 105, 106, 106, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 107 -}; - -static const short sessionr2[] = { 0, - 0, 1, 1, 2, 1, 3, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2 -}; - -static const short sessiondefact[] = { 1, - 7, 2, 3, 5, 0, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 9, 11, 12, 13, 14, - 15, 16, 17, 20, 21, 18, 19, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 67, 62, 63, 65, 66, 68, - 89, 90, 74, 75, 88, 91, 92, 93, 94, 77, - 78, 79, 80, 81, 84, 82, 85, 86, 64, 83, - 87, 95, 96, 97, 98, 76, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 69, - 70, 71, 72, 73, 8, 6, 10, 0, 0, 0 -}; - -static const short sessiondefgoto[] = { 188, - 2, 3, 4, 5, 186, 95, 96 -}; - -static const short sessionpact[] = { 67, --32768, 67,-32768,-32768, 91,-32768, -3, -7, -2, 0, - 89, 90, 92, 93, 94, 95, 115, -1, 2, 116, - 117, 119, 120, 121, 122, 124, 125, 126, 127, 129, - 128, 131, 130, 133, 134, 135, 132, 136, 137, 139, - 140, 141, 142, 143, 88, 144, 145, 146, 147, 149, - 148, 151, 152, 153, 154, 155, 156, 157, 158, 161, - 162, 163, 164, 165, 118, 166, 167, 168, 170, 169, - 171, 173, 174, 177, 176, 179, 178, 172, 180, 181, - 182, 184, 160, 185, 187, 188, 189, 191, 192, 186, - 194, 195, 196, 197, -4,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 220, 228,-32768 -}; - -static const short sessionpgoto[] = {-32768, --32768, 227,-32768,-32768,-32768,-32768, 150 -}; - - -#define YYLAST 271 - - -static const short yytable[] = { 185, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 1, - 98, 97, 108, 99, 100, 109, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 101, 102, 135, 103, 104, 105, - 106, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 107, 110, 111, 112, 155, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 127, 125, 126, - 129, 128, 130, 131, 132, 133, 134, 136, 137, 189, - 139, 138, 140, 141, 142, 143, 144, 190, 6, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 173, - 157, 158, 156, 159, 187, 160, 168, 161, 162, 163, - 164, 165, 166, 167, 0, 169, 170, 171, 172, 180, - 174, 175, 0, 176, 177, 178, 179, 181, 182, 183, - 184 -}; - -static const short yycheck[] = { 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 3, - 78, 75, 74, 76, 75, 74, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 76, 76, 79, 76, 76, 76, - 76, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 76, 76, 76, 75, 77, 76, 76, 76, 75, 75, - 75, 75, 74, 76, 74, 76, 74, 76, 75, 75, - 74, 76, 74, 74, 74, 74, 74, 74, 74, 0, - 74, 76, 74, 76, 74, 74, 74, 0, 2, 76, - 76, 76, 76, 76, 74, 74, 74, 74, 74, 80, - 74, 74, 77, 74, 95, 77, 75, 77, 76, 76, - 74, 76, 74, 76, -1, 76, 76, 76, 75, 74, - 76, 75, -1, 76, 76, 75, 75, 74, 74, 74, - 74 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "bison.simple" - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -#ifndef alloca -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) -#include -#else /* not sparc */ -#if defined (MSDOS) && !defined (__TURBOC__) -#include -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -#include - #pragma alloca -#else /* not MSDOS, __TURBOC__, or _AIX */ -#ifdef __hpux -#ifdef __cplusplus -extern "C" { -void *alloca (unsigned int); -}; -#else /* not __cplusplus */ -void *alloca (); -#endif /* not __cplusplus */ -#endif /* __hpux */ -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc. */ -#endif /* not GNU C. */ -#endif /* alloca not defined. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define sessionerrok (yyerrstatus = 0) -#define sessionclearin (sessionchar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto sessionerrlab1 -/* Like YYERROR except do call sessionerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto sessionerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (sessionchar == YYEMPTY && yylen == 1) \ - { sessionchar = (token), sessionlval = (value); \ - sessionchar1 = YYTRANSLATE (sessionchar); \ - YYPOPSTACK; \ - goto sessionbackup; \ - } \ - else \ - { sessionerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX sessionlex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX sessionlex(&sessionlval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX sessionlex(&sessionlval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX sessionlex(&sessionlval, YYLEX_PARAM) -#else -#define YYLEX sessionlex(&sessionlval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int sessionchar; /* the lookahead symbol */ -YYSTYPE sessionlval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int sessionnerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int sessiondebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -int sessionparse (void); -#endif - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (from, to, count) - char *from; - char *to; - int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *from, char *to, int count) -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 192 "bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into sessionparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#else -#define YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#endif - -int -sessionparse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL -{ - register int sessionstate; - register int yyn; - register short *sessionssp; - register YYSTYPE *sessionvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int sessionchar1 = 0; /* lookahead token as an internal (translated) token number */ - - short sessionssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE sessionvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *sessionss = sessionssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *sessionvs = sessionvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *sessionlsp; - -#define YYPOPSTACK (sessionvsp--, sessionssp--, sessionlsp--) -#else -#define YYPOPSTACK (sessionvsp--, sessionssp--) -#endif - - int sessionstacksize = YYINITDEPTH; - -#ifdef YYPURE - int sessionchar; - YYSTYPE sessionlval; - int sessionnerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE sessionval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (sessiondebug) - fprintf(stderr, "Starting parse\n"); -#endif - - sessionstate = 0; - yyerrstatus = 0; - sessionnerrs = 0; - sessionchar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - sessionssp = sessionss - 1; - sessionvsp = sessionvs; -#ifdef YYLSP_NEEDED - sessionlsp = yyls; -#endif - -/* Push a new state, which is found in sessionstate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++sessionssp = sessionstate; - - if (sessionssp >= sessionss + sessionstacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *sessionvs1 = sessionvs; - short *sessionss1 = sessionss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = sessionssp - sessionss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &sessionss1, size * sizeof (*sessionssp), - &sessionvs1, size * sizeof (*sessionvsp), - &yyls1, size * sizeof (*sessionlsp), - &sessionstacksize); -#else - yyoverflow("parser stack overflow", - &sessionss1, size * sizeof (*sessionssp), - &sessionvs1, size * sizeof (*sessionvsp), - &sessionstacksize); -#endif - - sessionss = sessionss1; sessionvs = sessionvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (sessionstacksize >= YYMAXDEPTH) - { - sessionerror("parser stack overflow"); - return 2; - } - sessionstacksize *= 2; - if (sessionstacksize > YYMAXDEPTH) - sessionstacksize = YYMAXDEPTH; - sessionss = (short *) alloca (sessionstacksize * sizeof (*sessionssp)); - __yy_memcpy ((char *)sessionss1, (char *)sessionss, size * sizeof (*sessionssp)); - sessionvs = (YYSTYPE *) alloca (sessionstacksize * sizeof (*sessionvsp)); - __yy_memcpy ((char *)sessionvs1, (char *)sessionvs, size * sizeof (*sessionvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (sessionstacksize * sizeof (*sessionlsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*sessionlsp)); -#endif -#endif /* no yyoverflow */ - - sessionssp = sessionss + size - 1; - sessionvsp = sessionvs + size - 1; -#ifdef YYLSP_NEEDED - sessionlsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (sessiondebug) - fprintf(stderr, "Stack size increased to %d\n", sessionstacksize); -#endif - - if (sessionssp >= sessionss + sessionstacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (sessiondebug) - fprintf(stderr, "Entering state %d\n", sessionstate); -#endif - - goto sessionbackup; - sessionbackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = sessionpact[sessionstate]; - if (yyn == YYFLAG) - goto sessiondefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* sessionchar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (sessionchar == YYEMPTY) - { -#if YYDEBUG != 0 - if (sessiondebug) - fprintf(stderr, "Reading a token: "); -#endif - sessionchar = YYLEX; - } - - /* Convert token to internal form (in sessionchar1) for indexing tables with */ - - if (sessionchar <= 0) /* This means end of input. */ - { - sessionchar1 = 0; - sessionchar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (sessiondebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - sessionchar1 = YYTRANSLATE(sessionchar); - -#if YYDEBUG != 0 - if (sessiondebug) - { - fprintf (stderr, "Next token is %d (%s", sessionchar, yytname[sessionchar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, sessionchar, sessionlval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += sessionchar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != sessionchar1) - goto sessiondefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto sessionerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto sessionerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (sessiondebug) - fprintf(stderr, "Shifting token %d (%s), ", sessionchar, yytname[sessionchar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (sessionchar != YYEOF) - sessionchar = YYEMPTY; - - *++sessionvsp = sessionlval; -#ifdef YYLSP_NEEDED - *++sessionlsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - sessionstate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -sessiondefault: - - yyn = sessiondefact[sessionstate]; - if (yyn == 0) - goto sessionerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = sessionr2[yyn]; - if (yylen > 0) - sessionval = sessionvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (sessiondebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[sessionr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 11: -#line 91 "session_parser.y" -{ - session_ptr->sessionFileVersion(sessionvsp[0].integer); - ; - break;} -case 12: -#line 95 "session_parser.y" -{ - session_ptr->setSessionType(sessionvsp[0].sessionType); - ; - break;} -case 13: -#line 99 "session_parser.y" -{ - session_ptr->setSessionTitle(sessionvsp[0].string); - ; - break;} -case 14: -#line 103 "session_parser.y" -{ - session_ptr->setSessionId(sessionvsp[0].integer); - ; - break;} -case 15: -#line 107 "session_parser.y" -{ - session_ptr->setManufacturer(sessionvsp[0].string); - ; - break;} -case 16: -#line 111 "session_parser.y" -{ - session_ptr->setModelName(sessionvsp[0].string); - ; - break;} -case 17: -#line 115 "session_parser.y" -{ - session_ptr->setSoftwareVersions(sessionvsp[0].string); - ; - break;} -case 18: -#line 119 "session_parser.y" -{ - session_ptr->setApplicationEntityName(sessionvsp[0].string); - ; - break;} -case 19: -#line 123 "session_parser.y" -{ - session_ptr->setApplicationEntityVersion(sessionvsp[0].string); - ; - break;} -case 20: -#line 127 "session_parser.y" -{ - session_ptr->setTestedBy(sessionvsp[0].string); - ; - break;} -case 21: -#line 131 "session_parser.y" -{ - session_ptr->setDate(sessionvsp[0].string); - ; - break;} -case 22: -#line 135 "session_parser.y" -{ - session_ptr->setProductRoleIsAcceptor(sessionvsp[0].trueOrFalse); - ; - break;} -case 23: -#line 139 "session_parser.y" -{ - session_ptr->setProductRoleIsRequestor(sessionvsp[0].trueOrFalse); - ; - break;} -case 24: -#line 143 "session_parser.y" -{ - session_ptr->setCalledAeTitle(sessionvsp[0].string); - ; - break;} -case 25: -#line 147 "session_parser.y" -{ - session_ptr->setCallingAeTitle(sessionvsp[0].string); - ; - break;} -case 26: -#line 151 "session_parser.y" -{ - session_ptr->setMaximumLengthReceived(sessionvsp[0].integer); - ; - break;} -case 27: -#line 155 "session_parser.y" -{ - session_ptr->setImplementationClassUid(sessionvsp[0].string); - ; - break;} -case 28: -#line 159 "session_parser.y" -{ - session_ptr->setImplementationVersionName(sessionvsp[0].string); - ; - break;} -case 29: -#line 163 "session_parser.y" -{ - session_ptr->setRemoteHostname(sessionvsp[0].string); - ; - break;} -case 30: -#line 167 "session_parser.y" -{ - // remain compatible with ADVT2.0 - session_ptr->setRemoteConnectPort((UINT16)sessionvsp[0].integer); - session_ptr->setLocalListenPort((UINT16)sessionvsp[0].integer); - ; - break;} -case 31: -#line 173 "session_parser.y" -{ - session_ptr->setRemoteConnectPort((UINT16)sessionvsp[0].integer); - ; - break;} -case 32: -#line 177 "session_parser.y" -{ - session_ptr->setLocalListenPort((UINT16)sessionvsp[0].integer); - ; - break;} -case 33: -#line 181 "session_parser.y" -{ - session_ptr->setSocketTimeout(sessionvsp[0].integer); - ; - break;} -case 34: -#line 185 "session_parser.y" -{ - session_ptr->setSutAeTitle(sessionvsp[0].string); - ; - break;} -case 35: -#line 189 "session_parser.y" -{ - session_ptr->setSutMaximumLengthReceived(sessionvsp[0].integer); - ; - break;} -case 36: -#line 193 "session_parser.y" -{ - session_ptr->setSutImplementationClassUid(sessionvsp[0].string); - ; - break;} -case 37: -#line 197 "session_parser.y" -{ - session_ptr->setSutImplementationVersionName(sessionvsp[0].string); - ; - break;} -case 38: -#line 201 "session_parser.y" -{ - session_ptr->setSutHostname(sessionvsp[0].string); - ; - break;} -case 39: -#line 205 "session_parser.y" -{ - session_ptr->setSutPort((UINT16)sessionvsp[0].integer); - ; - break;} -case 40: -#line 209 "session_parser.y" -{ - session_ptr->setSutRole(sessionvsp[0].sutRole); - ; - break;} -case 41: -#line 213 "session_parser.y" -{ - session_ptr->setDvtAeTitle(sessionvsp[0].string); - ; - break;} -case 42: -#line 217 "session_parser.y" -{ - session_ptr->setDvtMaximumLengthReceived(sessionvsp[0].integer); - ; - break;} -case 43: -#line 221 "session_parser.y" -{ - session_ptr->setDvtImplementationClassUid(sessionvsp[0].string); - ; - break;} -case 44: -#line 225 "session_parser.y" -{ - session_ptr->setDvtImplementationVersionName(sessionvsp[0].string); - ; - break;} -case 45: -#line 229 "session_parser.y" -{ - session_ptr->setDvtPort((UINT16)sessionvsp[0].integer); - ; - break;} -case 46: -#line 233 "session_parser.y" -{ - session_ptr->setDvtSocketTimeout(sessionvsp[0].integer); - ; - break;} -case 47: -#line 237 "session_parser.y" -{ - session_ptr->setUseSecureSockets(sessionvsp[0].trueOrFalse); - ; - break;} -case 48: -#line 241 "session_parser.y" -{ - session_ptr->setTlsVersion(sessionvsp[0].string); - ; - break;} -case 49: -#line 245 "session_parser.y" -{ - session_ptr->setCheckRemoteCertificate(sessionvsp[0].trueOrFalse); - ; - break;} -case 50: -#line 249 "session_parser.y" -{ - session_ptr->setCipherList(sessionvsp[0].string); - ; - break;} -case 51: -#line 253 "session_parser.y" -{ - session_ptr->setCacheTlsSessions(sessionvsp[0].trueOrFalse); - ; - break;} -case 52: -#line 257 "session_parser.y" -{ - session_ptr->setTlsCacheTimeout(sessionvsp[0].integer); - ; - break;} -case 53: -#line 261 "session_parser.y" -{ - session_ptr->setDelayForStorageCommitment(sessionvsp[0].integer); - ; - break;} -case 54: -#line 265 "session_parser.y" -{ - session_ptr->setCredentialsFilename(sessionvsp[0].string); - ; - break;} -case 55: -#line 269 "session_parser.y" -{ - session_ptr->setCertificateFilename(sessionvsp[0].string); - ; - break;} -case 56: -#line 273 "session_parser.y" -{ - // deprecated - ; - break;} -case 57: -#line 277 "session_parser.y" -{ - // deprecated - ; - break;} -case 58: -#line 281 "session_parser.y" -{ - // deprecated - ; - break;} -case 59: -#line 285 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_PDU_BYTES); - ; - break;} -case 60: -#line 289 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_LABEL); - ; - break;} -case 61: -#line 293 "session_parser.y" -{ - if (sessionvsp[0].trueOrFalse) - { - session_ptr->setStorageMode(SM_AS_MEDIA); - } - else - { - session_ptr->setStorageMode(SM_NO_STORAGE); - } - ; - break;} -case 62: -#line 304 "session_parser.y" -{ - session_ptr->setDefineSqLength(sessionvsp[0].trueOrFalse); - ; - break;} -case 63: -#line 308 "session_parser.y" -{ - session_ptr->setAddGroupLength(sessionvsp[0].trueOrFalse); - ; - break;} -case 64: -#line 312 "session_parser.y" -{ - session_ptr->setContinueOnError(sessionvsp[0].trueOrFalse); - ; - break;} -case 65: -#line 316 "session_parser.y" -{ - session_ptr->addSupportedTransferSyntax(sessionvsp[0].string); - ; - break;} -case 66: -#line 320 "session_parser.y" -{ - if (session_ptr->getStorageMode() != SM_NO_STORAGE) - { - if (sessionvsp[0].trueOrFalse) - { - session_ptr->setStorageMode(SM_AS_MEDIA); - } - else - { - session_ptr->setStorageMode(SM_AS_DATASET); - } - } - ; - break;} -case 67: -#line 334 "session_parser.y" -{ - session_ptr->setStorageMode(sessionvsp[0].storageMode); - ; - break;} -case 68: -#line 338 "session_parser.y" -{ - session_ptr->setStrictValidation(sessionvsp[0].trueOrFalse); - ; - break;} -case 69: -#line 342 "session_parser.y" -{ - session_ptr->setDetailedValidationResults(sessionvsp[0].trueOrFalse); - ; - break;} -case 70: -#line 346 "session_parser.y" -{ - session_ptr->setSummaryValidationResults(sessionvsp[0].trueOrFalse); - ; - break;} -case 71: -#line 350 "session_parser.y" -{ - session_ptr->setIncludeType3NotPresentInResults(sessionvsp[0].trueOrFalse); - ; - break;} -case 72: -#line 354 "session_parser.y" -{ - session_ptr->setDumpAttributesOfRefFiles(sessionvsp[0].trueOrFalse); - ; - break;} -case 73: -#line 358 "session_parser.y" -{ - BASE_SESSION_CLASS::setUsePrivateAttributeMapping(sessionvsp[0].trueOrFalse); - ; - break;} -case 74: -#line 362 "session_parser.y" -{ - session_ptr->setAutoType2Attributes(sessionvsp[0].trueOrFalse); - ; - break;} -case 75: -#line 366 "session_parser.y" -{ - session_ptr->setAutoCreateDirectory(sessionvsp[0].trueOrFalse); - ; - break;} -case 76: -#line 370 "session_parser.y" -{ - session_ptr->setEnsureEvenAttributeValueLength(sessionvsp[0].trueOrFalse); - ; - break;} -case 77: -#line 374 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_ERROR); - ; - break;} -case 78: -#line 378 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_WARNING); - ; - break;} -case 79: -#line 382 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_INFO); - ; - break;} -case 80: -#line 386 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_IMAGE_RELATION); - ; - break;} -case 81: -#line 390 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_DEBUG); - ; - break;} -case 82: -#line 394 "session_parser.y" -{ - // deprecated - ; - break;} -case 83: -#line 398 "session_parser.y" -{ - // deprecated - ; - break;} -case 84: -#line 402 "session_parser.y" -{ - // deprecated - ; - break;} -case 85: -#line 406 "session_parser.y" -{ - session_ptr->setLogScpThread(sessionvsp[0].trueOrFalse); - ; - break;} -case 86: -#line 410 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_DULP_FSM); - ; - break;} -case 87: -#line 414 "session_parser.y" -{ - // deprecated - ; - break;} -case 88: -#line 418 "session_parser.y" -{ - session_ptr->addDefinitionDirectory(sessionvsp[0].string); - ; - break;} -case 89: -#line 422 "session_parser.y" -{ - session_ptr->setDataDirectory(sessionvsp[0].string); - ; - break;} -case 90: -#line 426 "session_parser.y" -{ - session_ptr->setUnVrDefinitionLookUp(sessionvsp[0].trueOrFalse); - ; - break;} -case 91: -#line 430 "session_parser.y" -{ - // no longer used in DVT V2.x - // maintained for backwards compatiblity with DVT V1.x - session_ptr->setDefinitionFileRoot(sessionvsp[0].string); - ; - break;} -case 92: -#line 436 "session_parser.y" -{ - string definitionFile((char*) sessionvsp[0].string); - bool exists = false; - for (int index = 0; index < session_ptr->noDefinitionFiles(); index++) - { - const char* pDefFileName = session_ptr->getDefinitionFilename(index); - if (strcmp(pDefFileName, sessionvsp[0].string) == 0) - { - exists = true; - break; - } - } - if (!exists) - { - DEFINITION_FILE_CLASS *definitionFile_ptr = new DEFINITION_FILE_CLASS(session_ptr, definitionFile); - - // for backwards compatibility with DVT V1.x we need to check if the - // character set or image display format files are being defined in the session - // file - string pathname = definitionFile_ptr->getAbsoluteFilename(); - if ((pathname.find(DVT_V1_CHARACTER_SET_DEFINITION_FILENAME) == pathname.npos) && - (pathname.find(DVT_V1_IMAGE_DISPLAY_FORMAT_DEFINITION_FILENAME) == pathname.npos)) - { - session_ptr->addDefinitionFile(definitionFile_ptr); - } - } - ; - break;} -case 93: -#line 464 "session_parser.y" -{ - session_ptr->setDicomScriptRoot(sessionvsp[0].string); - ; - break;} -case 94: -#line 468 "session_parser.y" -{ - // only store this information in a Scripting session - if (session_ptr->getRuntimeSessionType() == ST_SCRIPT) - { - // should check that file extension is OK - string dicomScript((char*) sessionvsp[0].string); - DICOM_SCRIPT_CLASS *dicomScript_ptr = new DICOM_SCRIPT_CLASS(reinterpret_cast(session_ptr), dicomScript); - session_ptr->addDicomScript(dicomScript_ptr); - } - ; - break;} -case 95: -#line 479 "session_parser.y" -{ - session_ptr->setResultsRoot(sessionvsp[0].string); - ; - break;} -case 96: -#line 483 "session_parser.y" -{ - session_ptr->setDescriptionDirectory(sessionvsp[0].string); - ; - break;} -case 97: -#line 487 "session_parser.y" -{ - session_ptr->setAppendToResultsFile(sessionvsp[0].trueOrFalse); - ; - break;} -case 98: -#line 491 "session_parser.y" -{ - // deprecated - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "bison.simple" - - sessionvsp -= yylen; - sessionssp -= yylen; -#ifdef YYLSP_NEEDED - sessionlsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (sessiondebug) - { - short *ssp1 = sessionss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != sessionssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++sessionvsp = sessionval; - -#ifdef YYLSP_NEEDED - sessionlsp++; - if (yylen == 0) - { - sessionlsp->first_line = yylloc.first_line; - sessionlsp->first_column = yylloc.first_column; - sessionlsp->last_line = (sessionlsp-1)->last_line; - sessionlsp->last_column = (sessionlsp-1)->last_column; - sessionlsp->text = 0; - } - else - { - sessionlsp->last_line = (sessionlsp+yylen-1)->last_line; - sessionlsp->last_column = (sessionlsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = sessionr1[yyn]; - - sessionstate = sessionpgoto[yyn - YYNTBASE] + *sessionssp; - if (sessionstate >= 0 && sessionstate <= YYLAST && yycheck[sessionstate] == *sessionssp) - sessionstate = yytable[sessionstate]; - else - sessionstate = sessiondefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -sessionerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++sessionnerrs; - -#ifdef YYERROR_VERBOSE - yyn = sessionpact[sessionstate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - sessionerror(msg); - free(msg); - } - else - sessionerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - sessionerror("parse error"); - } - - goto sessionerrlab1; -sessionerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (sessionchar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (sessiondebug) - fprintf(stderr, "Discarding token %d (%s).\n", sessionchar, yytname[sessionchar1]); -#endif - - sessionchar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = sessiondefact[sessionstate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto sessiondefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (sessionssp == sessionss) YYABORT; - sessionvsp--; - sessionstate = *--sessionssp; -#ifdef YYLSP_NEEDED - sessionlsp--; -#endif - -#if YYDEBUG != 0 - if (sessiondebug) - { - short *ssp1 = sessionss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != sessionssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = sessionpact[sessionstate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (sessiondebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++sessionvsp = sessionlval; -#ifdef YYLSP_NEEDED - *++sessionlsp = yylloc; -#endif - - sessionstate = yyn; - goto yynewstate; -} -#line 495 "session_parser.y" - - - diff --git a/DVTk_Library/Source/Libraries/Session/session_parser.cpp.h b/DVTk_Library/Source/Libraries/Session/session_parser.cpp.h deleted file mode 100644 index 7c206ff..0000000 --- a/DVTk_Library/Source/Libraries/Session/session_parser.cpp.h +++ /dev/null @@ -1,108 +0,0 @@ -typedef union { - bool trueOrFalse; - int integer; - char string[MAX_STRING_LEN]; - SESSION_TYPE_ENUM sessionType; - STORAGE_MODE_ENUM storageMode; - UP_ENUM sutRole; -} YYSTYPE; -#define T_SESSION 258 -#define T_ENDSESSION 259 -#define T_SESSION_FILE_VERSION 260 -#define T_SESSION_TYPE 261 -#define T_SESSION_TITLE 262 -#define T_SESSION_ID 263 -#define T_MANUFACT 264 -#define T_MODEL 265 -#define T_SOFTWARE 266 -#define T_TESTED 267 -#define T_DATE 268 -#define T_APPL_ENTITY_NAME 269 -#define T_APPL_ENTITY_VERSION 270 -#define T_PRODUCT_ROLE_ACCEPTOR 271 -#define T_PRODUCT_ROLE_REQUESTOR 272 -#define T_CALLED_AE 273 -#define T_CALLING_AE 274 -#define T_MAX_LEN 275 -#define T_IMPL_CLASS 276 -#define T_IMPL_VER 277 -#define T_REMOTE_HOST_NAME 278 -#define T_PORT 279 -#define T_REMOTE_PORT 280 -#define T_LOCAL_PORT 281 -#define T_SOCKET_TIMEOUT 282 -#define T_USE_SECURE_SOCKETS 283 -#define T_TLS_VERSION 284 -#define T_CHECK_REMOTE_CERTIFICATE 285 -#define T_CIPHER_LIST 286 -#define T_CACHE_TLS_SESSIONS 287 -#define T_TLS_CACHE_TIMEOUT 288 -#define T_DELAY 289 -#define T_CREDENTIALS_FILENAME 290 -#define T_CERTIFICATE_FILENAME 291 -#define T_VAL_RES 292 -#define T_DIMSE_MSG 293 -#define T_ACSE_MSG 294 -#define T_PDU_DUMP 295 -#define T_LABEL_DUMP 296 -#define T_IMAGE_SAVE 297 -#define T_STORAGE_MODE 298 -#define T_DEF_SQ_LENGTH 299 -#define T_ADD_GROUP_LENGTH 300 -#define T_SUPPORTED_TRANSFER_SYNTAX 301 -#define T_FORMAT 302 -#define T_STRICT 303 -#define T_DATA_DIRECTORY 304 -#define T_UN_VR_DEF_LOOKUP 305 -#define T_AUTO_TYPE 306 -#define T_AUTO_CREATE 307 -#define T_DEFINITION_DIRECTORY 308 -#define T_DEFINITION_ROOT 309 -#define T_DEFINITION 310 -#define T_DICOMSCRIPT_ROOT 311 -#define T_DICOMSCRIPT 312 -#define T_LOG_ERROR 313 -#define T_LOG_WARNING 314 -#define T_LOG_INFO 315 -#define T_LOG_RELATION 316 -#define T_LOG_DEBUG 317 -#define T_LOG_ACSE 318 -#define T_LOG_DICOM 319 -#define T_LOG_SCP_THREAD 320 -#define T_DULP_STATE 321 -#define T_CONTINUE 322 -#define T_DICOM_VAL_RES 323 -#define T_ACSE_VAL_RES 324 -#define T_RESULTS_ROOT 325 -#define T_DESCRIPTION_DIRECTORY 326 -#define T_APPEND_TO_FILE 327 -#define T_INCLUDE_PATH 328 -#define TRUE_OR_FALSE 329 -#define INTEGER 330 -#define STRING 331 -#define LOG_LEVEL 332 -#define SESSION_TYPE 333 -#define STORAGE_MODE 334 -#define SUT_ROLE 335 -#define T_ENSURE_EVEN_ATTRIBUTE_VALUE_LENGTH 336 -#define T_SUT_AE 337 -#define T_SUT_MAX_LEN 338 -#define T_SUT_IMPL_CLASS 339 -#define T_SUT_IMPL_VER 340 -#define T_SUT_HOSTNAME 341 -#define T_SUT_PORT 342 -#define T_SUT_ROLE 343 -#define T_DVT_AE 344 -#define T_DVT_MAX_LEN 345 -#define T_DVT_IMPL_CLASS 346 -#define T_DVT_IMPL_VER 347 -#define T_DVT_PORT 348 -#define T_DVT_SOCKET_TIMEOUT 349 -#define T_DETAILED_RESULTS 350 -#define T_SUMMARY_RESULTS 351 -#define T_INCLUDE_TYPE3_NOTPRESENT 352 -#define T_DUMP_ATTR_REFFILE 353 -#define T_PRIVATE_MAPPING 354 - - -extern YYSTYPE sessionlval;