From 5a14dd8ec775b3ce72ae9ceef1c906c2cd269967 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Fri, 27 Feb 2026 13:22:27 +0100 Subject: [PATCH 01/13] Update DICOMDIR records aligned to 2026a version. Added PALETTE, IMPLANT, IMPLANT_ASSY, IMPLANT_GROUP, INVENTORY, PLAN, MEASUREMENT, SURFACE, SURFACE_SCAN, TRACT, ASSESSMENT, RADIOTHERAPY, ANNOTATION, WF_PRESENTATION, --- .../DVTk Data/DimseValidationDataClasses.cs | 14 ++++++++++++++ .../MDIMSEResultsConvertors.cpp | 14 ++++++++++++++ DVTk_Library/Libraries/Global/constant.h | 14 ++++++++++++++ .../Libraries/Validation/record_types.cpp | 18 ++++++++++++++++-- .../DVTk Data/DimseValidationDataClasses.cs | 14 ++++++++++++++ .../MDIMSEResultsConvertors.cpp | 14 ++++++++++++++ .../Source/Libraries/Global/constant.h | 14 ++++++++++++++ .../Libraries/Validation/record_types.cpp | 18 ++++++++++++++++-- 8 files changed, 116 insertions(+), 4 deletions(-) diff --git a/DVTk_Library/Assemblies/DVTk Data/DimseValidationDataClasses.cs b/DVTk_Library/Assemblies/DVTk Data/DimseValidationDataClasses.cs index d639d71..d0f239b 100644 --- a/DVTk_Library/Assemblies/DVTk Data/DimseValidationDataClasses.cs +++ b/DVTk_Library/Assemblies/DVTk Data/DimseValidationDataClasses.cs @@ -1769,6 +1769,20 @@ public enum DirectoryRecordType /// This Directory Record shall be used to reference a Key Object Selection Document. /// KEY_OBJECT_DOC, + PALETTE, + IMPLANT, + IMPLANT_ASSY, + IMPLANT_GROUP, + INVENTORY, + PLAN, + MEASUREMENT, + SURFACE, + SURFACE_SCAN, + TRACT, + ASSESSMENT, + RADIOTHERAPY, + ANNOTATION, + WF_PRESENTATION, /// /// SPECIAL DIRECTORY RECORDS: Private directory record /// diff --git a/DVTk_Library/Assemblies/DVTkManagedCodeAdapter/MDIMSEResultsConvertors.cpp b/DVTk_Library/Assemblies/DVTkManagedCodeAdapter/MDIMSEResultsConvertors.cpp index 0ae10ee..ba427fd 100644 --- a/DVTk_Library/Assemblies/DVTkManagedCodeAdapter/MDIMSEResultsConvertors.cpp +++ b/DVTk_Library/Assemblies/DVTkManagedCodeAdapter/MDIMSEResultsConvertors.cpp @@ -97,6 +97,20 @@ namespace ManagedUnManagedDimseValidationResultsConvertors case ::DICOMDIR_RECORD_TYPE_SR_DOCUMENT : return DirectoryRecordType::SR_DOCUMENT; case ::DICOMDIR_RECORD_TYPE_KEY_OBJECT_DOC : return DirectoryRecordType::KEY_OBJECT_DOC; case ::DICOMDIR_RECORD_TYPE_WAVEFORM : return DirectoryRecordType::WAVEFORM; + case ::DICOMDIR_RECORD_TYPE_PALETTE : return DirectoryRecordType::PALETTE; + case ::DICOMDIR_RECORD_TYPE_IMPLANT : return DirectoryRecordType::IMPLANT; + case ::DICOMDIR_RECORD_TYPE_IMPLANT_ASSY : return DirectoryRecordType::IMPLANT_ASSY; + case ::DICOMDIR_RECORD_TYPE_IMPLANT_GROUP : return DirectoryRecordType::IMPLANT_GROUP; + case ::DICOMDIR_RECORD_TYPE_INVENTORY : return DirectoryRecordType::INVENTORY; + case ::DICOMDIR_RECORD_TYPE_PLAN : return DirectoryRecordType::PLAN; + case ::DICOMDIR_RECORD_TYPE_MEASUREMENT : return DirectoryRecordType::MEASUREMENT; + case ::DICOMDIR_RECORD_TYPE_SURFACE : return DirectoryRecordType::SURFACE; + case ::DICOMDIR_RECORD_TYPE_SURFACE_SCAN : return DirectoryRecordType::SURFACE_SCAN; + case ::DICOMDIR_RECORD_TYPE_TRACT : return DirectoryRecordType::TRACT; + case ::DICOMDIR_RECORD_TYPE_ASSESSMENT : return DirectoryRecordType::ASSESSMENT; + case ::DICOMDIR_RECORD_TYPE_RADIOTHERAPY : return DirectoryRecordType::RADIOTHERAPY; + case ::DICOMDIR_RECORD_TYPE_ANNOTATION : return DirectoryRecordType::ANNOTATION; + case ::DICOMDIR_RECORD_TYPE_WF_PRESENTATION : return DirectoryRecordType::WF_PRESENTATION; case ::DICOMDIR_RECORD_TYPE_PRIVATE : return DirectoryRecordType::PRIVATE; case ::DICOMDIR_RECORD_TYPE_MRDR : return DirectoryRecordType::MRDR; case ::DICOMDIR_RECORD_TYPE_HANGING_PROTOCOL: return DirectoryRecordType::HANGING_PROTOCOL; diff --git a/DVTk_Library/Libraries/Global/constant.h b/DVTk_Library/Libraries/Global/constant.h index a7530f2..084b013 100644 --- a/DVTk_Library/Libraries/Global/constant.h +++ b/DVTk_Library/Libraries/Global/constant.h @@ -1037,6 +1037,20 @@ typedef enum DICOMDIR_RECORD_TYPE_SR_DOCUMENT, DICOMDIR_RECORD_TYPE_KEY_OBJECT_DOC, DICOMDIR_RECORD_TYPE_WAVEFORM, + DICOMDIR_RECORD_TYPE_PALETTE, + DICOMDIR_RECORD_TYPE_IMPLANT, + DICOMDIR_RECORD_TYPE_IMPLANT_ASSY, + DICOMDIR_RECORD_TYPE_IMPLANT_GROUP, + DICOMDIR_RECORD_TYPE_INVENTORY, + DICOMDIR_RECORD_TYPE_PLAN, + DICOMDIR_RECORD_TYPE_MEASUREMENT, + DICOMDIR_RECORD_TYPE_SURFACE, + DICOMDIR_RECORD_TYPE_SURFACE_SCAN, + DICOMDIR_RECORD_TYPE_TRACT, + DICOMDIR_RECORD_TYPE_ASSESSMENT, + DICOMDIR_RECORD_TYPE_RADIOTHERAPY, + DICOMDIR_RECORD_TYPE_ANNOTATION, + DICOMDIR_RECORD_TYPE_WF_PRESENTATION, DICOMDIR_RECORD_TYPE_PRIVATE, DICOMDIR_RECORD_TYPE_MRDR, DICOMDIR_RECORD_TYPE_HANGING_PROTOCOL, diff --git a/DVTk_Library/Libraries/Validation/record_types.cpp b/DVTk_Library/Libraries/Validation/record_types.cpp index 74f923d..62dff7e 100644 --- a/DVTk_Library/Libraries/Validation/record_types.cpp +++ b/DVTk_Library/Libraries/Validation/record_types.cpp @@ -94,10 +94,10 @@ void RECORD_TYPES_CLASS::FillRecordTypes() //<<=========================================================================== { // This must be the first entry. - recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_ROOT, "ROOT", "PATIENT\nHANGING PROTOCOL\nPRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_ROOT, "ROOT", "PATIENT\nHANGING PROTOCOL\nPALETTE\nIMPLANT\nIMPLANT ASSY\nIMPLANT GROUP\nINVENTORY\nPRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_PATIENT, "PATIENT", "STUDY\nHL7 STRUC DOC\nPRIVATE", TAG_PATIENT_ID, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_STUDY, "STUDY", "SERIES\nPRIVATE", TAG_REFERENCED_SOP_INSTANCE_UID_IN_FILE, TAG_STUDY_INSTANCE_UID, false)); - recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SERIES, "SERIES", "IMAGE\nRT DOSE\nRT STRUCTURE SET\nRT PLAN\nRT TREAT RECORD\nPRESENTATION\nWAVEFORM\nSR DOCUMENT\nKEY OBJECT DOC\nSPECTROSCOPY\nRAW DATA\nREGISTRATION\nFIDUCIAL\nENCAP DOC\nVALUE MAP\nSTEREOMETRIC\nPRIVATE", TAG_SERIES_INSTANCE_UID, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SERIES, "SERIES", "IMAGE\nRT DOSE\nRT STRUCTURE SET\nRT PLAN\nRT TREAT RECORD\nPRESENTATION\nWAVEFORM\nSR DOCUMENT\nKEY OBJECT DOC\nSPECTROSCOPY\nRAW DATA\nREGISTRATION\nFIDUCIAL\nENCAP DOC\nVALUE MAP\nSTEREOMETRIC\nPLAN\nMEASUREMENT\nSURFACE\nTRACT\nASSESSMENT\nRADIOTHERAPY\nANNOTATION\nWF PRESENTATION\nPRIVATE", TAG_SERIES_INSTANCE_UID, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_IMAGE, "IMAGE", "PRIVATE", TAG_REFERENCED_SOP_INSTANCE_UID_IN_FILE, TAG_REFERENCED_SOP_INSTANCE_UID_IN_FILE, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_RT_DOSE, "RT DOSE", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_RT_STRUCTURE_SET, "RT STRUCTURE SET", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); @@ -113,6 +113,20 @@ void RECORD_TYPES_CLASS::FillRecordTypes() recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SPECTROSCOPY, "SPECTROSCOPY", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_FIDUCIAL, "FIDUCIAL", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_HANGING_PROTOCOL, "HANGING PROTOCOL", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_PALETTE, "PALETTE", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_IMPLANT, "IMPLANT", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_IMPLANT_ASSY, "IMPLANT ASSY", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_IMPLANT_GROUP, "IMPLANT GROUP", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_INVENTORY, "INVENTORY", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_PLAN, "PLAN", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_MEASUREMENT, "MEASUREMENT", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SURFACE, "SURFACE", "SURFACE SCAN\nPRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SURFACE_SCAN, "SURFACE SCAN", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_TRACT, "TRACT", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_ASSESSMENT, "ASSESSMENT", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_RADIOTHERAPY, "RADIOTHERAPY", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_ANNOTATION, "ANNOTATION", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_WF_PRESENTATION, "WF PRESENTATION", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_HL7_STRUC_DOC, "HL7 STRUC DOC", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_STEREOMETRIC, "STEREOMETRIC", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_VALUE_MAP, "VALUE MAP", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); diff --git a/DVTk_Library/Source/Assemblies/DVTk Data/DimseValidationDataClasses.cs b/DVTk_Library/Source/Assemblies/DVTk Data/DimseValidationDataClasses.cs index 6ca62cb..f74e0c8 100644 --- a/DVTk_Library/Source/Assemblies/DVTk Data/DimseValidationDataClasses.cs +++ b/DVTk_Library/Source/Assemblies/DVTk Data/DimseValidationDataClasses.cs @@ -1737,6 +1737,20 @@ public enum DirectoryRecordType /// This Directory Record shall be used to reference a Key Object Selection Document. /// KEY_OBJECT_DOC, + PALETTE, + IMPLANT, + IMPLANT_ASSY, + IMPLANT_GROUP, + INVENTORY, + PLAN, + MEASUREMENT, + SURFACE, + SURFACE_SCAN, + TRACT, + ASSESSMENT, + RADIOTHERAPY, + ANNOTATION, + WF_PRESENTATION, /// /// SPECIAL DIRECTORY RECORDS: Private directory record /// diff --git a/DVTk_Library/Source/Assemblies/DVTk Managed Code Adapter/MDIMSEResultsConvertors.cpp b/DVTk_Library/Source/Assemblies/DVTk Managed Code Adapter/MDIMSEResultsConvertors.cpp index adbbc0f..18add4c 100644 --- a/DVTk_Library/Source/Assemblies/DVTk Managed Code Adapter/MDIMSEResultsConvertors.cpp +++ b/DVTk_Library/Source/Assemblies/DVTk Managed Code Adapter/MDIMSEResultsConvertors.cpp @@ -97,6 +97,20 @@ namespace ManagedUnManagedDimseValidationResultsConvertors case ::DICOMDIR_RECORD_TYPE_SR_DOCUMENT : return DirectoryRecordType::SR_DOCUMENT; case ::DICOMDIR_RECORD_TYPE_KEY_OBJECT_DOC : return DirectoryRecordType::KEY_OBJECT_DOC; case ::DICOMDIR_RECORD_TYPE_WAVEFORM : return DirectoryRecordType::WAVEFORM; + case ::DICOMDIR_RECORD_TYPE_PALETTE : return DirectoryRecordType::PALETTE; + case ::DICOMDIR_RECORD_TYPE_IMPLANT : return DirectoryRecordType::IMPLANT; + case ::DICOMDIR_RECORD_TYPE_IMPLANT_ASSY : return DirectoryRecordType::IMPLANT_ASSY; + case ::DICOMDIR_RECORD_TYPE_IMPLANT_GROUP : return DirectoryRecordType::IMPLANT_GROUP; + case ::DICOMDIR_RECORD_TYPE_INVENTORY : return DirectoryRecordType::INVENTORY; + case ::DICOMDIR_RECORD_TYPE_PLAN : return DirectoryRecordType::PLAN; + case ::DICOMDIR_RECORD_TYPE_MEASUREMENT : return DirectoryRecordType::MEASUREMENT; + case ::DICOMDIR_RECORD_TYPE_SURFACE : return DirectoryRecordType::SURFACE; + case ::DICOMDIR_RECORD_TYPE_SURFACE_SCAN : return DirectoryRecordType::SURFACE_SCAN; + case ::DICOMDIR_RECORD_TYPE_TRACT : return DirectoryRecordType::TRACT; + case ::DICOMDIR_RECORD_TYPE_ASSESSMENT : return DirectoryRecordType::ASSESSMENT; + case ::DICOMDIR_RECORD_TYPE_RADIOTHERAPY : return DirectoryRecordType::RADIOTHERAPY; + case ::DICOMDIR_RECORD_TYPE_ANNOTATION : return DirectoryRecordType::ANNOTATION; + case ::DICOMDIR_RECORD_TYPE_WF_PRESENTATION : return DirectoryRecordType::WF_PRESENTATION; case ::DICOMDIR_RECORD_TYPE_PRIVATE : return DirectoryRecordType::PRIVATE; case ::DICOMDIR_RECORD_TYPE_MRDR : return DirectoryRecordType::MRDR; case ::DICOMDIR_RECORD_TYPE_HANGING_PROTOCOL: return DirectoryRecordType::HANGING_PROTOCOL; diff --git a/DVTk_Library/Source/Libraries/Global/constant.h b/DVTk_Library/Source/Libraries/Global/constant.h index db4c2d0..91a1e81 100644 --- a/DVTk_Library/Source/Libraries/Global/constant.h +++ b/DVTk_Library/Source/Libraries/Global/constant.h @@ -1024,6 +1024,20 @@ typedef enum DICOMDIR_RECORD_TYPE_SR_DOCUMENT, DICOMDIR_RECORD_TYPE_KEY_OBJECT_DOC, DICOMDIR_RECORD_TYPE_WAVEFORM, + DICOMDIR_RECORD_TYPE_PALETTE, + DICOMDIR_RECORD_TYPE_IMPLANT, + DICOMDIR_RECORD_TYPE_IMPLANT_ASSY, + DICOMDIR_RECORD_TYPE_IMPLANT_GROUP, + DICOMDIR_RECORD_TYPE_INVENTORY, + DICOMDIR_RECORD_TYPE_PLAN, + DICOMDIR_RECORD_TYPE_MEASUREMENT, + DICOMDIR_RECORD_TYPE_SURFACE, + DICOMDIR_RECORD_TYPE_SURFACE_SCAN, + DICOMDIR_RECORD_TYPE_TRACT, + DICOMDIR_RECORD_TYPE_ASSESSMENT, + DICOMDIR_RECORD_TYPE_RADIOTHERAPY, + DICOMDIR_RECORD_TYPE_ANNOTATION, + DICOMDIR_RECORD_TYPE_WF_PRESENTATION, DICOMDIR_RECORD_TYPE_PRIVATE, DICOMDIR_RECORD_TYPE_MRDR, DICOMDIR_RECORD_TYPE_HANGING_PROTOCOL, diff --git a/DVTk_Library/Source/Libraries/Validation/record_types.cpp b/DVTk_Library/Source/Libraries/Validation/record_types.cpp index 74f923d..62dff7e 100644 --- a/DVTk_Library/Source/Libraries/Validation/record_types.cpp +++ b/DVTk_Library/Source/Libraries/Validation/record_types.cpp @@ -94,10 +94,10 @@ void RECORD_TYPES_CLASS::FillRecordTypes() //<<=========================================================================== { // This must be the first entry. - recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_ROOT, "ROOT", "PATIENT\nHANGING PROTOCOL\nPRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_ROOT, "ROOT", "PATIENT\nHANGING PROTOCOL\nPALETTE\nIMPLANT\nIMPLANT ASSY\nIMPLANT GROUP\nINVENTORY\nPRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_PATIENT, "PATIENT", "STUDY\nHL7 STRUC DOC\nPRIVATE", TAG_PATIENT_ID, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_STUDY, "STUDY", "SERIES\nPRIVATE", TAG_REFERENCED_SOP_INSTANCE_UID_IN_FILE, TAG_STUDY_INSTANCE_UID, false)); - recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SERIES, "SERIES", "IMAGE\nRT DOSE\nRT STRUCTURE SET\nRT PLAN\nRT TREAT RECORD\nPRESENTATION\nWAVEFORM\nSR DOCUMENT\nKEY OBJECT DOC\nSPECTROSCOPY\nRAW DATA\nREGISTRATION\nFIDUCIAL\nENCAP DOC\nVALUE MAP\nSTEREOMETRIC\nPRIVATE", TAG_SERIES_INSTANCE_UID, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SERIES, "SERIES", "IMAGE\nRT DOSE\nRT STRUCTURE SET\nRT PLAN\nRT TREAT RECORD\nPRESENTATION\nWAVEFORM\nSR DOCUMENT\nKEY OBJECT DOC\nSPECTROSCOPY\nRAW DATA\nREGISTRATION\nFIDUCIAL\nENCAP DOC\nVALUE MAP\nSTEREOMETRIC\nPLAN\nMEASUREMENT\nSURFACE\nTRACT\nASSESSMENT\nRADIOTHERAPY\nANNOTATION\nWF PRESENTATION\nPRIVATE", TAG_SERIES_INSTANCE_UID, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_IMAGE, "IMAGE", "PRIVATE", TAG_REFERENCED_SOP_INSTANCE_UID_IN_FILE, TAG_REFERENCED_SOP_INSTANCE_UID_IN_FILE, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_RT_DOSE, "RT DOSE", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_RT_STRUCTURE_SET, "RT STRUCTURE SET", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); @@ -113,6 +113,20 @@ void RECORD_TYPES_CLASS::FillRecordTypes() recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SPECTROSCOPY, "SPECTROSCOPY", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_FIDUCIAL, "FIDUCIAL", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_HANGING_PROTOCOL, "HANGING PROTOCOL", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_PALETTE, "PALETTE", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_IMPLANT, "IMPLANT", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_IMPLANT_ASSY, "IMPLANT ASSY", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_IMPLANT_GROUP, "IMPLANT GROUP", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_INVENTORY, "INVENTORY", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_PLAN, "PLAN", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_MEASUREMENT, "MEASUREMENT", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SURFACE, "SURFACE", "SURFACE SCAN\nPRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_SURFACE_SCAN, "SURFACE SCAN", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_TRACT, "TRACT", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_ASSESSMENT, "ASSESSMENT", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_RADIOTHERAPY, "RADIOTHERAPY", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_ANNOTATION, "ANNOTATION", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); + recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_WF_PRESENTATION, "WF PRESENTATION", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_HL7_STRUC_DOC, "HL7 STRUC DOC", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_STEREOMETRIC, "STEREOMETRIC", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); recordTypesM.push_back(CreateRecordType(DICOMDIR_RECORD_TYPE_VALUE_MAP, "VALUE MAP", "PRIVATE", TAG_UNDEFINED, TAG_UNDEFINED, false)); From 9746b654913e214e46c51a9e515af11b50e51b94 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Fri, 27 Feb 2026 13:41:39 +0100 Subject: [PATCH 02/13] Remove auto generated lexer and parser cpp and h files --- .../AttributeGroup/ext_char_set_lexer.cpp | 1747 ----- .../AttributeGroup/ext_char_set_parser.cpp | 973 --- .../AttributeGroup/ext_char_set_parser.cpp.h | 15 - .../Libraries/Definition/definition_lex.cpp | 2522 -------- .../Libraries/Definition/definition_parse.cpp | 2745 -------- .../Definition/definition_parse.cpp.h | 51 - .../Libraries/Emulator/imagedisplay_lex.cpp | 1757 ----- .../Libraries/Emulator/imagedisplay_parse.cpp | 890 --- .../Emulator/imagedisplay_parse.cpp.h | 14 - .../Libraries/Scripting/script1_lexer.cpp | 3409 ---------- .../Libraries/Scripting/script1_parser.cpp | 5647 ----------------- .../Libraries/Scripting/script1_parser.cpp.h | 98 - .../Libraries/Scripting/script2_lexer.cpp | 3409 ---------- .../Libraries/Scripting/script2_parser.cpp | 5647 ----------------- .../Libraries/Scripting/script2_parser.cpp.h | 98 - .../Libraries/Scripting/script3_lexer.cpp | 3409 ---------- .../Libraries/Scripting/script3_parser.cpp | 5647 ----------------- .../Libraries/Scripting/script3_parser.cpp.h | 98 - .../Libraries/Scripting/script4_lexer.cpp | 3409 ---------- .../Libraries/Scripting/script4_parser.cpp | 5647 ----------------- .../Libraries/Scripting/script4_parser.cpp.h | 98 - .../Libraries/Scripting/script_lexer.cpp | 3409 ---------- .../Libraries/Scripting/script_parser.cpp | 5647 ----------------- .../Libraries/Scripting/script_parser.cpp.h | 98 - .../Libraries/Session/session_lexer.cpp | 3047 --------- .../Libraries/Session/session_parser.cpp | 1729 ----- .../Libraries/Session/session_parser.cpp.h | 110 - 27 files changed, 61370 deletions(-) delete mode 100644 DVTk_Library/Libraries/AttributeGroup/ext_char_set_lexer.cpp delete mode 100644 DVTk_Library/Libraries/AttributeGroup/ext_char_set_parser.cpp delete mode 100644 DVTk_Library/Libraries/AttributeGroup/ext_char_set_parser.cpp.h delete mode 100644 DVTk_Library/Libraries/Definition/definition_lex.cpp delete mode 100644 DVTk_Library/Libraries/Definition/definition_parse.cpp delete mode 100644 DVTk_Library/Libraries/Definition/definition_parse.cpp.h delete mode 100644 DVTk_Library/Libraries/Emulator/imagedisplay_lex.cpp delete mode 100644 DVTk_Library/Libraries/Emulator/imagedisplay_parse.cpp delete mode 100644 DVTk_Library/Libraries/Emulator/imagedisplay_parse.cpp.h delete mode 100644 DVTk_Library/Libraries/Scripting/script1_lexer.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script1_parser.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script1_parser.cpp.h delete mode 100644 DVTk_Library/Libraries/Scripting/script2_lexer.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script2_parser.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script2_parser.cpp.h delete mode 100644 DVTk_Library/Libraries/Scripting/script3_lexer.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script3_parser.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script3_parser.cpp.h delete mode 100644 DVTk_Library/Libraries/Scripting/script4_lexer.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script4_parser.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script4_parser.cpp.h delete mode 100644 DVTk_Library/Libraries/Scripting/script_lexer.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script_parser.cpp delete mode 100644 DVTk_Library/Libraries/Scripting/script_parser.cpp.h delete mode 100644 DVTk_Library/Libraries/Session/session_lexer.cpp delete mode 100644 DVTk_Library/Libraries/Session/session_parser.cpp delete mode 100644 DVTk_Library/Libraries/Session/session_parser.cpp.h diff --git a/DVTk_Library/Libraries/AttributeGroup/ext_char_set_lexer.cpp b/DVTk_Library/Libraries/AttributeGroup/ext_char_set_lexer.cpp deleted file mode 100644 index e10a34d..0000000 --- a/DVTk_Library/Libraries/AttributeGroup/ext_char_set_lexer.cpp +++ /dev/null @@ -1,1747 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE extcharsetrestart( extcharsetin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int extcharsetleng; -extern FILE *extcharsetin, *extcharsetout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up extcharsettext. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up extcharsettext again */ \ - } \ - while ( 0 ) - -#define unput(c) extcharsetunput( c, extcharsettext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via extcharsetrestart()), so that the user can continue scanning by - * just pointing extcharsetin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when extcharsettext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int extcharsetleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow extcharsetwrap()'s to do buffer switches - * instead of setting up a fresh extcharsetin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void extcharsetrestart YY_PROTO(( FILE *input_file )); - -void extcharset_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void extcharset_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE extcharset_create_buffer YY_PROTO(( FILE *file, int size )); -void extcharset_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void extcharset_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void extcharset_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER extcharset_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE extcharset_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE extcharset_scan_string YY_PROTO(( yyconst char *str )); -YY_BUFFER_STATE extcharset_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer extcharset_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = extcharset_create_buffer( extcharsetin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = extcharset_create_buffer( extcharsetin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define extcharsetwrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *extcharsetin = (FILE *) 0, *extcharsetout = (FILE *) 0; -typedef int yy_state_type; -#define YY_FLEX_LEX_COMPAT -extern int extcharsetlineno; -int extcharsetlineno = 1; -extern char extcharsettext[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up extcharsettext. - */ -#define YY_DO_BEFORE_ACTION \ - extcharsettext_ptr = yy_bp; \ - extcharsettext_ptr -= yy_more_len; \ - extcharsetleng = (int) (yy_cp - extcharsettext_ptr); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( extcharsetleng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( extcharsettext, extcharsettext_ptr, extcharsetleng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 20 -#define YY_END_OF_BUFFER 21 -static yyconst short int yy_acclist[63] = - { 0, - 21, 19, 20, 5, 19, 20, 5, 7, 20, 19, - 20, 4, 19, 20, 19, 20, 19, 20, 19, 20, - 19, 20, 19, 20, 19, 20, 1, 19, 20, 5, - 19, 20, 3, 5, 6, 7, 20, 4, 19, 20, - 5, 7, 5, 7, 18, 4, 8, 5, 3, 5, - 6, 4, 2, 17, 16, 9, 11, 10, 13, 12, - 14, 15 - } ; - -static yyconst short int yy_accept[106] = - { 0, - 1, 1, 1, 2, 4, 7, 10, 12, 15, 17, - 19, 21, 23, 25, 27, 30, 33, 38, 41, 42, - 43, 45, 45, 46, 46, 47, 47, 47, 47, 47, - 47, 47, 47, 48, 49, 52, 52, 53, 54, 54, - 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 57, 57, 57, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 60, 60, 60, 61, 61, 61, 61, 61, 62, - - 62, 62, 62, 63, 63 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 5, 6, 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, 1, 7, 1, 8, 9, 10, 11, - 1, 12, 13, 1, 1, 14, 15, 16, 17, 1, - 1, 18, 19, 20, 1, 1, 1, 21, 22, 1, - 1, 23, 1, 1, 24, 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, 1, 1, 1, 1, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25 - } ; - -static yyconst int yy_meta[26] = - { 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 - } ; - -static yyconst short int yy_base[111] = - { 0, - 0, 24, 144, 145, 29, 32, 23, 0, 25, 133, - 22, 125, 119, 137, 145, 45, 41, 136, 50, 135, - 53, 35, 145, 56, 0, 130, 127, 124, 125, 125, - 108, 112, 145, 0, 60, 127, 126, 145, 62, 145, - 110, 117, 113, 116, 145, 116, 103, 119, 114, 96, - 103, 108, 100, 106, 107, 104, 103, 101, 102, 95, - 89, 52, 145, 95, 97, 145, 96, 95, 84, 87, - 78, 83, 85, 89, 88, 87, 72, 85, 78, 145, - 72, 73, 75, 71, 69, 78, 67, 73, 75, 64, - 145, 66, 66, 145, 56, 52, 51, 56, 145, 51, - - 44, 31, 145, 145, 73, 38, 28, 75, 77, 79 - } ; - -static yyconst short int yy_def[111] = - { 0, - 104, 1, 104, 104, 104, 105, 106, 107, 104, 104, - 104, 104, 104, 104, 104, 104, 105, 108, 104, 105, - 105, 106, 104, 109, 107, 104, 104, 104, 104, 104, - 104, 104, 104, 16, 104, 110, 108, 104, 109, 104, - 104, 104, 104, 104, 104, 104, 104, 110, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - - 104, 104, 104, 0, 104, 104, 104, 104, 104, 104 - } ; - -static yyconst short int yy_nxt[171] = - { 0, - 4, 5, 6, 5, 7, 8, 4, 9, 10, 11, - 4, 4, 4, 4, 4, 12, 4, 4, 13, 4, - 4, 4, 14, 4, 15, 16, 17, 23, 25, 18, - 19, 19, 19, 21, 19, 21, 26, 29, 22, 23, - 30, 27, 21, 19, 21, 24, 34, 35, 19, 103, - 36, 19, 19, 19, 21, 19, 21, 24, 40, 102, - 23, 19, 19, 19, 104, 68, 23, 101, 100, 99, - 98, 97, 69, 20, 20, 37, 37, 39, 39, 48, - 48, 96, 95, 94, 93, 92, 91, 90, 89, 88, - 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, - - 77, 76, 75, 74, 73, 72, 71, 70, 67, 66, - 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, - 55, 38, 54, 53, 52, 51, 50, 49, 38, 38, - 47, 46, 45, 44, 43, 42, 41, 104, 38, 33, - 32, 31, 28, 104, 3, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104 - } ; - -static yyconst short int yy_chk[171] = - { 0, - 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, 7, 107, 2, - 5, 5, 5, 6, 6, 6, 9, 11, 106, 22, - 11, 9, 17, 17, 17, 7, 16, 16, 16, 102, - 16, 19, 19, 19, 21, 21, 21, 22, 24, 101, - 24, 35, 35, 35, 39, 62, 39, 100, 98, 97, - 96, 95, 62, 105, 105, 108, 108, 109, 109, 110, - 110, 93, 92, 90, 89, 88, 87, 86, 85, 84, - 83, 82, 81, 79, 78, 77, 76, 75, 74, 73, - - 72, 71, 70, 69, 68, 67, 65, 64, 61, 60, - 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, - 49, 48, 47, 46, 44, 43, 42, 41, 37, 36, - 32, 31, 30, 29, 28, 27, 26, 20, 18, 14, - 13, 12, 10, 3, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up extcharsettext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -static int yy_more_flag = 0; -static int yy_more_len = 0; -#define yymore() (yy_more_flag = 1) -#define YY_MORE_ADJ yy_more_len -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char extcharsettext[YYLMAX]; -char *extcharsettext_ptr; -#line 1 "ext_char_set_lexer.l" -#define INITIAL 0 -#line 4 "ext_char_set_lexer.l" -// 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 Lexer. -//***************************************************************************** - -#ifdef _WINDOWS -#pragma warning (disable : 4102) -#pragma warning (disable : 4273) -#pragma warning (disable : 4786) -#endif - -/* - * contains the Lexer for the extended character set output - */ -#include -#include -#include -#include - -#define YY_NEVER_INTERACTIVE 1 - -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "ext_char_set_parser.cpp.h" - -void extcharseterror(char* msg); -void extcharsetwarn(char* msg); - -// export variables for logging purposes -LOG_CLASS *extcharsetlogger_ptr = NULL; - -// variables to keep track of current line -static char curr_linebuf[MAXIMUM_LINE_LENGTH]; - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int extcharsetwrap YY_PROTO(( void )); -#else -extern int extcharsetwrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void extcharsetunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef extcharsettext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int extcharsetinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( extcharsettext, extcharsetleng, 1, extcharsetout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( extcharsetin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( extcharsetin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, extcharsetin )) == 0) \ - && ferror( extcharsetin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int extcharsetlex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after extcharsettext and extcharsetleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( extcharsetleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (extcharsettext[extcharsetleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 45 "ext_char_set_lexer.l" - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! extcharsetin ) - extcharsetin = stdin; - - if ( ! extcharsetout ) - extcharsetout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - extcharset_create_buffer( extcharsetin, YY_BUF_SIZE ); - - extcharset_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_more_len = 0; - if ( yy_more_flag ) - { - yy_more_len = extcharsetleng; - yy_more_flag = 0; - } - yy_cp = yy_c_buf_p; - - /* Support of extcharsettext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 105 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 145 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < extcharsetleng; ++yyl ) - if ( extcharsettext[yyl] == '\n' ) - ++extcharsetlineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 46 "ext_char_set_lexer.l" -{ /* skip charcters from 80H - FFH */ } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 47 "ext_char_set_lexer.l" -{ /* skip comment lines */ } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 48 "ext_char_set_lexer.l" -{ /* skip empty lines */ } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 49 "ext_char_set_lexer.l" -{ /* skip comment */ } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 50 "ext_char_set_lexer.l" -{ /* skip white space */ } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 51 "ext_char_set_lexer.l" -{ /* skip empty lines */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 52 "ext_char_set_lexer.l" -{ - // skip newlines - // reset token position and save the next line - strcpy(curr_linebuf, extcharsettext+1); - yyless(1); // give back all but the \n to rescan - } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 58 "ext_char_set_lexer.l" -{ /* continuation line */ } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 60 "ext_char_set_lexer.l" -{ return T_DEFINE; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 61 "ext_char_set_lexer.l" -{ return T_ENDDEFINE; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 62 "ext_char_set_lexer.l" -{ return T_SYSTEM; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 63 "ext_char_set_lexer.l" -{ return T_CHARACTER_SET; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 64 "ext_char_set_lexer.l" -{ return T_CODE_ELEMENT; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 65 "ext_char_set_lexer.l" -{ return T_CODE_EXTENSIONS; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 66 "ext_char_set_lexer.l" -{ return T_NO_CODE_EXTENSIONS; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 67 "ext_char_set_lexer.l" -{ return T_ESC; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 69 "ext_char_set_lexer.l" -{ - for (extcharsetleng = extcharsetleng-2; extcharsetleng >= 0; extcharsetleng--) - { - unput(extcharsettext[extcharsetleng]); /* concatenate line */ - } - } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 75 "ext_char_set_lexer.l" -{ - if ((extcharsetleng-2) >= sizeof(extcharsetlval.string)) - { - extcharsetwarn("STRING too long!!! truncated"); - extcharsetleng = sizeof(extcharsetlval.string) +1 ; - } - memcpy(extcharsetlval.string, &extcharsettext[1], extcharsetleng-2); - extcharsetlval.string[extcharsetleng-2] = '\0'; - return STRING; - } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 85 "ext_char_set_lexer.l" -{ return extcharsettext[0]; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 86 "ext_char_set_lexer.l" -ECHO; - YY_BREAK - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - extcharsettext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed extcharsetin at a new source and called - * extcharsetlex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = extcharsetin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = extcharsettext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = extcharsettext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( extcharsetwrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * extcharsettext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = extcharsettext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - extcharsettext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = extcharsettext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = extcharsettext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of extcharsetlex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = extcharsettext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - extcharsettext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - extcharsettext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - extcharsetrestart( extcharsetin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - extcharsettext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = extcharsettext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 105 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 105 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - yy_is_jam = (yy_current_state == 104); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void extcharsetunput( int c, register char *yy_bp ) -#else -static void extcharsetunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up extcharsettext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --extcharsetlineno; - - extcharsettext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int extcharsetinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - extcharsettext_ptr = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - if ( extcharsetwrap() ) - { - yy_c_buf_p = - extcharsettext_ptr + YY_MORE_ADJ; - return EOF; - } - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return extcharsetinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = extcharsettext_ptr + YY_MORE_ADJ; - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in extcharsetinput()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve extcharsettext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++extcharsetlineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void extcharsetrestart( FILE *input_file ) -#else -void extcharsetrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = extcharset_create_buffer( extcharsetin, YY_BUF_SIZE ); - - extcharset_init_buffer( yy_current_buffer, input_file ); - extcharset_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void extcharset_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void extcharset_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - extcharset_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (extcharsetwrap()) processing, but the only time this flag - * is looked at is after extcharsetwrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void extcharset_load_buffer_state( void ) -#else -void extcharset_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - extcharsettext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - extcharsetin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE extcharset_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE extcharset_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in extcharset_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in extcharset_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - extcharset_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void extcharset_delete_buffer( YY_BUFFER_STATE b ) -#else -void extcharset_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void extcharset_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void extcharset_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - extcharset_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void extcharset_flush_buffer( YY_BUFFER_STATE b ) -#else -void extcharset_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - extcharset_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE extcharset_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE extcharset_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in extcharset_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - extcharset_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE extcharset_scan_string( yyconst char *str ) -#else -YY_BUFFER_STATE extcharset_scan_string( str ) -yyconst char *str; -#endif - { - int len; - for ( len = 0; str[len]; ++len ) - ; - - return extcharset_scan_bytes( str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE extcharset_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE extcharset_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in extcharset_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = extcharset_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in extcharset_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up extcharsettext. */ \ - extcharsettext[extcharsetleng] = yy_hold_char; \ - yy_c_buf_p = extcharsettext + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - extcharsetleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef extcharsettext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - extcharsetlex(); - return 0; - } -#endif -#line 86 "ext_char_set_lexer.l" - - -void extcharseterror(char *errmsg) -{ - if (extcharsetlogger_ptr) - { - extcharsetlogger_ptr->text(LOG_ERROR, 1, "lineno: %d %s: ", extcharsetlineno, errmsg); - extcharsetlogger_ptr->text(LOG_NONE, 1, "Current line: "); - extcharsetlogger_ptr->text(LOG_NONE, 1, "%-50s...", curr_linebuf); - } -} - -void extcharsetwarn(char *errmsg) -{ - if (extcharsetlogger_ptr) - { - extcharsetlogger_ptr->text(LOG_WARNING, 1, "lineno: %d %s: ", extcharsetlineno, errmsg); - extcharsetlogger_ptr->text(LOG_NONE, 1, "Current line: "); - extcharsetlogger_ptr->text(LOG_NONE, 1, "%-50s...", curr_linebuf); - } -} - diff --git a/DVTk_Library/Libraries/AttributeGroup/ext_char_set_parser.cpp b/DVTk_Library/Libraries/AttributeGroup/ext_char_set_parser.cpp deleted file mode 100644 index af3862b..0000000 --- a/DVTk_Library/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/Libraries/AttributeGroup/ext_char_set_parser.cpp.h b/DVTk_Library/Libraries/AttributeGroup/ext_char_set_parser.cpp.h deleted file mode 100644 index c13b1a8..0000000 --- a/DVTk_Library/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/Libraries/Definition/definition_lex.cpp b/DVTk_Library/Libraries/Definition/definition_lex.cpp deleted file mode 100644 index 315c3e5..0000000 --- a/DVTk_Library/Libraries/Definition/definition_lex.cpp +++ /dev/null @@ -1,2522 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE definitionrestart( definitionin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int definitionleng; -extern FILE *definitionin, *definitionout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up definitiontext. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up definitiontext again */ \ - } \ - while ( 0 ) - -#define unput(c) definitionunput( c, definitiontext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via definitionrestart()), so that the user can continue scanning by - * just pointing definitionin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when definitiontext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int definitionleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow definitionwrap()'s to do buffer switches - * instead of setting up a fresh definitionin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void definitionrestart YY_PROTO(( FILE *input_file )); - -void definition_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void definition_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE definition_create_buffer YY_PROTO(( FILE *file, int size )); -void definition_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void definition_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void definition_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER definition_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE definition_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE definition_scan_string YY_PROTO(( yyconst char *str )); -YY_BUFFER_STATE definition_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer definition_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = definition_create_buffer( definitionin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = definition_create_buffer( definitionin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define definitionwrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *definitionin = (FILE *) 0, *definitionout = (FILE *) 0; -typedef int yy_state_type; -#define YY_FLEX_LEX_COMPAT -extern int definitionlineno; -int definitionlineno = 1; -extern char definitiontext[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up definitiontext. - */ -#define YY_DO_BEFORE_ACTION \ - definitiontext_ptr = yy_bp; \ - definitiontext_ptr -= yy_more_len; \ - definitionleng = (int) (yy_cp - definitiontext_ptr); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( definitionleng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( definitiontext, definitiontext_ptr, definitionleng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 110 -#define YY_END_OF_BUFFER 111 -static yyconst short int yy_acclist[200] = - { 0, - 111, 109, 110, 5, 109, 110, 5, 7, 110, 109, - 110, 4, 109, 110, 109, 110, 106, 109, 110, 106, - 109, 110, 106, 109, 110, 106, 109, 110, 106, 109, - 110, 88, 109, 110, 87, 109, 110, 89, 109, 110, - 109, 110, 13, 109, 110, 9, 109, 110, 10, 109, - 110, 109, 110, 109, 110, 109, 110, 14, 109, 110, - 109, 110, 109, 110, 109, 110, 109, 110, 109, 110, - 15, 109, 110, 109, 110, 109, 110, 109, 110, 1, - 109, 110, 5, 109, 110, 3, 5, 6, 7, 110, - 4, 109, 110, 5, 7, 5, 7, 108, 4, 105, - - 106, 16, 17, 18, 19, 90, 91, 20, 21, 22, - 23, 24, 11, 25, 26, 12, 27, 28, 29, 30, - 31, 32, 37, 33, 35, 95, 36, 34, 38, 39, - 40, 41, 42, 43, 44, 45, 53, 46, 47, 48, - 51, 49, 50, 52, 8, 5, 3, 5, 6, 4, - 2, 107, 103, 104, 104, 103, 94, 96, 102, 83, - 99, 93, 92, 98, 100, 85, 101, 77, 82, 79, - 97, 58, 73, 75, 81, 54, 56, 59, 60, 78, - 74, 76, 55, 57, 61, 62, 64, 63, 84, 65, - 67, 69, 86, 80, 66, 68, 70, 71, 72 - - } ; - -static yyconst short int yy_accept[325] = - { 0, - 1, 1, 1, 2, 4, 7, 10, 12, 15, 17, - 20, 23, 26, 29, 32, 35, 38, 41, 43, 46, - 49, 52, 54, 56, 58, 61, 63, 65, 67, 69, - 71, 74, 76, 78, 80, 83, 86, 91, 94, 95, - 96, 98, 98, 99, 99, 100, 101, 102, 102, 102, - 103, 104, 105, 106, 107, 108, 109, 109, 110, 111, - 111, 112, 113, 113, 114, 115, 116, 117, 117, 117, - 117, 118, 119, 119, 120, 120, 121, 122, 122, 122, - 122, 122, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 130, 131, 132, 132, 133, 134, 135, 136, 136, - - 137, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 145, 145, 145, 146, 147, 150, 150, 151, 152, 152, - 153, 153, 155, 156, 157, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 162, 162, 163, 164, 164, 164, 164, 164, 164, - 164, 164, 165, 165, 166, 166, 167, 167, 167, 167, - - 167, 167, 167, 167, 167, 167, 167, 167, 168, 168, - 168, 168, 168, 168, 168, 169, 169, 169, 169, 170, - 170, 170, 170, 170, 170, 170, 170, 170, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 172, 172, 172, 172, 172, 173, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 174, 174, 175, 175, 176, 176, 177, 177, 178, - 178, 179, 180, 180, 180, 181, 181, 181, 181, 181, - 181, 181, 181, 182, 183, 183, 184, 185, 186, 187, - 187, 187, 187, 187, 187, 187, 187, 187, 188, 189, - - 190, 190, 190, 191, 191, 192, 192, 193, 193, 193, - 194, 195, 196, 197, 198, 198, 198, 198, 198, 198, - 199, 199, 200, 200 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 5, 6, 1, 1, 1, 1, 1, - 1, 1, 7, 1, 8, 1, 1, 9, 10, 11, - 12, 13, 13, 13, 13, 13, 13, 14, 1, 15, - 16, 17, 1, 1, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 1, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 1, - 1, 42, 1, 1, 1, 1, 43, 43, 43, 43, - - 43, 43, 1, 1, 1, 1, 1, 1, 1, 44, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, - 1, 1, 1, 1, 1, 1, 1, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46 - } ; - -static yyconst int yy_meta[47] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 3, 3, - 3, 3, 3, 4, 1, 1, 1, 5, 5, 6, - 5, 5, 5, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, - 1, 1, 1, 1, 7, 1 - } ; - -static yyconst short int yy_base[333] = - { 0, - 0, 45, 453, 454, 50, 53, 44, 0, 49, 36, - 49, 50, 45, 78, 436, 454, 435, 63, 59, 78, - 43, 56, 67, 44, 86, 70, 99, 75, 114, 78, - 136, 432, 93, 446, 454, 122, 127, 445, 132, 444, - 155, 77, 454, 63, 0, 166, 171, 176, 181, 454, - 454, 454, 454, 454, 454, 454, 425, 454, 454, 185, - 454, 454, 422, 454, 454, 454, 454, 412, 422, 414, - 454, 454, 421, 454, 418, 454, 454, 419, 402, 416, - 195, 400, 454, 454, 454, 454, 454, 454, 454, 454, - 413, 454, 454, 402, 454, 454, 454, 454, 398, 454, - - 395, 454, 454, 454, 454, 454, 454, 454, 454, 403, - 396, 411, 454, 219, 165, 425, 424, 454, 118, 454, - 222, 0, 0, 227, 454, 408, 405, 398, 401, 391, - 385, 394, 383, 397, 382, 388, 386, 380, 395, 375, - 391, 376, 387, 370, 385, 384, 454, 370, 384, 367, - 380, 364, 370, 372, 395, 454, 367, 371, 365, 358, - 355, 361, 361, 349, 367, 366, 350, 454, 355, 350, - 356, 347, 360, 353, 358, 343, 342, 355, 348, 353, - 454, 352, 454, 454, 353, 341, 350, 362, 347, 334, - 345, 454, 343, 454, 344, 454, 333, 341, 336, 343, - - 338, 329, 350, 349, 326, 337, 325, 454, 331, 344, - 343, 316, 341, 326, 454, 321, 324, 313, 454, 313, - 307, 306, 305, 306, 305, 302, 302, 454, 308, 301, - 300, 108, 299, 324, 301, 122, 310, 299, 306, 305, - 318, 111, 128, 454, 288, 291, 162, 163, 454, 263, - 177, 260, 264, 243, 251, 240, 259, 257, 256, 229, - 454, 230, 454, 229, 454, 226, 454, 227, 454, 226, - 454, 454, 225, 193, 454, 234, 235, 236, 219, 218, - 217, 228, 454, 454, 216, 454, 454, 454, 454, 216, - 217, 184, 176, 194, 208, 209, 174, 454, 454, 454, - - 142, 130, 454, 128, 454, 122, 454, 121, 109, 454, - 454, 454, 454, 454, 98, 80, 102, 61, 212, 454, - 51, 454, 454, 270, 277, 284, 289, 294, 300, 307, - 314, 319 - } ; - -static yyconst short int yy_def[333] = - { 0, - 323, 1, 323, 323, 323, 324, 325, 326, 323, 327, - 328, 328, 12, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 324, 329, 323, 324, - 324, 325, 323, 330, 326, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 331, 329, 323, 330, 323, - 323, 49, 332, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 331, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 0, 323, 323, 323, 323, 323, 323, 323, - 323, 323 - } ; - -static yyconst short int yy_nxt[501] = - { 0, - 4, 5, 6, 5, 7, 8, 9, 9, 10, 11, - 12, 13, 14, 4, 15, 16, 17, 18, 4, 19, - 20, 21, 22, 4, 4, 23, 4, 24, 25, 26, - 27, 28, 4, 4, 29, 30, 31, 32, 33, 4, - 4, 34, 4, 4, 4, 35, 36, 37, 43, 48, - 38, 39, 39, 39, 41, 39, 41, 46, 46, 46, - 46, 46, 48, 48, 52, 120, 60, 43, 50, 51, - 67, 68, 69, 70, 76, 49, 71, 81, 53, 77, - 49, 43, 322, 72, 56, 44, 47, 47, 47, 47, - 47, 48, 57, 61, 319, 62, 73, 58, 59, 63, - - 82, 74, 75, 78, 90, 64, 100, 79, 91, 318, - 111, 101, 65, 66, 112, 317, 80, 83, 44, 84, - 323, 85, 43, 114, 115, 39, 86, 116, 41, 39, - 41, 316, 87, 39, 39, 39, 88, 89, 92, 315, - 249, 93, 250, 261, 94, 262, 95, 254, 96, 97, - 255, 98, 314, 313, 99, 102, 41, 39, 41, 312, - 263, 103, 264, 104, 311, 105, 39, 39, 39, 106, - 107, 108, 310, 109, 46, 46, 46, 46, 46, 47, - 47, 47, 47, 47, 121, 121, 121, 121, 121, 122, - 122, 122, 122, 122, 267, 269, 268, 270, 123, 123, - - 123, 123, 123, 123, 126, 309, 127, 128, 129, 272, - 302, 273, 141, 130, 142, 143, 144, 301, 145, 131, - 114, 115, 39, 124, 116, 289, 303, 290, 304, 146, - 121, 121, 121, 121, 121, 124, 124, 124, 124, 124, - 305, 307, 306, 308, 320, 300, 321, 299, 298, 297, - 296, 295, 294, 293, 292, 291, 288, 287, 286, 285, - 284, 283, 282, 281, 280, 156, 279, 278, 277, 124, - 40, 40, 40, 40, 40, 40, 40, 42, 276, 42, - 42, 42, 42, 42, 45, 275, 45, 45, 45, 45, - 45, 47, 47, 274, 271, 47, 47, 47, 266, 47, - - 117, 117, 117, 117, 117, 117, 117, 119, 119, 119, - 119, 119, 119, 119, 155, 155, 155, 155, 155, 155, - 155, 123, 265, 123, 123, 260, 259, 258, 257, 256, - 253, 252, 251, 248, 247, 246, 245, 244, 243, 242, - 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, - 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, - 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, - 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, - 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, - 191, 190, 189, 188, 187, 186, 185, 118, 184, 183, - - 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, - 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, - 162, 161, 160, 159, 158, 157, 118, 118, 154, 153, - 152, 151, 150, 149, 148, 147, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 125, 323, 118, 113, 110, - 55, 54, 323, 3, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323 - - } ; - -static yyconst short int yy_chk[501] = - { 0, - 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, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 7, 10, - 2, 5, 5, 5, 6, 6, 6, 9, 9, 9, - 9, 9, 11, 12, 13, 44, 19, 44, 11, 12, - 21, 21, 21, 22, 24, 10, 22, 26, 13, 24, - 10, 42, 321, 22, 18, 7, 14, 14, 14, 14, - 14, 14, 18, 19, 318, 20, 23, 18, 18, 20, - - 26, 23, 23, 25, 28, 20, 30, 25, 28, 317, - 33, 30, 20, 20, 33, 316, 25, 27, 42, 27, - 119, 27, 119, 36, 36, 36, 27, 36, 37, 37, - 37, 315, 27, 39, 39, 39, 27, 27, 29, 309, - 232, 29, 232, 242, 29, 242, 29, 236, 29, 29, - 236, 29, 308, 306, 29, 31, 41, 41, 41, 304, - 243, 31, 243, 31, 302, 31, 115, 115, 115, 31, - 31, 31, 301, 31, 46, 46, 46, 46, 46, 47, - 47, 47, 47, 47, 48, 48, 48, 48, 48, 49, - 49, 49, 49, 49, 247, 248, 247, 248, 49, 49, - - 49, 49, 49, 49, 60, 297, 60, 60, 60, 251, - 293, 251, 81, 60, 81, 81, 81, 292, 81, 60, - 114, 114, 114, 49, 114, 274, 294, 274, 294, 81, - 121, 121, 121, 121, 121, 124, 124, 124, 124, 124, - 295, 296, 295, 296, 319, 291, 319, 290, 285, 282, - 281, 280, 279, 278, 277, 276, 273, 270, 268, 266, - 264, 262, 260, 259, 258, 121, 257, 256, 255, 124, - 324, 324, 324, 324, 324, 324, 324, 325, 254, 325, - 325, 325, 325, 325, 326, 253, 326, 326, 326, 326, - 326, 327, 327, 252, 250, 327, 328, 328, 246, 328, - - 329, 329, 329, 329, 329, 329, 329, 330, 330, 330, - 330, 330, 330, 330, 331, 331, 331, 331, 331, 331, - 331, 332, 245, 332, 332, 241, 240, 239, 238, 237, - 235, 234, 233, 231, 230, 229, 227, 226, 225, 224, - 223, 222, 221, 220, 218, 217, 216, 214, 213, 212, - 211, 210, 209, 207, 206, 205, 204, 203, 202, 201, - 200, 199, 198, 197, 195, 193, 191, 190, 189, 188, - 187, 186, 185, 182, 180, 179, 178, 177, 176, 175, - 174, 173, 172, 171, 170, 169, 167, 166, 165, 164, - 163, 162, 161, 160, 159, 158, 157, 155, 154, 153, - - 152, 151, 150, 149, 148, 146, 145, 144, 143, 142, - 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, - 131, 130, 129, 128, 127, 126, 117, 116, 112, 111, - 110, 101, 99, 94, 91, 82, 80, 79, 78, 75, - 73, 70, 69, 68, 63, 57, 40, 38, 34, 32, - 17, 15, 3, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323 - - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up definitiontext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -static int yy_more_flag = 0; -static int yy_more_len = 0; -#define yymore() (yy_more_flag = 1) -#define YY_MORE_ADJ yy_more_len -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char definitiontext[YYLMAX]; -char *definitiontext_ptr; -#line 1 "definition_lex.l" -#define INITIAL 0 -#line 4 "definition_lex.l" -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -#ifdef _WINDOWS -#pragma warning (disable : 4102) -#pragma warning (disable : 4273) -#pragma warning (disable : 4786) -#endif - -/* - * contains the Lexer for the ODD output - */ -#include -#include -#include -#include - -#define YY_NEVER_INTERACTIVE 1 - -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "Icondition.h" // Condition component interface -#include "definition_parse.cpp.h" - -#define ODD_DIM_OF(a) (sizeof((a))/sizeof((a)[0])) -#define RETURN(a) tokenType = (a); return((a)); -#define definitionlval definitionlval -#define definitionerror definitionerror -#define yywarn definitionwarn - -void yywarn(char *msg); -void definitionerror(char* msg); - -//Export variables for logging purposes -LOG_CLASS* definitionfilelogger_ptr = 0; -UINT definitionerrors = 0; -UINT definitionwarnings = 0; - -//Extern variables -extern bool definitionParseOnly; - -//Variables to keep track of current line and the -//position of the token in this line -static char prev_linebuf[MAXIMUM_LINE_LENGTH]; -static char curr_linebuf[MAXIMUM_LINE_LENGTH]; - -bool IsHex(char, int*); - -static int tokenType = '\0'; -char* End_ptr; - -typedef struct { - int tokenType; - char* tokenName; -} TOKEN_MAP_STRUCT; - - -static TOKEN_MAP_STRUCT tokenTable[] = { -{ T_SYSTEM, "T_SYSTEM"}, -{ T_DEFINE, "T_DEFINE"}, -{ T_ENDDEFINE, "T_ENDDEFINE"}, -{ T_METASOPCLASS, "T_METASOPCLASS"}, -{ T_SOPCLASS, "T_SOPCLASS"}, -{ T_MODULE, "T_MODULE"}, -{ T_MACRO, "T_MACRO"}, -{ T_INCLUDEMACRO, "T_INCLUDEMACRO"}, -{ T_SQ, "T_SQ"}, -{ T_AND, "T_AND"}, -{ T_OR, "T_OR"}, -{ T_NOT, "T_NOT"}, -{ T_PRESENT, "T_PRESENT"}, -{ T_VALUE, "T_VALUE"}, -{ T_EMPTY, "T_EMPTY"}, -{ T_TRUE, "T_TRUE"}, -{ T_FALSE, "T_FALSE"}, -{ T_EQUAL, "T_EQUAL"}, -{ T_LESS, "T_LESS"}, -{ T_GREATER, "T_GREATER"}, -{ T_LESS_OR_EQUAL, "T_LESS_OR_EQUAL"}, -{ T_GREATER_OR_EQUAL, "T_GREATER_OR_EQUAL"}, -{ T_WEAK, "T_WEAK"}, -{ T_WARN, "T_WARN"}, -{ STRING, "STRING"}, -{ INTEGER, "INTEGER"}, -{ HEX, "HEX"}, -{ COMMANDFIELD, "COMMANDFIELD"}, -{ TYPE, "TYPE"}, -{ USAGE, "USAGE"}, -{ VALUETYPE, "VALUETYPE"}, -{ VR, "VR"} -}; - - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int definitionwrap YY_PROTO(( void )); -#else -extern int definitionwrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void definitionunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef definitiontext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int definitioninput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( definitiontext, definitionleng, 1, definitionout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( definitionin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( definitionin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, definitionin )) == 0) \ - && ferror( definitionin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int definitionlex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after definitiontext and definitionleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( definitionleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (definitiontext[definitionleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 102 "definition_lex.l" - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! definitionin ) - definitionin = stdin; - - if ( ! definitionout ) - definitionout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - definition_create_buffer( definitionin, YY_BUF_SIZE ); - - definition_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_more_len = 0; - if ( yy_more_flag ) - { - yy_more_len = definitionleng; - yy_more_flag = 0; - } - yy_cp = yy_c_buf_p; - - /* Support of definitiontext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 324 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 454 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < definitionleng; ++yyl ) - if ( definitiontext[yyl] == '\n' ) - ++definitionlineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 103 "definition_lex.l" -{ /* skip charcters from 80H - FFH */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 105 "definition_lex.l" -{ /* skip comment lines */ - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 107 "definition_lex.l" -{ /* skip empty lines */ - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 109 "definition_lex.l" -{ /* skip comment */ } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 110 "definition_lex.l" -{ /* skip white space */ } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 111 "definition_lex.l" -{ /* skip empty lines */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 113 "definition_lex.l" -{ - // skip newlines - //Reset token position and - //save the next line - strcpy(prev_linebuf, curr_linebuf); - strcpy(curr_linebuf, definitiontext+1); - yyless(1); // give back all but the \n to rescan - } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 121 "definition_lex.l" -{ /* continuation line */ - } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 124 "definition_lex.l" -{ definitionlval.valueType = ATTR_VAL_TYPE_DEFINED; RETURN(VALUETYPE); } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 125 "definition_lex.l" -{ definitionlval.valueType = ATTR_VAL_TYPE_ENUMERATED; RETURN(VALUETYPE); } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 126 "definition_lex.l" -{ definitionlval.valueType = ATTR_VAL_TYPE_DEFINED_LIST; RETURN(VALUETYPE); } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 127 "definition_lex.l" -{ definitionlval.valueType = ATTR_VAL_TYPE_ENUMERATED_LIST; RETURN(VALUETYPE); } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 129 "definition_lex.l" -{ definitionlval.usage = MOD_USAGE_C; RETURN(USAGE); } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 130 "definition_lex.l" -{ definitionlval.usage = MOD_USAGE_M; RETURN(USAGE); } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 131 "definition_lex.l" -{ definitionlval.usage = MOD_USAGE_U; RETURN(USAGE); } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 133 "definition_lex.l" -{ definitionlval.type = ATTR_TYPE_1C; RETURN(TYPE); } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 134 "definition_lex.l" -{ definitionlval.type = ATTR_TYPE_2C; RETURN(TYPE); } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 135 "definition_lex.l" -{ definitionlval.type = ATTR_TYPE_3C; RETURN(TYPE); } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 136 "definition_lex.l" -{ definitionlval.type = ATTR_TYPE_3R; RETURN(TYPE); } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 138 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_AE; RETURN(VR); } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 139 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_AS; RETURN(VR); } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 140 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_AT; RETURN(VR); } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 141 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_CS; RETURN(VR); } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 142 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_DA; RETURN(VR); } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 143 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_DS; RETURN(VR); } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 144 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_DT; RETURN(VR); } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 145 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_FD; RETURN(VR); } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 146 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_FL; RETURN(VR); } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 147 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_IS; RETURN(VR); } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 148 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_LO; RETURN(VR); } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 149 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_LT; RETURN(VR); } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 150 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_OB; RETURN(VR); } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 151 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_OF; RETURN(VR); } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 152 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_OW; RETURN(VR); } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 153 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_OL; RETURN(VR); } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 154 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_OV; RETURN(VR); } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 155 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_OD; RETURN(VR); } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 156 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_PN; RETURN(VR); } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 157 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_SH; RETURN(VR); } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 158 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_SL; RETURN(VR); } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 159 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_SQ; RETURN(T_SQ); } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 160 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_SS; RETURN(VR); } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 161 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_ST; RETURN(VR); } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 162 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_SV; RETURN(VR); } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 163 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_TM; RETURN(VR); } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 164 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_UI; RETURN(VR); } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 165 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_UL; RETURN(VR); } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 166 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_UN; RETURN(VR); } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 167 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_US; RETURN(VR); } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 168 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_UT; RETURN(VR); } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 169 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_UR; RETURN(VR); } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 170 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_UV; RETURN(VR); } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 171 "definition_lex.l" -{ definitionlval.vr = ATTR_VR_UC; RETURN(VR); } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 173 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CECHO_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 174 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CECHO_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 175 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CFIND_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 176 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CFIND_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 177 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CGET_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 178 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CGET_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 179 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CMOVE_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 180 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CMOVE_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 181 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CSTORE_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 182 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CSTORE_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 183 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_CCANCEL_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 184 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NACTION_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 185 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NACTION_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 186 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NCREATE_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 187 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NCREATE_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 188 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NDELETE_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 189 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NDELETE_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 190 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NEVENTREPORT_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 191 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NEVENTREPORT_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 192 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NGET_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 193 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NGET_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 194 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NSET_RQ; RETURN(COMMANDFIELD); } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 195 "definition_lex.l" -{ definitionlval.commandField = DIMSE_CMD_NSET_RSP; RETURN(COMMANDFIELD); } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 198 "definition_lex.l" -{ RETURN(T_DEFINE); } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 199 "definition_lex.l" -{ RETURN(T_ENDDEFINE); } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 200 "definition_lex.l" -{ RETURN(T_SYSTEM); } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 201 "definition_lex.l" -{ RETURN(T_METASOPCLASS); } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 202 "definition_lex.l" -{ RETURN(T_SOPCLASS); } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 203 "definition_lex.l" -{ RETURN(T_MODULE); } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 204 "definition_lex.l" -{ RETURN(T_ITEM); } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 205 "definition_lex.l" -{ RETURN(T_INCLUDEITEM); } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 206 "definition_lex.l" -{ RETURN(T_MACRO); } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 207 "definition_lex.l" -{ RETURN(T_INCLUDEMACRO); } - YY_BREAK -case 87: -YY_RULE_SETUP -#line 208 "definition_lex.l" -{ RETURN(T_EQUAL); } - YY_BREAK -case 88: -YY_RULE_SETUP -#line 209 "definition_lex.l" -{ RETURN(T_LESS); } - YY_BREAK -case 89: -YY_RULE_SETUP -#line 210 "definition_lex.l" -{ RETURN(T_GREATER); } - YY_BREAK -case 90: -YY_RULE_SETUP -#line 211 "definition_lex.l" -{ RETURN(T_LESS_OR_EQUAL);} - YY_BREAK -case 91: -YY_RULE_SETUP -#line 212 "definition_lex.l" -{ RETURN(T_GREATER_OR_EQUAL);} - YY_BREAK -case 92: -YY_RULE_SETUP -#line 213 "definition_lex.l" -{ RETURN(T_WEAK);} - YY_BREAK -case 93: -YY_RULE_SETUP -#line 214 "definition_lex.l" -{ RETURN(T_WARN);} - YY_BREAK -case 94: -YY_RULE_SETUP -#line 215 "definition_lex.l" -{ RETURN(T_AND);} - YY_BREAK -case 95: -YY_RULE_SETUP -#line 216 "definition_lex.l" -{ RETURN(T_OR);} - YY_BREAK -case 96: -YY_RULE_SETUP -#line 217 "definition_lex.l" -{ RETURN(T_NOT);} - YY_BREAK -case 97: -YY_RULE_SETUP -#line 218 "definition_lex.l" -{ RETURN(T_PRESENT);} - YY_BREAK -case 98: -YY_RULE_SETUP -#line 219 "definition_lex.l" -{ RETURN(T_EMPTY);} - YY_BREAK -case 99: -YY_RULE_SETUP -#line 220 "definition_lex.l" -{ RETURN(T_TRUE);} - YY_BREAK -case 100: -YY_RULE_SETUP -#line 221 "definition_lex.l" -{ RETURN(T_FALSE);} - YY_BREAK -case 101: -YY_RULE_SETUP -#line 222 "definition_lex.l" -{ RETURN(T_VALUE);} - YY_BREAK -case 102: -YY_RULE_SETUP -#line 224 "definition_lex.l" -{ - strcpy(definitionlval.string, definitiontext); - RETURN(STRING); - } - YY_BREAK -case 103: -#line 231 "definition_lex.l" -case 104: -YY_RULE_SETUP -#line 231 "definition_lex.l" -{ - definitionlval.hex = strtoul(definitiontext, &End_ptr, 16); - RETURN(HEX); - } - YY_BREAK -case 105: -#line 236 "definition_lex.l" -case 106: -YY_RULE_SETUP -#line 236 "definition_lex.l" -{ - definitionlval.integer = atoi(definitiontext); - RETURN(INTEGER); - } - YY_BREAK -case 107: -YY_RULE_SETUP -#line 240 "definition_lex.l" -{ - for (definitionleng = definitionleng-2; definitionleng >= 0; definitionleng--) - { - unput(definitiontext[definitionleng]); /* concatenate line */ - } - } - YY_BREAK -case 108: -YY_RULE_SETUP -#line 246 "definition_lex.l" -{ - if ((definitionleng-2) >= sizeof(definitionlval.string)) - { - yywarn("STRING too long!!! truncated") ; - definitionleng = sizeof(definitionlval.string) +1 ; - } - memcpy(definitionlval.string, &definitiontext[1], definitionleng-2); - definitionlval.string[definitionleng-2] = '\0'; - RETURN(STRING); - } - YY_BREAK -case 109: -YY_RULE_SETUP -#line 256 "definition_lex.l" -{ - RETURN(definitiontext[0]); - } - YY_BREAK -case 110: -YY_RULE_SETUP -#line 259 "definition_lex.l" -ECHO; - YY_BREAK - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - definitiontext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed definitionin at a new source and called - * definitionlex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = definitionin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = definitiontext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = definitiontext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( definitionwrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * definitiontext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = definitiontext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - definitiontext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = definitiontext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = definitiontext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of definitionlex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = definitiontext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - definitiontext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - definitiontext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - definitionrestart( definitionin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - definitiontext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = definitiontext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 324 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 324 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - yy_is_jam = (yy_current_state == 323); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void definitionunput( int c, register char *yy_bp ) -#else -static void definitionunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up definitiontext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --definitionlineno; - - definitiontext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int definitioninput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - definitiontext_ptr = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - if ( definitionwrap() ) - { - yy_c_buf_p = - definitiontext_ptr + YY_MORE_ADJ; - return EOF; - } - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return definitioninput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = definitiontext_ptr + YY_MORE_ADJ; - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in definitioninput()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve definitiontext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++definitionlineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void definitionrestart( FILE *input_file ) -#else -void definitionrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = definition_create_buffer( definitionin, YY_BUF_SIZE ); - - definition_init_buffer( yy_current_buffer, input_file ); - definition_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void definition_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void definition_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - definition_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (definitionwrap()) processing, but the only time this flag - * is looked at is after definitionwrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void definition_load_buffer_state( void ) -#else -void definition_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - definitiontext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - definitionin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE definition_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE definition_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in definition_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in definition_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - definition_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void definition_delete_buffer( YY_BUFFER_STATE b ) -#else -void definition_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void definition_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void definition_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - definition_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void definition_flush_buffer( YY_BUFFER_STATE b ) -#else -void definition_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - definition_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE definition_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE definition_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in definition_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - definition_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE definition_scan_string( yyconst char *str ) -#else -YY_BUFFER_STATE definition_scan_string( str ) -yyconst char *str; -#endif - { - int len; - for ( len = 0; str[len]; ++len ) - ; - - return definition_scan_bytes( str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE definition_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE definition_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in definition_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = definition_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in definition_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up definitiontext. */ \ - definitiontext[definitionleng] = yy_hold_char; \ - yy_c_buf_p = definitiontext + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - definitionleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef definitiontext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - definitionlex(); - return 0; - } -#endif -#line 259 "definition_lex.l" - - -void definitionerror(char *errmsg) -{ - if ( definitionfilelogger_ptr) - { - definitionfilelogger_ptr->text(LOG_ERROR, 1, "lineno: %d %s: ", - definitionlineno, - errmsg); - definitionfilelogger_ptr->text(LOG_NONE, 1, "Current line: "); - definitionfilelogger_ptr->text(LOG_NONE, 1, "%-50s...",curr_linebuf); - } - - //Switch to parse only mode and try to find more errors - definitionParseOnly = true; - definitionerrors++; - - if (definitionerrors > 10) - { - if ( definitionfilelogger_ptr) - { - definitionfilelogger_ptr->text(LOG_ERROR, 1, "Unable to recover from previous errors. Stopping..."); - } - exit(1); - } -} - -void definitionerror(char *errmsg, bool PrintCurrentLine) -{ - char linebuf[MAXIMUM_LINE_LENGTH]; - if (PrintCurrentLine) - { - strcpy(linebuf, curr_linebuf); - } - else - { - strcpy(linebuf, prev_linebuf); - } - - if ( definitionfilelogger_ptr) - { - definitionfilelogger_ptr->text(LOG_ERROR, 1, "lineno: %d %s: ", - definitionlineno, - errmsg); - definitionfilelogger_ptr->text(LOG_NONE, 1, "Current line: "); - definitionfilelogger_ptr->text(LOG_NONE, 1, "%-50s...",curr_linebuf); - } - - //Switch to parse only mode and try to find more errors - definitionParseOnly = true; - definitionerrors++; -} - -void yywarn(char *msg) -{ - if ( definitionfilelogger_ptr) - { - definitionfilelogger_ptr->text(LOG_WARNING, 1, "lineno: %d %s: ", - definitionlineno, - msg); - definitionfilelogger_ptr->text(LOG_NONE, 1, "Current line: "); - definitionfilelogger_ptr->text(LOG_NONE, 1, "%-50s...",curr_linebuf); - } - - definitionwarnings++; -} - -void yywarn(char *msg, bool PrintCurrentLine) -{ - char linebuf[MAXIMUM_LINE_LENGTH]; - if (PrintCurrentLine) - { - strcpy(linebuf, curr_linebuf); - } - else - { - strcpy(linebuf, prev_linebuf); - } - - if ( definitionfilelogger_ptr) - { - definitionfilelogger_ptr->text(LOG_WARNING, 1, "lineno: %d %s: ", - definitionlineno, - msg); - definitionfilelogger_ptr->text(LOG_NONE, 1, "Current line: "); - definitionfilelogger_ptr->text(LOG_NONE, 1, "%-50s...",curr_linebuf); - } - - definitionwarnings++; -} - -bool IsHex(char digit, int *value) -{ - bool isHex = true; - - if (isdigit(digit)) - { - *value = digit - '0'; - } - else if (('a' <= digit) && (digit <= 'f')) - { - *value = digit - 'W'; - } - else if (('A' <= digit) && (digit <= 'F')) - { - *value = digit - '7'; - } - else - { - isHex = false; - } - - return isHex; -} diff --git a/DVTk_Library/Libraries/Definition/definition_parse.cpp b/DVTk_Library/Libraries/Definition/definition_parse.cpp deleted file mode 100644 index 6aab522..0000000 --- a/DVTk_Library/Libraries/Definition/definition_parse.cpp +++ /dev/null @@ -1,2745 +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 223 -#define YYFLAG -32768 -#define YYNTBASE 45 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 291 ? yytranslate[x] : 129) - -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, 168, 173, 175, 178, 181, 183, - 187, 191, 193, 195, 197, 201, 205, 207, 209, 213, - 214, 217, 222, 226, 228, 232, 236, 238, 240, 242, - 246, 248, 250, 252, 256, 258, 261, 263, 266, 268, - 270, 274, 276, 277, 280, 283, 291, 293, 295, 297, - 301, 303, 307, 310, 313, 319, 322, 326, 331, 333, - 335, 336, 338, 340, 342, 344, 346, 348, 350, 352, - 354, 357, 360, 363, 366, 370, 374, 378, 381, 383, - 386, 390, 392, 395, 397, 399, 402 -}; - -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, 104, 0, 106, 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, 111, 0, 82, 0, 81, - 82, 0, 37, 83, 38, 85, 38, 88, 39, 86, - 87, 0, 109, 0, 84, 0, 31, 0, 30, 0, - 33, 0, 29, 0, 111, 0, 89, 0, 91, 0, - 90, 92, 0, 90, 0, 13, 38, 94, 38, 0, - 13, 38, 94, 38, 95, 38, 0, 96, 38, 94, - 97, 0, 93, 0, 92, 93, 0, 24, 82, 0, - 30, 0, 30, 40, 30, 0, 30, 40, 41, 0, - 29, 0, 41, 0, 30, 0, 30, 40, 30, 0, - 30, 40, 41, 0, 41, 0, 36, 0, 36, 42, - 36, 0, 0, 38, 98, 0, 38, 98, 38, 99, - 0, 101, 38, 102, 0, 100, 0, 99, 38, 100, - 0, 101, 38, 102, 0, 102, 0, 35, 0, 103, - 0, 102, 43, 103, 0, 29, 0, 31, 0, 30, - 0, 9, 105, 81, 0, 29, 0, 107, 81, 0, - 107, 0, 10, 108, 0, 10, 0, 29, 0, 12, - 108, 110, 0, 111, 0, 0, 40, 29, 0, 40, - 114, 0, 40, 27, 37, 112, 38, 113, 39, 0, - 114, 0, 114, 0, 115, 0, 114, 15, 115, 0, - 116, 0, 115, 14, 116, 0, 17, 120, 0, 19, - 120, 0, 18, 120, 117, 119, 118, 0, 16, 116, - 0, 37, 114, 39, 0, 28, 37, 114, 39, 0, - 20, 0, 21, 0, 0, 30, 0, 29, 0, 22, - 0, 23, 0, 24, 0, 25, 0, 26, 0, 84, - 0, 121, 0, 122, 84, 0, 123, 84, 0, 125, - 84, 0, 127, 84, 0, 122, 127, 84, 0, 123, - 127, 84, 0, 125, 127, 84, 0, 44, 42, 0, - 124, 0, 123, 124, 0, 44, 44, 42, 0, 126, - 0, 125, 126, 0, 42, 0, 128, 0, 127, 128, - 0, 84, 42, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 158, 165, 166, 170, 171, 179, 182, 185, 193, 194, - 195, 196, 197, 198, 201, 204, 213, 219, 226, 235, - 241, 248, 258, 267, 273, 279, 286, 295, 298, 304, - 310, 321, 324, 344, 353, 378, 386, 392, 414, 415, - 418, 425, 431, 445, 451, 458, 461, 467, 470, 471, - 474, 481, 485, 494, 501, 521, 530, 539, 564, 565, - 568, 581, 597, 623, 650, 653, 654, 658, 661, 669, - 677, 685, 692, 702, 710, 718, 726, 736, 744, 755, - 759, 764, 771, 787, 788, 791, 799, 812, 821, 828, - 837, 844, 851, 860, 863, 868, 881, 887, 895, 906, - 909, 925, 929, 930, 940, 955, 976, 982, 988, 992, - 1002, 1006, 1016, 1024, 1036, 1059, 1067, 1071, 1076, 1084, - 1094, 1098, 1104, 1107, 1115, 1123, 1131, 1139, 1149, 1160, - 1169, 1179, 1195, 1211, 1227, 1244, 1267, 1292, 1302, 1309, - 1324, 1334, 1341, 1356, 1366, 1373, 1388 -}; - -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","AttributeIM","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","AttributeTagRootPath","AttributeTagRoot", -"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, 90, 91, 92, 92, 93, 94, 94, - 94, 94, 94, 95, 95, 95, 95, 96, 96, 97, - 97, 97, 98, 99, 99, 100, 100, 101, 102, 102, - 103, 103, 103, 104, 105, 106, 106, 107, 107, 108, - 109, 110, 111, 111, 111, 111, 112, 113, 114, 114, - 115, 115, 116, 116, 116, 116, 116, 116, 116, 116, - 117, 117, 118, 119, 119, 119, 119, 119, 120, 120, - 121, 121, 121, 121, 121, 121, 121, 122, 123, 123, - 124, 125, 125, 126, 127, 127, 128 -}; - -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, 6, 4, 1, 2, 2, 1, 3, - 3, 1, 1, 1, 3, 3, 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, 2, 3, 3, 3, 2, 1, 2, - 3, 1, 2, 1, 1, 2, 2 -}; - -static const short definitiondefact[] = { 0, - 5, 7, 0, 2, 4, 0, 3, 0, 0, 0, - 99, 33, 0, 9, 10, 11, 0, 32, 12, 13, - 14, 97, 17, 0, 0, 24, 0, 0, 95, 0, - 100, 98, 8, 6, 0, 35, 0, 0, 31, 49, - 52, 96, 20, 15, 0, 18, 16, 0, 22, 26, - 25, 23, 94, 103, 54, 0, 53, 38, 34, 37, - 50, 21, 19, 29, 0, 27, 0, 101, 102, 0, - 44, 36, 39, 42, 30, 28, 0, 0, 0, 0, - 119, 120, 0, 0, 104, 0, 105, 109, 111, 55, - 56, 0, 45, 0, 40, 41, 116, 144, 0, 129, - 113, 130, 0, 0, 139, 0, 142, 0, 145, 121, - 114, 0, 0, 0, 0, 0, 0, 47, 43, 103, - 138, 0, 147, 131, 0, 0, 132, 140, 0, 133, - 143, 0, 134, 146, 122, 0, 0, 107, 0, 117, - 110, 112, 0, 78, 0, 59, 62, 60, 0, 46, - 48, 141, 135, 136, 137, 124, 125, 126, 127, 128, - 0, 0, 118, 0, 0, 0, 0, 61, 66, 0, - 123, 115, 0, 108, 72, 69, 73, 0, 79, 57, - 103, 68, 67, 80, 106, 0, 63, 51, 58, 0, - 65, 70, 71, 74, 77, 0, 88, 81, 0, 0, - 64, 0, 0, 75, 76, 91, 93, 92, 82, 84, - 0, 87, 89, 83, 0, 0, 0, 85, 86, 90, - 0, 0, 0 -}; - -static const short definitiondefgoto[] = { 221, - 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, 119, 120, 150, 39, 40, 56, 100, 92, - 181, 188, 145, 146, 147, 148, 168, 169, 178, 196, - 149, 191, 198, 209, 210, 211, 212, 213, 20, 30, - 21, 22, 32, 41, 68, 69, 137, 173, 87, 88, - 89, 136, 172, 161, 101, 102, 103, 104, 105, 106, - 107, 108, 109 -}; - -static const short definitionpact[] = { 91, --32768,-32768, 101,-32768,-32768, 3,-32768, -11, 19, 31, - 40,-32768, 25,-32768,-32768,-32768, -4,-32768,-32768,-32768, --32768, -1,-32768, 65, 75,-32768, 57, 87,-32768, -1, --32768,-32768,-32768,-32768, 40,-32768, 42, 57, -1,-32768, --32768, -1,-32768,-32768, 88,-32768,-32768, 89, 57,-32768, --32768,-32768, -1, 79,-32768, 83,-32768,-32768,-32768, 112, --32768,-32768,-32768,-32768, 93,-32768, 34,-32768,-32768, 76, - 94, 112,-32768, -1,-32768,-32768, 63, -5, -5, -5, --32768,-32768, 90, 92,-32768, 63, 109, 111,-32768,-32768, --32768, 95,-32768, 96,-32768, -1,-32768,-32768, 46, 84, --32768,-32768, 42, 12,-32768, 7,-32768, 42,-32768, 102, --32768, 63, 63, 1, 63, 63, 6,-32768,-32768, 79, --32768, 97,-32768, 84, 42, 98, 84,-32768, 42, 84, --32768, 42, 84,-32768,-32768, -2, 99, 109, 2,-32768, - 111,-32768, 100, 103, 104,-32768, 107,-32768, 106,-32768, --32768,-32768, 84, 84, 84,-32768,-32768,-32768,-32768,-32768, - 105, 63,-32768, 17, 110, 118, -1, 107,-32768, 17, --32768,-32768, 113, 109,-32768, 108,-32768, 115,-32768,-32768, - 79,-32768,-32768, 116,-32768, 36, 44,-32768,-32768, 114, --32768,-32768,-32768, 117,-32768, 120,-32768, 121, 122, 45, --32768, 68, 82,-32768,-32768,-32768,-32768,-32768, 123,-32768, - 124, 125,-32768, 125, 68, 82, 82,-32768, 125,-32768, - 135, 136,-32768 -}; - -static const short definitionpgoto[] = {-32768, --32768, 137,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 38,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 69, --32768,-32768,-32768,-32768,-32768, -15, -39,-32768, -36,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, -18, -19,-32768, --32768,-32768,-32768,-32768, -60, -34, -171, -54,-32768,-32768, --32768,-32768, 129,-32768,-32768, -116,-32768,-32768, -84, 50, - -72,-32768,-32768,-32768, 35,-32768,-32768,-32768, 62,-32768, - 61, 4, -98 -}; - - -#define YYLAST 168 - - -static const short yytable[] = { 61, - 57, 114, 61, 151, 97, 8, 42, 35, 9, 134, - 35, 10, 11, 61, 53, 115, 115, 23, 143, 156, - 157, 158, 159, 160, 36, 55, 134, 138, 139, 33, - 134, 214, 37, 134, 12, 37, 98, 55, 99, 140, - 163, 144, 55, 142, 219, 175, 176, 26, 98, 77, - 78, 79, 80, 81, 82, 126, 61, 177, 96, 29, - 83, 84, 85, 48, 189, 192, 124, 127, 31, 130, - 86, 133, 55, 194, 204, 58, 193, 174, 77, 78, - 79, 80, 81, 82, 195, 205, 66, 121, 153, 122, - 84, 1, 154, 43, 2, 155, 206, 207, 208, 86, - -1, 1, 197, 46, 2, 90, 125, 129, 91, 132, - 206, 207, 208, 110, 111, 51, 62, 64, 67, 71, - 70, 75, 93, 115, 116, 123, 112, 182, 113, 118, - 167, 135, 117, 171, 222, 223, 162, 164, 152, 7, - 95, 122, 166, 170, 165, 179, 180, 186, 197, 183, - 184, 185, 187, 190, 218, 199, 200, 201, 202, 203, - 215, 216, 220, 54, 141, 128, 131, 217 -}; - -static const short yycheck[] = { 39, - 37, 86, 42, 120, 77, 3, 22, 12, 6, 108, - 12, 9, 10, 53, 30, 15, 15, 29, 13, 22, - 23, 24, 25, 26, 29, 31, 125, 112, 113, 5, - 129, 203, 37, 132, 32, 37, 42, 31, 44, 39, - 39, 36, 31, 116, 216, 29, 30, 29, 42, 16, - 17, 18, 19, 20, 21, 44, 96, 41, 74, 29, - 27, 28, 29, 7, 181, 30, 103, 104, 29, 106, - 37, 108, 31, 30, 30, 38, 41, 162, 16, 17, - 18, 19, 20, 21, 41, 41, 49, 42, 125, 44, - 28, 1, 129, 29, 4, 132, 29, 30, 31, 37, - 0, 1, 35, 29, 4, 30, 103, 104, 33, 106, - 29, 30, 31, 79, 80, 29, 29, 29, 40, 8, - 38, 29, 29, 15, 14, 42, 37, 167, 37, 34, - 24, 30, 38, 29, 0, 0, 38, 38, 42, 3, - 72, 44, 39, 38, 42, 36, 29, 40, 35, 168, - 170, 39, 38, 38, 215, 190, 40, 38, 38, 38, - 38, 38, 217, 35, 115, 104, 106, 43 -}; -/* -*-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 159 "definition_parse.y" -{ - ResolveMacroReferences(); - ResetVariables(); - ; - break;} -case 5: -#line 172 "definition_parse.y" -{ - definitionwarn("Skipping to next define"); - definitionParseOnly = true; - YYABORT; - ; - break;} -case 8: -#line 186 "definition_parse.y" -{ - // reset the skip definition parameter to allow more than - // 1 sopclass definition in 1 file - skipDefinition = false; - ; - break;} -case 16: -#line 205 "definition_parse.y" -{ - if (!definitionParseOnly) - { - defFileContent_ptr->SetSystem(lsystemname, lsystemversion); - } - ; - break;} -case 17: -#line 214 "definition_parse.y" -{ - strcpy(lsystemname, definitionval.string); - ; - break;} -case 18: -#line 220 "definition_parse.y" -{ - strcpy(lsystemversion, definitionval.string); - ; - break;} -case 19: -#line 227 "definition_parse.y" -{ - if (!definitionParseOnly) - { - defFileContent_ptr->SetAE(lAEname, lAEversion); - } - ; - break;} -case 20: -#line 236 "definition_parse.y" -{ - strcpy(lAEname, definitionval.string); - ; - break;} -case 21: -#line 242 "definition_parse.y" -{ - strcpy(lAEversion, definitionval.string); - ; - break;} -case 22: -#line 249 "definition_parse.y" -{ - if (!definitionParseOnly) - { - defFileContent_ptr->SetMetaSop(currentMetaSopClass_ptr); - definitionfileempty = false; - } - ; - break;} -case 23: -#line 259 "definition_parse.y" -{ - if (!definitionParseOnly) - { - currentMetaSopClass_ptr = new DEF_METASOPCLASS_CLASS(lMetaSOPClassUID, lMetaSOPClassName); - } - ; - break;} -case 24: -#line 268 "definition_parse.y" -{ - strcpy(lMetaSOPClassUID, definitionval.string); - ; - break;} -case 25: -#line 274 "definition_parse.y" -{ - strcpy(lMetaSOPClassName, definitionval.string); - ; - break;} -case 26: -#line 280 "definition_parse.y" -{ - if (!definitionParseOnly) - { - currentMetaSopClass_ptr->AddSopClass(lSOPClassUID, lSOPClassName); - } - ; - break;} -case 27: -#line 287 "definition_parse.y" -{ - if (!definitionParseOnly) - { - currentMetaSopClass_ptr->AddSopClass(lSOPClassUID, lSOPClassName); - } - ; - break;} -case 29: -#line 299 "definition_parse.y" -{ - strcpy(lSOPClassUID, definitionval.string); - ; - break;} -case 30: -#line 305 "definition_parse.y" -{ - strcpy(lSOPClassName, definitionval.string); - ; - break;} -case 31: -#line 311 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentCommand_ptr->AddModule(currentModule_ptr); - defFileContent_ptr->AddCommand(currentCommand_ptr); - definitionfileempty = false; - } - ; - break;} -case 33: -#line 325 "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 345 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionfileempty = false; - } - ; - break;} -case 35: -#line 354 "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 379 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - // add the dataset to the SOPClass Definition - currentSopClass_ptr->AddDataset(currentDataset_ptr); - } - ; - break;} -case 37: -#line 387 "definition_parse.y" -{ - // the dataset is empty - ; - break;} -case 38: -#line 393 "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 419 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentDICOMObject_ptr->AddModule(currentModule_ptr); - } - ; - break;} -case 42: -#line 426 "definition_parse.y" -{ - // the module is empty - ignore it - ; - break;} -case 43: -#line 432 "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 446 "definition_parse.y" -{ - // the module name and usage not present - ignore it - ; - break;} -case 45: -#line 452 "definition_parse.y" -{ - strcpy(lModuleName, definitionval.string); - ; - break;} -case 47: -#line 462 "definition_parse.y" -{ - lModuleUsage = definitionval.usage; - ; - break;} -case 51: -#line 475 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttributeGroup_ptr->AddAttribute(currentAttribute_ptr); - } - ; - break;} -case 53: -#line 486 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr = new DEF_ATTRIBUTE_CLASS(lAttrGroup, lAttrElement); - } - ; - break;} -case 54: -#line 495 "definition_parse.y" -{ - lAttrGroup = (UINT16) (definitionlval.hex >> 16); - lAttrElement = (UINT16) (definitionval.hex & 0x0000FFFF); - ; - break;} -case 55: -#line 502 "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 522 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetType(definitionval.type); - } - ; - break;} -case 57: -#line 531 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetName(definitionval.string); - } - ; - break;} -case 58: -#line 540 "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 569 "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 582 "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 598 "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 64: -#line 624 "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 69: -#line 662 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetVmMin((UINT) definitionvsp[0].integer); - currentAttribute_ptr->SetVmMax((UINT) definitionvsp[0].integer); - } - ; - break;} -case 70: -#line 670 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetVmMin((UINT) definitionvsp[-2].integer); - currentAttribute_ptr->SetVmMax((UINT) definitionvsp[0].integer); - } - ; - break;} -case 71: -#line 678 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetVmMin((UINT) definitionvsp[-2].integer); - currentAttribute_ptr->SetVmMax((UINT) MAXVM); - } - ; - break;} -case 72: -#line 686 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - CreateVMFromString(definitionval.string, currentAttribute_ptr); - } - ; - break;} -case 73: -#line 693 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetVmMin((UINT) 0); - currentAttribute_ptr->SetVmMax((UINT) MAXVM); - } - ; - break;} -case 74: -#line 703 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetImMin((UINT) definitionvsp[0].integer); - currentAttribute_ptr->SetImMax((UINT) definitionvsp[0].integer); - } - ; - break;} -case 75: -#line 711 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetImMin((UINT) definitionvsp[-2].integer); - currentAttribute_ptr->SetImMax((UINT) definitionvsp[0].integer); - } - ; - break;} -case 76: -#line 719 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetImMin((UINT) definitionvsp[-2].integer); - currentAttribute_ptr->SetImMax((UINT) MAXVM); - } - ; - break;} -case 77: -#line 727 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetImMin((UINT) 0); - currentAttribute_ptr->SetImMax((UINT) MAXVM); - } - ; - break;} -case 78: -#line 737 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - lAttrVr = definitionval.vr; - currentAttribute_ptr->SetVR(lAttrVr); - } - ; - break;} -case 79: -#line 745 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - lAttrVr = definitionvsp[-2].vr; - currentAttribute_ptr->SetVR(lAttrVr); - currentAttribute_ptr->SetSecondVR(definitionvsp[0].vr); - } - ; - break;} -case 80: -#line 756 "definition_parse.y" -{ - // empty - ; - break;} -case 81: -#line 760 "definition_parse.y" -{ - // reset the list index for the next attribute values - currentValueListIndex = 0; - ; - break;} -case 82: -#line 765 "definition_parse.y" -{ - // reset the list index for the next attribute values - currentValueListIndex = 0; - ; - break;} -case 83: -#line 772 "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 86: -#line 792 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->SetValueType(currentValueType, currentValueListIndex); - currentValueListIndex++; - } - ; - break;} -case 87: -#line 800 "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 88: -#line 813 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentValueType = definitionval.valueType; - } - ; - break;} -case 89: -#line 822 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->AddValue(currentValue_ptr, currentValueListIndex); - } - ; - break;} -case 90: -#line 829 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentAttribute_ptr->AddValue(currentValue_ptr, currentValueListIndex); - } - ; - break;} -case 91: -#line 838 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentValue_ptr = CreateValueFromString(definitionval.string, lAttrVr); - } - ; - break;} -case 92: -#line 845 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentValue_ptr = CreateValueFromHex(definitionval.hex, lAttrVr); - } - ; - break;} -case 93: -#line 852 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - currentValue_ptr = CreateValueFromInt(definitionval.integer, lAttrVr); - } - ; - break;} -case 95: -#line 864 "definition_parse.y" -{ - ; - break;} -case 96: -#line 869 "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 97: -#line 882 "definition_parse.y" -{ - // Macro is empty - ignore it - ; - break;} -case 98: -#line 888 "definition_parse.y" -{ - if (!definitionParseOnly) - { - currentMacro_ptr = new DEF_MACRO_CLASS(definitionvsp[0].string); - currentAttributeGroup_ptr = currentMacro_ptr; - } - ; - break;} -case 99: -#line 896 "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 101: -#line 910 "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 104: -#line 931 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - lTextualCondition = definitionvsp[0].string; - - // reset condition pointer - currentCondition_ptr = NULL; - } - ; - break;} -case 105: -#line 941 "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 106: -#line 956 "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 107: -#line 977 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[0].node_ptr; - ; - break;} -case 108: -#line 983 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[0].node_ptr; - ; - break;} -case 109: -#line 989 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[0].node_ptr; - ; - break;} -case 110: -#line 993 "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 111: -#line 1003 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[0].node_ptr; - ; - break;} -case 112: -#line 1007 "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 113: -#line 1017 "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 114: -#line 1025 "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 115: -#line 1037 "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 116: -#line 1060 "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 117: -#line 1068 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[-1].node_ptr; - ; - break;} -case 118: -#line 1072 "definition_parse.y" -{ - definitionval.node_ptr = definitionvsp[-1].node_ptr; - definitionval.node_ptr->SetConditionType(CONDITION_TYPE_WARNING); - ; - break;} -case 119: -#line 1077 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.node_ptr = new CONDITION_LEAF_TRUE_CLASS(true); - definitionval.node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 120: -#line 1085 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.node_ptr = new CONDITION_LEAF_TRUE_CLASS(false); - definitionval.node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 121: -#line 1095 "definition_parse.y" -{ - definitionval.integer = APPLY_TO_ANY_VALUE; - ; - break;} -case 122: -#line 1099 "definition_parse.y" -{ - definitionval.integer = definitionvsp[0].integer; - ; - break;} -case 124: -#line 1108 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.binary_node_ptr = new CONDITION_EQ_NODE_CLASS(); - definitionval.binary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 125: -#line 1116 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.binary_node_ptr = new CONDITION_LESS_NODE_CLASS(); - definitionval.binary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 126: -#line 1124 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.binary_node_ptr = new CONDITION_GREATER_NODE_CLASS(); - definitionval.binary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 127: -#line 1132 "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 128: -#line 1140 "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 129: -#line 1150 "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 130: -#line 1161 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = definitionvsp[0].unary_node_ptr; - } - ; - break;} -case 131: -#line 1170 "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 132: -#line 1180 "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 133: -#line 1196 "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 134: -#line 1212 "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 135: -#line 1228 "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 136: -#line 1245 "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 137: -#line 1268 "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 138: -#line 1293 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = new CONDITION_NAVIGATION_HERE_NODE_CLASS(true); - definitionval.unary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 139: -#line 1303 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = definitionvsp[0].unary_node_ptr; - } - ; - break;} -case 140: -#line 1310 "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 141: -#line 1325 "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 142: -#line 1335 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = definitionvsp[0].unary_node_ptr; - } - ; - break;} -case 143: -#line 1342 "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 144: -#line 1357 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = new CONDITION_NAVIGATION_ROOT_NODE_CLASS(); - definitionval.unary_node_ptr->SetLogger(definitionfilelogger_ptr); - } - ; - break;} -case 145: -#line 1367 "definition_parse.y" -{ - if (!definitionParseOnly && !skipDefinition) - { - definitionval.unary_node_ptr = definitionvsp[0].unary_node_ptr; - } - ; - break;} -case 146: -#line 1374 "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 147: -#line 1389 "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 1397 "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_SV: - definitionwarn("Attribute SV 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; - case ATTR_VR_UV: - definitionwarn("Attribute UV 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/Libraries/Definition/definition_parse.cpp.h b/DVTk_Library/Libraries/Definition/definition_parse.cpp.h deleted file mode 100644 index 35f19bd..0000000 --- a/DVTk_Library/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/Libraries/Emulator/imagedisplay_lex.cpp b/DVTk_Library/Libraries/Emulator/imagedisplay_lex.cpp deleted file mode 100644 index 2ca1814..0000000 --- a/DVTk_Library/Libraries/Emulator/imagedisplay_lex.cpp +++ /dev/null @@ -1,1757 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE imagedisplayrestart( imagedisplayin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int imagedisplayleng; -extern FILE *imagedisplayin, *imagedisplayout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up imagedisplaytext. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up imagedisplaytext again */ \ - } \ - while ( 0 ) - -#define unput(c) imagedisplayunput( c, imagedisplaytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via imagedisplayrestart()), so that the user can continue scanning by - * just pointing imagedisplayin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when imagedisplaytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int imagedisplayleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow imagedisplaywrap()'s to do buffer switches - * instead of setting up a fresh imagedisplayin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void imagedisplayrestart YY_PROTO(( FILE *input_file )); - -void imagedisplay_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void imagedisplay_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE imagedisplay_create_buffer YY_PROTO(( FILE *file, int size )); -void imagedisplay_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void imagedisplay_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void imagedisplay_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER imagedisplay_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE imagedisplay_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE imagedisplay_scan_string YY_PROTO(( yyconst char *str )); -YY_BUFFER_STATE imagedisplay_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer imagedisplay_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = imagedisplay_create_buffer( imagedisplayin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = imagedisplay_create_buffer( imagedisplayin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define imagedisplaywrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *imagedisplayin = (FILE *) 0, *imagedisplayout = (FILE *) 0; -typedef int yy_state_type; -#define YY_FLEX_LEX_COMPAT -extern int imagedisplaylineno; -int imagedisplaylineno = 1; -extern char imagedisplaytext[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up imagedisplaytext. - */ -#define YY_DO_BEFORE_ACTION \ - imagedisplaytext_ptr = yy_bp; \ - imagedisplaytext_ptr -= yy_more_len; \ - imagedisplayleng = (int) (yy_cp - imagedisplaytext_ptr); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( imagedisplayleng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( imagedisplaytext, imagedisplaytext_ptr, imagedisplayleng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 20 -#define YY_END_OF_BUFFER 21 -static yyconst short int yy_acclist[68] = - { 0, - 21, 19, 20, 5, 19, 20, 5, 7, 20, 19, - 20, 4, 19, 20, 19, 20, 16, 19, 20, 19, - 20, 19, 20, 19, 20, 19, 20, 19, 20, 19, - 20, 1, 19, 20, 5, 19, 20, 3, 5, 6, - 7, 20, 4, 19, 20, 5, 7, 5, 7, 18, - 4, 15, 16, 8, 5, 3, 5, 6, 4, 2, - 17, 14, 9, 11, 10, 12, 13 - } ; - -static yyconst short int yy_accept[108] = - { 0, - 1, 1, 1, 2, 4, 7, 10, 12, 15, 17, - 20, 22, 24, 26, 28, 30, 32, 35, 38, 43, - 46, 47, 48, 50, 50, 51, 51, 52, 53, 54, - 54, 54, 54, 54, 54, 54, 55, 56, 59, 59, - 60, 61, 61, 62, 62, 62, 62, 62, 62, 62, - 62, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 64, 64, 64, 65, 65, 65, 65, - 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, - - 67, 67, 67, 67, 67, 68, 68 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 5, 6, 1, 1, 1, 1, 1, - 1, 1, 7, 1, 8, 1, 1, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 10, 1, 1, - 1, 1, 1, 1, 11, 1, 1, 12, 13, 14, - 15, 1, 16, 1, 1, 17, 18, 19, 20, 21, - 1, 22, 23, 24, 1, 1, 1, 1, 25, 1, - 1, 26, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 27, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28 - } ; - -static yyconst int yy_meta[29] = - { 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 - } ; - -static yyconst short int yy_base[113] = - { 0, - 0, 27, 154, 155, 32, 35, 26, 0, 144, 31, - 133, 138, 131, 131, 123, 144, 155, 40, 45, 143, - 51, 142, 54, 40, 155, 56, 0, 135, 134, 133, - 122, 126, 127, 127, 114, 155, 61, 66, 133, 132, - 155, 57, 155, 23, 114, 117, 120, 116, 106, 126, - 155, 104, 108, 113, 112, 111, 112, 109, 107, 112, - 101, 94, 155, 101, 104, 155, 99, 95, 97, 92, - 98, 87, 90, 155, 87, 99, 89, 93, 93, 87, - 77, 78, 92, 78, 84, 80, 76, 84, 72, 68, - 74, 83, 79, 75, 64, 67, 155, 64, 67, 73, - - 59, 74, 65, 68, 155, 155, 70, 78, 50, 72, - 74, 76 - } ; - -static yyconst short int yy_def[113] = - { 0, - 106, 1, 106, 106, 106, 107, 108, 109, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 107, 110, - 106, 107, 107, 108, 106, 111, 109, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 112, 110, - 106, 111, 106, 106, 106, 106, 106, 106, 106, 112, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - - 106, 106, 106, 106, 106, 0, 106, 106, 106, 106, - 106, 106 - } ; - -static yyconst short int yy_nxt[184] = - { 0, - 4, 5, 6, 5, 7, 8, 9, 9, 10, 4, - 11, 12, 13, 4, 4, 14, 4, 4, 4, 4, - 4, 4, 15, 4, 4, 16, 4, 17, 18, 19, - 25, 44, 20, 21, 21, 21, 23, 21, 23, 29, - 30, 37, 38, 21, 25, 39, 23, 21, 23, 51, - 27, 26, 21, 21, 21, 23, 21, 23, 43, 106, - 25, 25, 37, 38, 21, 26, 39, 21, 21, 21, - 22, 22, 40, 40, 42, 42, 50, 50, 24, 105, - 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, - 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, - - 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, - 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, - 64, 63, 62, 61, 60, 59, 58, 57, 41, 56, - 55, 54, 53, 52, 41, 41, 49, 48, 47, 46, - 45, 44, 29, 28, 106, 41, 36, 35, 34, 33, - 32, 31, 28, 106, 3, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106 - } ; - -static yyconst short int yy_chk[184] = - { 0, - 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, - 7, 44, 2, 5, 5, 5, 6, 6, 6, 10, - 10, 18, 18, 18, 24, 18, 19, 19, 19, 44, - 109, 7, 21, 21, 21, 23, 23, 23, 26, 42, - 26, 42, 37, 37, 37, 24, 37, 38, 38, 38, - 107, 107, 110, 110, 111, 111, 112, 112, 108, 104, - 103, 102, 101, 100, 99, 98, 96, 95, 94, 93, - 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, - - 82, 81, 80, 79, 78, 77, 76, 75, 73, 72, - 71, 70, 69, 68, 67, 65, 64, 62, 61, 60, - 59, 58, 57, 56, 55, 54, 53, 52, 50, 49, - 48, 47, 46, 45, 40, 39, 35, 34, 33, 32, - 31, 30, 29, 28, 22, 20, 16, 15, 14, 13, - 12, 11, 9, 3, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up imagedisplaytext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -static int yy_more_flag = 0; -static int yy_more_len = 0; -#define yymore() (yy_more_flag = 1) -#define YY_MORE_ADJ yy_more_len -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char imagedisplaytext[YYLMAX]; -char *imagedisplaytext_ptr; -#line 1 "imagedisplay_lex.l" -#define INITIAL 0 -#line 4 "imagedisplay_lex.l" -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -#ifdef _WINDOWS -#pragma warning (disable : 4102) -#pragma warning (disable : 4273) -#pragma warning (disable : 4786) -#endif - -/* - * contains the Lexer for the extended character set output - */ -#include -#include -#include -#include - -#define YY_NEVER_INTERACTIVE 1 - -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "imagedisplay_parse.cpp.h" - -void imagedisplayerror(char* msg); -void imagedisplaywarn(char* msg); - -// export variables for logging purposes -LOG_CLASS *imagedisplaylogger_ptr = NULL; - -// variables to keep track of current line -static char curr_linebuf[MAXIMUM_LINE_LENGTH]; - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int imagedisplaywrap YY_PROTO(( void )); -#else -extern int imagedisplaywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void imagedisplayunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef imagedisplaytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int imagedisplayinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( imagedisplaytext, imagedisplayleng, 1, imagedisplayout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( imagedisplayin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( imagedisplayin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, imagedisplayin )) == 0) \ - && ferror( imagedisplayin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int imagedisplaylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after imagedisplaytext and imagedisplayleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( imagedisplayleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (imagedisplaytext[imagedisplayleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 41 "imagedisplay_lex.l" - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! imagedisplayin ) - imagedisplayin = stdin; - - if ( ! imagedisplayout ) - imagedisplayout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - imagedisplay_create_buffer( imagedisplayin, YY_BUF_SIZE ); - - imagedisplay_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_more_len = 0; - if ( yy_more_flag ) - { - yy_more_len = imagedisplayleng; - yy_more_flag = 0; - } - yy_cp = yy_c_buf_p; - - /* Support of imagedisplaytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 107 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 155 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < imagedisplayleng; ++yyl ) - if ( imagedisplaytext[yyl] == '\n' ) - ++imagedisplaylineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 42 "imagedisplay_lex.l" -{ /* skip charcters from 80H - FFH */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 44 "imagedisplay_lex.l" -{ /* skip comment lines */ - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 46 "imagedisplay_lex.l" -{ /* skip empty lines */ - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 48 "imagedisplay_lex.l" -{ /* skip comment */ } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 49 "imagedisplay_lex.l" -{ /* skip white space */ } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 50 "imagedisplay_lex.l" -{ /* skip empty lines */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 52 "imagedisplay_lex.l" -{ - // skip newlines - // reset token position and save the next line - strcpy(curr_linebuf, imagedisplaytext+1); - yyless(1); // give back all but the \n to rescan - } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 58 "imagedisplay_lex.l" -{ /* continuation line */ - } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 61 "imagedisplay_lex.l" -{ return(T_DEFINE); } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 62 "imagedisplay_lex.l" -{ return(T_ENDDEFINE); } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 63 "imagedisplay_lex.l" -{ return(T_SYSTEM); } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 64 "imagedisplay_lex.l" -{ return(T_IMAGEDISPLAYFORMAT); } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 65 "imagedisplay_lex.l" -{ return(T_ANNOTATIONDISPLAYFORMATID); } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 67 "imagedisplay_lex.l" -{ - strcpy(imagedisplaylval.string, imagedisplaytext); - return(STRING); - } - YY_BREAK -case 15: -#line 72 "imagedisplay_lex.l" -case 16: -YY_RULE_SETUP -#line 72 "imagedisplay_lex.l" -{ - imagedisplaylval.integer = atoi(imagedisplaytext); - return(INTEGER); - } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 76 "imagedisplay_lex.l" -{ - for (imagedisplayleng = imagedisplayleng-2; imagedisplayleng >= 0; imagedisplayleng--) - { - unput(imagedisplaytext[imagedisplayleng]); /* concatenate line */ - } - } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 82 "imagedisplay_lex.l" -{ - if ((imagedisplayleng-2) >= sizeof(imagedisplaylval.string)) - { - imagedisplaywarn("STRING too long!!! truncated") ; - imagedisplayleng = sizeof(imagedisplaylval.string) +1 ; - } - memcpy(imagedisplaylval.string, &imagedisplaytext[1], imagedisplayleng-2); - imagedisplaylval.string[imagedisplayleng-2] = '\0'; - return(STRING); - } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 92 "imagedisplay_lex.l" -{ - return(imagedisplaytext[0]); - } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 95 "imagedisplay_lex.l" -ECHO; - YY_BREAK - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - imagedisplaytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed imagedisplayin at a new source and called - * imagedisplaylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = imagedisplayin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = imagedisplaytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = imagedisplaytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( imagedisplaywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * imagedisplaytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = imagedisplaytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - imagedisplaytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = imagedisplaytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = imagedisplaytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of imagedisplaylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = imagedisplaytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - imagedisplaytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - imagedisplaytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - imagedisplayrestart( imagedisplayin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - imagedisplaytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = imagedisplaytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 107 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 107 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - yy_is_jam = (yy_current_state == 106); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void imagedisplayunput( int c, register char *yy_bp ) -#else -static void imagedisplayunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up imagedisplaytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --imagedisplaylineno; - - imagedisplaytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int imagedisplayinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - imagedisplaytext_ptr = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - if ( imagedisplaywrap() ) - { - yy_c_buf_p = - imagedisplaytext_ptr + YY_MORE_ADJ; - return EOF; - } - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return imagedisplayinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = imagedisplaytext_ptr + YY_MORE_ADJ; - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in imagedisplayinput()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve imagedisplaytext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++imagedisplaylineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void imagedisplayrestart( FILE *input_file ) -#else -void imagedisplayrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = imagedisplay_create_buffer( imagedisplayin, YY_BUF_SIZE ); - - imagedisplay_init_buffer( yy_current_buffer, input_file ); - imagedisplay_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void imagedisplay_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void imagedisplay_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - imagedisplay_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (imagedisplaywrap()) processing, but the only time this flag - * is looked at is after imagedisplaywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void imagedisplay_load_buffer_state( void ) -#else -void imagedisplay_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - imagedisplaytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - imagedisplayin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE imagedisplay_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE imagedisplay_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in imagedisplay_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in imagedisplay_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - imagedisplay_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void imagedisplay_delete_buffer( YY_BUFFER_STATE b ) -#else -void imagedisplay_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void imagedisplay_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void imagedisplay_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - imagedisplay_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void imagedisplay_flush_buffer( YY_BUFFER_STATE b ) -#else -void imagedisplay_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - imagedisplay_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE imagedisplay_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE imagedisplay_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in imagedisplay_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - imagedisplay_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE imagedisplay_scan_string( yyconst char *str ) -#else -YY_BUFFER_STATE imagedisplay_scan_string( str ) -yyconst char *str; -#endif - { - int len; - for ( len = 0; str[len]; ++len ) - ; - - return imagedisplay_scan_bytes( str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE imagedisplay_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE imagedisplay_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in imagedisplay_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = imagedisplay_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in imagedisplay_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up imagedisplaytext. */ \ - imagedisplaytext[imagedisplayleng] = yy_hold_char; \ - yy_c_buf_p = imagedisplaytext + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - imagedisplayleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef imagedisplaytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - imagedisplaylex(); - return 0; - } -#endif -#line 95 "imagedisplay_lex.l" - - -void imagedisplayerror(char *errmsg) -{ - if (imagedisplaylogger_ptr) - { - imagedisplaylogger_ptr->text(LOG_ERROR, 1, "lineno: %d %s: ", imagedisplaylineno, errmsg); - imagedisplaylogger_ptr->text(LOG_NONE, 1, "Current line: "); - imagedisplaylogger_ptr->text(LOG_NONE, 1, "%-50s...", curr_linebuf); - } -} - -void imagedisplaywarn(char *errmsg) -{ - if (imagedisplaylogger_ptr) - { - imagedisplaylogger_ptr->text(LOG_WARNING, 1, "lineno: %d %s: ", imagedisplaylineno, errmsg); - imagedisplaylogger_ptr->text(LOG_NONE, 1, "Current line: "); - imagedisplaylogger_ptr->text(LOG_NONE, 1, "%-50s...", curr_linebuf); - } -} diff --git a/DVTk_Library/Libraries/Emulator/imagedisplay_parse.cpp b/DVTk_Library/Libraries/Emulator/imagedisplay_parse.cpp deleted file mode 100644 index 8592738..0000000 --- a/DVTk_Library/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/Libraries/Emulator/imagedisplay_parse.cpp.h b/DVTk_Library/Libraries/Emulator/imagedisplay_parse.cpp.h deleted file mode 100644 index 3de4301..0000000 --- a/DVTk_Library/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/Libraries/Scripting/script1_lexer.cpp b/DVTk_Library/Libraries/Scripting/script1_lexer.cpp deleted file mode 100644 index 71308c0..0000000 --- a/DVTk_Library/Libraries/Scripting/script1_lexer.cpp +++ /dev/null @@ -1,3409 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE script1restart( script1in ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int script1leng; -extern FILE *script1in, *script1out; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up script1text. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up script1text again */ \ - } \ - while ( 0 ) - -#define unput(c) script1unput( c, script1text_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via script1restart()), so that the user can continue scanning by - * just pointing script1in at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when script1text is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int script1leng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow script1wrap()'s to do buffer switches - * instead of setting up a fresh script1in. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void script1restart YY_PROTO(( FILE *input_file )); - -void script1_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void script1_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE script1_create_buffer YY_PROTO(( FILE *file, int size )); -void script1_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void script1_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void script1_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER script1_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE script1_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE script1_scan_string YY_PROTO(( yyconst char *str )); -YY_BUFFER_STATE script1_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer script1_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script1_create_buffer( script1in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script1_create_buffer( script1in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define script1wrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *script1in = (FILE *) 0, *script1out = (FILE *) 0; -typedef int yy_state_type; -#define YY_FLEX_LEX_COMPAT -extern int script1lineno; -int script1lineno = 1; -extern char script1text[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up script1text. - */ -#define YY_DO_BEFORE_ACTION \ - script1text_ptr = yy_bp; \ - script1text_ptr -= yy_more_len; \ - script1leng = (int) (yy_cp - script1text_ptr); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( script1leng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( script1text, script1text_ptr, script1leng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 211 -#define YY_END_OF_BUFFER 212 -static yyconst short int yy_acclist[969] = - { 0, - 212, 210, 211, 7, 210, 211, 7, 211, 210, 211, - 210, 211, 12, 210, 211, 14, 210, 211, 210, 211, - 206, 210, 211, 206, 210, 211, 10, 210, 211, 9, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 11, 210, 211, 13, 210, 211, 1, 210, - 211, 7, 210, 211, 6, 7, 211, 210, 211, 7, - 209, 5, 205, 206, 207, 207, 207, 207, 15, 207, - - 207, 207, 207, 16, 207, 17, 207, 207, 207, 207, - 207, 207, 18, 207, 207, 19, 207, 207, 207, 20, - 207, 21, 207, 207, 207, 207, 22, 207, 207, 23, - 207, 207, 24, 207, 207, 25, 207, 26, 207, 207, - 189, 207, 207, 27, 207, 28, 207, 192, 207, 194, - 207, 29, 207, 30, 207, 207, 31, 207, 207, 207, - 207, 207, 207, 207, 32, 207, 33, 207, 207, 34, - 207, 35, 207, 36, 207, 207, 207, 37, 207, 207, - 38, 207, 39, 207, 40, 207, 41, 207, 42, 207, - 43, 207, 207, 207, 207, 207, 207, 8, 7, 6, - - 7, 4, 5, 208, 203, 204, 204, 203, 207, 207, - 207, 142, 207, 193, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 191, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 199, 207, 207, 201, 207, 207, - 207, 207, 47, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 190, 207, 4, 2, - 4, 5, 207, 207, 207, 207, 207, 207, 207, 207, - - 207, 207, 207, 207, 50, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 58, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 52, 207, 207, 207, 207, 207, 207, - 207, 207, 59, 207, 207, 207, 207, 44, 207, 207, - 207, 207, 207, 207, 55, 207, 207, 207, 207, 207, - 207, 207, 207, 2, 4, 3, 4, 5, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - - 61, 207, 207, 207, 207, 207, 207, 207, 207, 198, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 45, 207, 207, 207, 207, 207, 207, - 207, 207, 196, 207, 207, 207, 207, 207, 207, 207, - 53, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 46, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 51, 207, 207, 207, 207, 207, - 83, 207, 207, 207, 207, 82, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 177, - - 207, 207, 207, 171, 207, 207, 207, 207, 207, 168, - 207, 207, 207, 207, 197, 207, 169, 207, 207, 54, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 186, 207, 140, 207, 207, 207, 207, 207, 48, 207, - 60, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 57, 207, 69, 207, 81, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 195, - 207, 207, 207, 207, 207, 207, 80, 207, 207, 207, - 207, 207, 207, 207, 207, 56, 67, 207, 207, 141, - 200, 207, 207, 207, 207, 207, 207, 93, 207, 207, - - 207, 207, 207, 207, 92, 207, 207, 207, 207, 207, - 207, 76, 207, 207, 207, 207, 77, 207, 207, 123, - 127, 207, 207, 207, 207, 122, 207, 207, 126, 207, - 207, 207, 65, 207, 176, 207, 207, 207, 207, 145, - 207, 207, 207, 207, 79, 207, 78, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 85, 89, 95, 97, - 207, 207, 207, 207, 84, 207, 207, 88, 207, 207, - 94, 207, 96, 207, 207, 207, 207, 207, 173, 175, - 172, 207, 174, 207, 207, 207, 125, 129, 207, 207, - 207, 207, 124, 207, 128, 207, 207, 207, 207, 207, - - 202, 207, 207, 207, 207, 143, 207, 207, 207, 207, - 207, 207, 87, 91, 99, 101, 207, 207, 207, 207, - 86, 207, 90, 207, 98, 207, 100, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 139, 137, 207, 207, 68, 207, 207, 144, 207, - 207, 207, 207, 105, 103, 207, 207, 49, 207, 104, - 207, 102, 207, 207, 207, 207, 207, 107, 111, 115, - 106, 207, 207, 110, 207, 207, 114, 207, 207, 207, - 207, 207, 207, 207, 181, 180, 207, 207, 207, 133, - 135, 131, 207, 207, 138, 207, 136, 207, 207, 207, - - 207, 207, 207, 207, 109, 113, 117, 108, 207, 112, - 207, 116, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 185, - 184, 207, 207, 207, 207, 207, 207, 132, 207, 134, - 207, 130, 207, 207, 207, 207, 188, 187, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 150, 149, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 179, 178, - 207, 63, 207, 152, 151, 207, 207, 64, 207, 207, - 207, 207, 207, 148, 147, 207, 207, 207, 207, 207, - 207, 207, 119, 118, 207, 207, 207, 170, 207, 66, - - 62, 207, 207, 207, 207, 207, 121, 120, 207, 207, - 207, 207, 71, 207, 207, 207, 207, 207, 207, 70, - 72, 207, 207, 207, 156, 155, 207, 207, 207, 207, - 207, 207, 165, 207, 207, 73, 75, 207, 207, 207, - 207, 207, 74, 207, 207, 159, 158, 207, 154, 153, - 207, 183, 182, 207, 161, 160, 207, 207, 146, 207, - 167, 207, 157, 163, 162, 207, 166, 164 - } ; - -static yyconst short int yy_accept[1203] = - { 0, - 1, 1, 1, 2, 4, 7, 9, 11, 13, 16, - 19, 21, 24, 27, 30, 33, 35, 37, 39, 41, - 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, - 63, 65, 67, 69, 71, 73, 76, 79, 82, 85, - 88, 90, 91, 91, 92, 92, 92, 93, 94, 95, - 95, 96, 97, 98, 99, 101, 102, 103, 104, 106, - 108, 109, 110, 110, 111, 112, 113, 115, 116, 118, - 119, 120, 122, 124, 125, 126, 127, 129, 130, 132, - 133, 135, 136, 138, 140, 141, 141, 143, 144, 146, - 148, 150, 152, 154, 156, 157, 159, 160, 161, 162, - - 163, 164, 165, 167, 169, 170, 172, 174, 176, 177, - 178, 180, 181, 183, 185, 187, 189, 191, 193, 194, - 195, 196, 197, 198, 199, 200, 202, 202, 202, 204, - 204, 204, 204, 205, 207, 208, 209, 210, 211, 212, - 214, 216, 217, 218, 219, 220, 221, 222, 222, 222, - 222, 222, 222, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 246, 246, - 246, 246, 246, 246, 247, 248, 249, 250, 251, 252, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - - 264, 265, 267, 268, 270, 271, 272, 273, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 289, 289, 290, 290, 290, 290, 293, 294, 295, - 295, 296, 297, 298, 299, 300, 301, 302, 302, 302, - 302, 302, 302, 302, 303, 304, 305, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 331, 331, 331, 331, 331, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, - - 357, 358, 360, 361, 361, 362, 363, 364, 365, 367, - 368, 369, 370, 371, 372, 373, 374, 374, 376, 376, - 379, 379, 380, 381, 381, 382, 383, 384, 385, 386, - 387, 388, 388, 388, 388, 388, 388, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 403, 404, 405, 406, 407, 408, 409, 409, 410, - 412, 413, 414, 415, 416, 416, 416, 416, 416, 416, - 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 436, - 437, 438, 439, 440, 441, 441, 442, 443, 445, 446, - - 447, 447, 448, 449, 450, 451, 453, 453, 454, 454, - 455, 456, 457, 458, 459, 460, 461, 461, 461, 461, - 461, 461, 461, 462, 463, 464, 465, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 477, 478, 479, 480, - 481, 483, 483, 483, 484, 485, 486, 488, 489, 490, - 490, 490, 490, 490, 490, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 502, 503, 504, 506, - 507, 508, 509, 510, 512, 513, 514, 515, 517, 517, - 519, 520, 522, 523, 523, 524, 525, 526, 527, 527, - 528, 528, 529, 530, 531, 533, 535, 536, 537, 537, - - 537, 537, 537, 537, 537, 537, 538, 539, 541, 543, - 544, 545, 546, 547, 548, 549, 550, 550, 551, 552, - 554, 556, 558, 558, 558, 559, 560, 561, 562, 563, - 563, 563, 563, 563, 563, 563, 564, 565, 566, 567, - 568, 569, 570, 572, 573, 574, 575, 576, 577, 579, - 580, 581, 582, 582, 582, 582, 583, 583, 583, 584, - 584, 585, 586, 589, 590, 591, 593, 593, 594, 595, - 596, 597, 598, 598, 598, 598, 599, 599, 599, 599, - 599, 600, 600, 601, 602, 603, 604, 605, 607, 608, - 609, 610, 610, 611, 611, 611, 612, 614, 614, 614, - - 614, 615, 616, 617, 619, 619, 620, 620, 620, 620, - 620, 621, 621, 622, 622, 623, 624, 625, 626, 628, - 629, 631, 632, 632, 633, 635, 637, 638, 639, 640, - 642, 642, 643, 643, 643, 643, 644, 644, 644, 645, - 645, 647, 649, 650, 651, 651, 652, 653, 654, 655, - 656, 657, 657, 658, 658, 659, 659, 660, 661, 661, - 661, 661, 662, 662, 663, 664, 665, 667, 668, 670, - 671, 673, 675, 676, 677, 677, 678, 678, 678, 679, - 679, 680, 681, 683, 685, 686, 686, 687, 687, 687, - 687, 687, 688, 689, 690, 691, 692, 693, 695, 697, - - 697, 698, 699, 699, 700, 701, 701, 703, 703, 703, - 703, 704, 704, 704, 704, 705, 705, 706, 708, 708, - 709, 709, 710, 711, 712, 713, 713, 714, 715, 716, - 717, 717, 717, 718, 718, 719, 720, 721, 723, 725, - 727, 729, 730, 730, 731, 731, 731, 732, 732, 733, - 733, 734, 734, 734, 734, 734, 735, 736, 737, 738, - 738, 739, 740, 740, 741, 742, 743, 744, 744, 744, - 744, 745, 745, 745, 745, 746, 746, 748, 748, 749, - 749, 749, 751, 752, 753, 754, 755, 756, 756, 757, - 757, 758, 760, 762, 764, 764, 765, 765, 765, 766, - - 766, 767, 767, 768, 769, 769, 770, 770, 771, 771, - 771, 773, 774, 776, 777, 779, 780, 781, 781, 782, - 783, 783, 784, 785, 785, 785, 786, 788, 788, 788, - 788, 789, 789, 789, 789, 790, 791, 792, 793, 794, - 795, 797, 799, 799, 800, 800, 801, 801, 802, 802, - 802, 803, 803, 804, 804, 805, 806, 807, 808, 808, - 810, 812, 814, 815, 815, 816, 817, 817, 818, 819, - 819, 819, 819, 819, 819, 820, 820, 820, 820, 820, - 821, 821, 822, 823, 823, 824, 824, 825, 825, 826, - 826, 826, 827, 827, 827, 827, 828, 828, 829, 829, - - 830, 831, 833, 833, 834, 834, 835, 836, 836, 836, - 836, 836, 836, 837, 837, 837, 837, 837, 838, 838, - 840, 842, 844, 844, 845, 845, 846, 846, 847, 847, - 848, 850, 850, 850, 850, 851, 851, 852, 852, 853, - 853, 854, 854, 855, 856, 856, 856, 856, 856, 856, - 857, 857, 857, 857, 857, 858, 858, 859, 861, 861, - 862, 862, 863, 863, 863, 863, 863, 863, 864, 864, - 865, 865, 866, 866, 867, 867, 868, 869, 869, 869, - 869, 869, 870, 872, 872, 873, 873, 873, 874, 874, - 875, 877, 877, 878, 879, 879, 879, 879, 879, 879, - - 879, 880, 881, 881, 882, 882, 883, 883, 884, 885, - 887, 888, 888, 888, 888, 888, 888, 888, 888, 889, - 889, 889, 890, 890, 890, 890, 890, 890, 890, 890, - 891, 892, 892, 893, 894, 894, 896, 897, 897, 898, - 900, 900, 900, 900, 901, 901, 901, 902, 903, 903, - 903, 904, 904, 904, 904, 904, 904, 904, 904, 905, - 906, 906, 907, 908, 910, 910, 911, 911, 911, 911, - 911, 911, 912, 912, 912, 913, 913, 913, 913, 913, - 914, 914, 914, 915, 916, 916, 917, 917, 918, 918, - 918, 918, 918, 918, 919, 919, 919, 920, 920, 921, - - 922, 922, 922, 922, 923, 924, 924, 925, 926, 928, - 928, 928, 928, 928, 928, 929, 929, 929, 930, 930, - 930, 930, 930, 930, 931, 932, 932, 933, 933, 934, - 934, 934, 934, 934, 935, 935, 935, 936, 936, 937, - 938, 938, 938, 939, 940, 940, 941, 941, 941, 941, - 941, 941, 942, 942, 942, 943, 944, 944, 944, 945, - 946, 947, 949, 949, 949, 949, 949, 950, 952, 952, - 953, 955, 956, 956, 958, 959, 959, 960, 960, 960, - 960, 960, 961, 961, 961, 962, 962, 962, 963, 964, - 964, 964, 965, 967, 967, 967, 967, 967, 967, 968, - - 969, 969 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 7, 1, 1, 1, 1, 8, - 9, 1, 10, 1, 11, 1, 1, 12, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 1, 14, 1, - 15, 1, 1, 1, 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, - 1, 42, 1, 1, 43, 1, 44, 44, 44, 44, - - 44, 44, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, - 1, 1, 46, 1, 47, 1, 1, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48 - } ; - -static yyconst int yy_meta[49] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 1, 1, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 1, 4, 5, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[1212] = - { 0, - 0, 47, 1305, 1306, 53, 57, 45, 1301, 1306, 1306, - 51, 53, 55, 1306, 1306, 82, 0, 60, 54, 57, - 53, 45, 75, 1287, 84, 91, 103, 77, 119, 98, - 123, 65, 88, 1282, 1298, 1306, 1306, 1306, 158, 164, - 138, 168, 132, 1306, 172, 1297, 1306, 70, 122, 164, - 0, 1269, 1280, 1278, 0, 1269, 1276, 1263, 145, 0, - 1258, 90, 162, 1265, 158, 1271, 0, 173, 1255, 171, - 1255, 0, 0, 1265, 1271, 124, 0, 1259, 0, 53, - 0, 1256, 0, 0, 1245, 184, 0, 193, 0, 1262, - 0, 0, 0, 0, 129, 0, 1251, 110, 198, 1254, - - 186, 202, 0, 0, 174, 0, 0, 188, 1246, 1251, - 0, 1262, 0, 0, 0, 0, 1257, 0, 1249, 1242, - 1241, 1249, 1238, 1306, 236, 242, 226, 1268, 1306, 239, - 1267, 220, 1306, 236, 1225, 241, 1235, 1247, 1255, 0, - 0, 1238, 1234, 1234, 1232, 233, 1241, 1244, 1241, 1234, - 1237, 1226, 1220, 1227, 1222, 1231, 1211, 1234, 1233, 1230, - 1223, 1226, 1215, 1209, 1227, 1218, 239, 240, 1211, 1223, - 1221, 1208, 1217, 1214, 230, 1213, 1210, 1215, 1199, 1211, - 1193, 1209, 1208, 1209, 1193, 1205, 1187, 1203, 1202, 0, - 1202, 1196, 1183, 242, 1183, 243, 1197, 245, 1180, 161, - - 1195, 1180, 1189, 0, 1177, 1192, 1186, 0, 1198, 1175, - 1183, 1187, 1170, 1184, 1174, 1169, 245, 1184, 1180, 1164, - 0, 1195, 1306, 1194, 269, 1193, 1306, 1160, 1163, 1171, - 1168, 1173, 1172, 1155, 1158, 1153, 1159, 1156, 1161, 1154, - 1147, 1144, 1150, 246, 1163, 1154, 0, 1142, 1147, 1152, - 1145, 1138, 1135, 1141, 1136, 1140, 1128, 1132, 1149, 1138, - 0, 1137, 1127, 1129, 225, 1141, 1140, 1126, 1122, 1129, - 1121, 1135, 1127, 1133, 1117, 1116, 1115, 1129, 1121, 1127, - 1111, 1110, 1120, 1123, 1115, 1113, 1116, 1119, 1108, 0, - 1107, 1112, 1100, 1118, 1113, 1097, 1104, 0, 1112, 1098, - - 1098, 0, 1107, 1108, 1107, 1106, 1083, 1102, 0, 1087, - 1109, 1095, 1099, 1087, 1093, 1095, 1111, 1306, 1110, 1306, - 271, 1101, 1076, 1077, 1091, 1084, 1084, 1086, 1072, 1074, - 1083, 1084, 1071, 1081, 1088, 1078, 1064, 1077, 1066, 1061, - 1060, 1072, 1073, 1060, 1070, 1045, 1067, 1053, 1065, 1064, - 0, 1063, 1055, 1065, 1060, 1044, 1043, 252, 255, 0, - 1049, 1041, 1059, 1038, 1049, 1056, 1051, 1041, 1058, 1057, - 1043, 1050, 1045, 1035, 1020, 1019, 1032, 1031, 1043, 1041, - 1018, 1027, 1037, 1025, 1016, 1028, 1017, 1016, 0, 1014, - 1012, 1012, 1013, 1011, 1017, 1023, 1007, 0, 1013, 1019, - - 1015, 1010, 1021, 1002, 1005, 0, 1001, 1003, 1002, 1015, - 1014, 996, 993, 992, 1008, 1009, 1004, 1012, 1011, 988, - 1009, 999, 262, 996, 997, 988, 0, 995, 971, 970, - 979, 968, 990, 974, 275, 0, 988, 967, 987, 985, - 0, 984, 987, 982, 985, 980, 0, 977, 970, 967, - 961, 960, 959, 960, 959, 961, 955, 954, 953, 954, - 953, 963, 949, 948, 955, 0, 946, 950, 936, 958, - 947, 956, 940, 0, 963, 962, 268, 0, 956, 0, - 960, 0, 950, 950, 934, 932, 946, 929, 932, 930, - 926, 926, 925, 929, 0, 0, 934, 923, 929, 922, - - 921, 257, 920, 941, 935, 934, 277, 906, 0, 921, - 914, 913, 261, 912, 901, 281, 909, 285, 923, 0, - 930, 0, 924, 915, 922, 913, 907, 915, 286, 905, - 913, 912, 920, 266, 267, 901, 909, 908, 884, 270, - 274, 292, 0, 906, 905, 908, 896, 903, 0, 892, - 909, 889, 885, 897, 882, 881, 880, 876, 879, 891, - 890, 289, 0, 875, 1306, 0, 877, 883, 290, 877, - 889, 884, 892, 283, 284, 1306, 871, 287, 868, 880, - 879, 882, 881, 867, 852, 291, 298, 0, 863, 299, - 860, 857, 856, 858, 862, 861, 0, 851, 867, 858, - - 865, 856, 847, 0, 854, 853, 868, 867, 866, 843, - 1306, 844, 1306, 843, 830, 829, 828, 837, 0, 838, - 0, 837, 830, 829, 0, 0, 830, 296, 840, 0, - 830, 829, 831, 821, 835, 834, 823, 840, 301, 826, - 0, 0, 824, 833, 841, 821, 839, 819, 818, 812, - 803, 812, 1306, 813, 1306, 812, 1306, 1306, 811, 302, - 830, 797, 819, 818, 807, 803, 0, 804, 0, 803, - 0, 0, 802, 306, 799, 798, 819, 809, 808, 793, - 1306, 1306, 0, 0, 810, 805, 804, 790, 789, 788, - 800, 1306, 1306, 786, 785, 784, 796, 0, 0, 799, - - 798, 789, 775, 774, 794, 295, 0, 782, 767, 724, - 12, 104, 161, 165, 194, 199, 293, 0, 310, 312, - 326, 314, 309, 326, 314, 316, 1306, 1306, 1306, 1306, - 318, 315, 316, 341, 310, 319, 323, 0, 0, 0, - 0, 325, 341, 342, 333, 332, 333, 343, 329, 336, - 337, 335, 336, 339, 341, 342, 343, 346, 348, 354, - 355, 353, 364, 365, 364, 1306, 1306, 367, 370, 369, - 370, 371, 368, 353, 354, 371, 0, 376, 386, 380, - 374, 0, 366, 358, 371, 1306, 1306, 380, 381, 372, - 373, 0, 0, 0, 385, 386, 391, 390, 391, 403, - - 391, 394, 395, 1306, 387, 1306, 388, 1306, 389, 391, - 0, 391, 0, 392, 0, 393, 395, 390, 391, 399, - 397, 398, 403, 422, 398, 1306, 0, 396, 417, 408, - 409, 404, 411, 423, 424, 1306, 1306, 1306, 433, 429, - 0, 0, 411, 412, 424, 425, 423, 424, 423, 418, - 419, 436, 426, 422, 423, 1306, 1306, 1306, 426, 0, - 0, 0, 427, 441, 443, 453, 431, 432, 437, 434, - 435, 436, 456, 439, 440, 436, 455, 448, 450, 450, - 451, 464, 458, 457, 458, 451, 452, 464, 465, 469, - 469, 470, 474, 475, 464, 469, 476, 477, 466, 467, - - 1306, 0, 485, 486, 481, 482, 473, 488, 485, 490, - 476, 496, 497, 503, 480, 487, 482, 489, 488, 0, - 0, 0, 500, 501, 495, 496, 495, 496, 491, 1306, - 0, 506, 507, 518, 519, 520, 489, 522, 491, 505, - 506, 507, 508, 504, 513, 511, 513, 519, 505, 506, - 517, 524, 513, 525, 515, 531, 1306, 0, 532, 533, - 532, 533, 533, 546, 547, 543, 542, 543, 530, 531, - 532, 533, 538, 539, 540, 541, 547, 552, 545, 556, - 546, 1306, 0, 557, 1306, 558, 546, 562, 550, 1306, - 0, 573, 542, 1306, 570, 557, 559, 560, 563, 571, - - 565, 573, 574, 575, 564, 565, 566, 567, 1306, 0, - 585, 586, 594, 586, 578, 586, 570, 570, 572, 596, - 582, 583, 586, 587, 588, 599, 592, 604, 588, 606, - 590, 606, 607, 1306, 595, 0, 596, 608, 609, 0, - 595, 613, 613, 1306, 603, 599, 1306, 600, 601, 621, - 622, 620, 613, 614, 631, 603, 610, 611, 612, 613, - 628, 629, 1306, 0, 611, 612, 628, 623, 643, 620, - 645, 614, 634, 640, 641, 650, 622, 623, 631, 1306, - 631, 642, 633, 644, 645, 646, 636, 637, 643, 645, - 646, 652, 648, 649, 649, 661, 662, 649, 1306, 1306, - - 663, 673, 655, 644, 658, 652, 653, 680, 0, 663, - 658, 674, 679, 680, 681, 669, 675, 676, 681, 669, - 682, 668, 676, 670, 678, 688, 689, 686, 1306, 691, - 690, 678, 686, 687, 682, 688, 689, 698, 1306, 1306, - 696, 710, 698, 680, 705, 706, 691, 688, 698, 705, - 710, 711, 721, 711, 712, 1306, 716, 707, 718, 709, - 1306, 0, 719, 705, 706, 712, 1306, 0, 705, 1306, - 0, 1306, 728, 0, 729, 718, 1306, 723, 719, 725, - 722, 723, 718, 737, 1306, 725, 735, 736, 1306, 722, - 739, 1306, 0, 735, 730, 731, 724, 734, 1306, 1306, - - 1306, 763, 768, 771, 775, 780, 783, 788, 793, 798, - 803 - } ; - -static yyconst short int yy_def[1212] = - { 0, - 1201, 1, 1201, 1201, 1201, 1201, 1202, 1203, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1205, 1201, 1202, 1201, 1206, 1203, 1201, 1201, 1201, 1207, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1201, 1201, 1201, 1208, 1205, 1201, 1205, - 1209, 1206, 1201, 1207, 1207, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1208, 1201, 1210, 1211, 1209, 1201, 1204, 1204, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1210, 1201, 1211, 1201, - 1211, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - - 1201, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, - - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, - - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - 1201, 1201, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - - 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1201, - 1204, 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1201, 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, - - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1204, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 0, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201 - } ; - -static yyconst short int yy_nxt[1355] = - { 0, - 4, 5, 6, 5, 5, 7, 8, 9, 10, 11, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 17, 17, 22, 17, 17, 23, 24, 25, 26, - 27, 17, 28, 29, 30, 31, 32, 33, 17, 34, - 17, 35, 17, 4, 4, 36, 37, 38, 39, 40, - 44, 39, 771, 41, 42, 42, 42, 42, 42, 42, - 42, 42, 48, 48, 49, 49, 49, 49, 174, 69, - 63, 77, 80, 70, 74, 64, 78, 71, 81, 79, - 119, 48, 48, 175, 120, 75, 45, 72, 73, 65, - 82, 50, 66, 67, 86, 76, 99, 50, 52, 53, - - 54, 55, 68, 121, 83, 146, 100, 89, 56, 84, - 57, 90, 58, 87, 772, 59, 60, 61, 95, 91, - 122, 110, 147, 92, 62, 111, 88, 93, 94, 194, - 112, 96, 97, 49, 49, 98, 101, 44, 102, 195, - 129, 103, 130, 171, 131, 104, 113, 191, 105, 114, - 106, 115, 107, 108, 172, 116, 117, 118, 109, 125, - 126, 42, 125, 192, 127, 42, 42, 42, 42, 42, - 42, 42, 42, 45, 133, 134, 134, 44, 143, 148, - 296, 149, 150, 151, 144, 155, 156, 773, 157, 152, - 159, 166, 160, 161, 162, 153, 297, 167, 774, 178, - - 163, 179, 180, 181, 209, 182, 164, 136, 184, 210, - 185, 186, 187, 196, 188, 197, 202, 183, 203, 205, - 211, 204, 1201, 212, 198, 44, 189, 775, 223, 199, - 206, 200, 224, 776, 207, 358, 208, 125, 126, 42, - 125, 129, 127, 42, 42, 42, 42, 134, 134, 235, - 225, 225, 136, 136, 257, 259, 267, 286, 258, 268, - 293, 290, 287, 312, 294, 338, 236, 359, 313, 339, - 260, 320, 505, 320, 442, 288, 291, 444, 555, 136, - 321, 321, 321, 321, 136, 517, 443, 582, 576, 445, - 577, 592, 588, 518, 589, 595, 605, 611, 613, 612, - - 614, 619, 623, 620, 506, 621, 703, 622, 642, 647, - 556, 714, 643, 648, 653, 655, 654, 656, 658, 583, - 659, 777, 667, 593, 668, 766, 767, 596, 606, 669, - 672, 670, 673, 730, 624, 731, 778, 741, 704, 742, - 779, 780, 782, 715, 783, 784, 785, 786, 787, 788, - 789, 790, 791, 792, 793, 794, 795, 796, 781, 797, - 798, 799, 800, 801, 802, 803, 804, 806, 805, 807, - 808, 810, 809, 811, 813, 812, 814, 815, 817, 816, - 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, - 828, 829, 830, 831, 832, 833, 834, 836, 837, 839, - - 840, 841, 842, 843, 844, 838, 845, 846, 847, 848, - 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 835, 867, - 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, - 878, 880, 879, 881, 882, 884, 885, 886, 887, 888, - 889, 890, 891, 892, 893, 896, 897, 898, 899, 900, - 901, 883, 902, 903, 905, 906, 907, 908, 894, 909, - 910, 911, 895, 912, 913, 914, 915, 916, 917, 918, - 919, 920, 921, 923, 924, 925, 926, 927, 928, 922, - 929, 930, 931, 932, 933, 904, 934, 935, 936, 937, - - 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, - 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, - 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, - 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, - 989, 990, 991, 992, 993, 994, 995, 996, 997, 999, - 1001, 968, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, - 1011, 1012, 998, 1013, 1014, 1015, 1016, 1017, 1000, 1002, - 1018, 1019, 1020, 1021, 1022, 1023, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1034, 1036, 1035, 1037, 1024, - - 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, - 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, - 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, - 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, - 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, - 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, - 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, - 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, - 1118, 1119, 1121, 1122, 1123, 1120, 1124, 1125, 1126, 1127, - 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, - - 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, - 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, - 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, - 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, - 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, - 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, - 1198, 1199, 1200, 43, 770, 43, 43, 43, 46, 46, - 46, 46, 46, 51, 51, 128, 128, 128, 128, 128, - 132, 132, 132, 132, 132, 135, 769, 135, 222, 222, - 222, 222, 222, 226, 226, 226, 226, 226, 317, 317, - - 317, 317, 317, 319, 319, 319, 319, 319, 768, 765, - 764, 763, 762, 761, 760, 759, 758, 757, 756, 755, - 754, 753, 752, 751, 750, 749, 748, 747, 746, 745, - 744, 743, 740, 739, 738, 737, 736, 735, 734, 733, - 732, 729, 728, 727, 726, 725, 724, 723, 722, 721, - 720, 719, 718, 717, 716, 713, 712, 711, 710, 709, - 708, 707, 706, 705, 702, 701, 700, 699, 698, 697, - 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, - 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, - 676, 675, 674, 671, 666, 665, 664, 663, 662, 661, - - 660, 657, 652, 651, 650, 649, 646, 645, 644, 641, - 640, 639, 638, 637, 636, 635, 634, 633, 632, 631, - 630, 629, 628, 627, 626, 625, 618, 617, 616, 615, - 610, 609, 608, 607, 604, 603, 602, 601, 600, 599, - 598, 597, 594, 591, 590, 587, 586, 585, 584, 581, - 580, 579, 578, 575, 574, 573, 572, 571, 570, 569, - 568, 567, 566, 565, 564, 563, 562, 561, 560, 559, - 558, 557, 554, 553, 552, 551, 550, 549, 548, 547, - 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, - 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, - - 526, 525, 524, 523, 522, 521, 520, 519, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 504, 503, - 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, - 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, - 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, - 452, 451, 450, 449, 448, 447, 446, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 320, 318, 406, 405, 404, 403, 402, 401, - 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, - 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, - 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 360, 357, 356, 355, 354, 353, 352, 351, 350, 349, - 348, 347, 346, 345, 344, 343, 342, 341, 340, 337, - 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, - 326, 325, 324, 323, 322, 227, 318, 223, 316, 315, - - 314, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 295, 292, 289, 285, 284, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 272, 271, 270, 269, 266, 265, 264, 263, 262, - 261, 256, 255, 254, 253, 252, 251, 250, 249, 248, - 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, - 237, 234, 233, 232, 231, 230, 229, 228, 1201, 227, - 129, 221, 220, 219, 218, 217, 216, 215, 214, 213, - 201, 193, 190, 177, 176, 173, 170, 169, 168, 165, - 158, 154, 145, 142, 141, 140, 139, 138, 137, 47, - - 124, 123, 85, 47, 1201, 3, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yyconst short int yy_chk[1355] = - { 0, - 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, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 7, 2, 711, 2, 5, 5, 5, 5, 6, 6, - 6, 6, 11, 11, 12, 12, 13, 13, 80, 19, - 18, 21, 22, 19, 20, 18, 21, 19, 22, 21, - 32, 48, 48, 80, 32, 20, 7, 19, 19, 18, - 23, 12, 18, 18, 25, 20, 28, 12, 16, 16, - - 16, 16, 18, 33, 23, 62, 28, 26, 16, 23, - 16, 26, 16, 25, 712, 16, 16, 16, 27, 26, - 33, 30, 62, 26, 16, 30, 25, 26, 26, 98, - 30, 27, 27, 49, 49, 27, 29, 43, 29, 98, - 41, 29, 41, 76, 41, 29, 31, 95, 29, 31, - 29, 31, 29, 29, 76, 31, 31, 31, 29, 39, - 39, 39, 39, 95, 39, 40, 40, 40, 40, 42, - 42, 42, 42, 43, 45, 50, 50, 45, 59, 63, - 200, 63, 63, 63, 59, 65, 65, 713, 65, 63, - 68, 70, 68, 68, 68, 63, 200, 70, 714, 86, - - 68, 86, 86, 86, 105, 86, 68, 50, 88, 105, - 88, 88, 88, 99, 88, 99, 101, 86, 101, 102, - 108, 101, 132, 108, 99, 132, 88, 715, 127, 99, - 102, 99, 127, 716, 102, 265, 102, 125, 125, 125, - 125, 130, 125, 126, 126, 126, 126, 134, 134, 146, - 130, 130, 136, 136, 167, 168, 175, 194, 167, 175, - 198, 196, 194, 217, 198, 244, 146, 265, 217, 244, - 168, 225, 423, 321, 358, 194, 196, 359, 477, 134, - 225, 225, 321, 321, 136, 435, 358, 507, 502, 359, - 502, 516, 513, 435, 513, 518, 529, 534, 535, 534, - - 535, 540, 542, 540, 423, 541, 628, 541, 562, 569, - 477, 639, 562, 569, 574, 575, 574, 575, 578, 507, - 578, 717, 586, 516, 586, 706, 706, 518, 529, 587, - 590, 587, 590, 660, 542, 660, 719, 674, 628, 674, - 720, 721, 722, 639, 723, 724, 725, 726, 731, 732, - 733, 734, 735, 736, 737, 742, 743, 744, 721, 745, - 746, 747, 748, 749, 750, 751, 752, 753, 752, 753, - 754, 755, 754, 756, 757, 756, 757, 758, 759, 758, - 760, 761, 762, 763, 764, 765, 768, 769, 770, 771, - 772, 773, 774, 775, 776, 778, 779, 780, 781, 783, - - 784, 785, 785, 788, 789, 781, 790, 791, 795, 796, - 797, 798, 799, 800, 801, 802, 803, 805, 807, 809, - 810, 812, 814, 816, 817, 818, 819, 820, 779, 821, - 822, 823, 824, 825, 828, 829, 830, 831, 832, 833, - 834, 835, 834, 839, 840, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 859, 863, - 864, 840, 865, 866, 867, 868, 869, 870, 852, 871, - 872, 873, 852, 874, 875, 876, 877, 878, 879, 880, - 881, 882, 883, 884, 885, 886, 887, 888, 889, 883, - 890, 891, 892, 893, 894, 866, 895, 896, 897, 898, - - 899, 900, 903, 904, 905, 906, 907, 908, 909, 910, - 911, 912, 913, 914, 915, 916, 917, 918, 919, 923, - 924, 925, 926, 927, 928, 929, 932, 933, 934, 935, - 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, - 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, - 956, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 968, 935, 969, 970, 971, 972, 973, 974, 975, 976, - 977, 978, 966, 979, 980, 981, 984, 986, 967, 968, - 987, 988, 989, 992, 993, 995, 996, 997, 998, 999, - 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1005, 1006, 995, - - 1007, 1008, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, - 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1035, 1037, 1038, 1039, 1041, - 1042, 1043, 1045, 1046, 1048, 1049, 1050, 1051, 1052, 1053, - 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1065, - 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, - 1076, 1077, 1078, 1079, 1081, 1082, 1083, 1084, 1085, 1086, - 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, - 1097, 1098, 1101, 1102, 1103, 1098, 1104, 1105, 1106, 1107, - 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, - - 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, - 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1141, - 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, - 1152, 1153, 1154, 1155, 1157, 1158, 1159, 1160, 1163, 1164, - 1165, 1166, 1169, 1173, 1175, 1176, 1178, 1179, 1180, 1181, - 1182, 1183, 1184, 1186, 1187, 1188, 1190, 1191, 1194, 1195, - 1196, 1197, 1198, 1202, 710, 1202, 1202, 1202, 1203, 1203, - 1203, 1203, 1203, 1204, 1204, 1205, 1205, 1205, 1205, 1205, - 1206, 1206, 1206, 1206, 1206, 1207, 709, 1207, 1208, 1208, - 1208, 1208, 1208, 1209, 1209, 1209, 1209, 1209, 1210, 1210, - - 1210, 1210, 1210, 1211, 1211, 1211, 1211, 1211, 708, 705, - 704, 703, 702, 701, 700, 697, 696, 695, 694, 691, - 690, 689, 688, 687, 686, 685, 680, 679, 678, 677, - 676, 675, 673, 670, 668, 666, 665, 664, 663, 662, - 661, 659, 656, 654, 652, 651, 650, 649, 648, 647, - 646, 645, 644, 643, 640, 638, 637, 636, 635, 634, - 633, 632, 631, 629, 627, 624, 623, 622, 620, 618, - 617, 616, 615, 614, 612, 610, 609, 608, 607, 606, - 605, 603, 602, 601, 600, 599, 598, 596, 595, 594, - 593, 592, 591, 589, 585, 584, 583, 582, 581, 580, - - 579, 577, 573, 572, 571, 570, 568, 567, 564, 561, - 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, - 550, 548, 547, 546, 545, 544, 539, 538, 537, 536, - 533, 532, 531, 530, 528, 527, 526, 525, 524, 523, - 521, 519, 517, 515, 514, 512, 511, 510, 508, 506, - 505, 504, 503, 501, 500, 499, 498, 497, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 481, 479, 476, 475, 473, 472, 471, 470, 469, 468, - 467, 465, 464, 463, 462, 461, 460, 459, 458, 457, - 456, 455, 454, 453, 452, 451, 450, 449, 448, 446, - - 445, 444, 443, 442, 440, 439, 438, 437, 434, 433, - 432, 431, 430, 429, 428, 426, 425, 424, 422, 421, - 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, - 410, 409, 408, 407, 405, 404, 403, 402, 401, 400, - 399, 397, 396, 395, 394, 393, 392, 391, 390, 388, - 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, - 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, - 367, 366, 365, 364, 363, 362, 361, 357, 356, 355, - 354, 353, 352, 350, 349, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, - - 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, - 323, 322, 319, 317, 316, 315, 314, 313, 312, 311, - 310, 308, 307, 306, 305, 304, 303, 301, 300, 299, - 297, 296, 295, 294, 293, 292, 291, 289, 288, 287, - 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, - 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, - 266, 264, 263, 262, 260, 259, 258, 257, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 246, 245, 243, - 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, - 232, 231, 230, 229, 228, 226, 224, 222, 220, 219, - - 218, 216, 215, 214, 213, 212, 211, 210, 209, 207, - 206, 205, 203, 202, 201, 199, 197, 195, 193, 192, - 191, 189, 188, 187, 186, 185, 184, 183, 182, 181, - 180, 179, 178, 177, 176, 174, 173, 172, 171, 170, - 169, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 145, 144, 143, 142, 139, 138, 137, 135, 131, - 128, 123, 122, 121, 120, 119, 117, 112, 110, 109, - 100, 97, 90, 85, 82, 78, 75, 74, 71, 69, - 66, 64, 61, 58, 57, 56, 54, 53, 52, 46, - - 35, 34, 24, 8, 3, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up script1text */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -static int yy_more_flag = 0; -static int yy_more_len = 0; -#define yymore() (yy_more_flag = 1) -#define YY_MORE_ADJ yy_more_len -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char script1text[YYLMAX]; -char *script1text_ptr; -#line 1 "script_lexer.l" -#define INITIAL 0 -#line 2 "script_lexer.l" -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -//***************************************************************************** -// DESCRIPTION : Script Lexer -//***************************************************************************** - -#ifdef _WINDOWS -#pragma warning (disable : 4102) -#pragma warning (disable : 4273) -#pragma warning (disable : 4786) -#endif - -//***************************************************************************** -// EXTERNAL DECLARATIONS -//***************************************************************************** -#include -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "Iutility.h" // Utility component interface -#include "Iwarehouse.h" // Warehouse component interface -#include "Idicom.h" // Dicom component interface -#include "Inetwork.h" // Network component interface -#include "Imedia.h" // Media File component interface -#include "Isession.h" // Test Session component interface - -#include "script1_parser.cpp.h" - -extern void script1error(char*); - -extern FILE *script1in; -extern int script1lineno; -extern char script1CurrentFilename[_MAX_PATH]; -extern long script1CurrentFileOffset; -extern long script1CurrentLineNo; -extern SCRIPT_SESSION_CLASS *script1Session_ptr; -extern bool script1IsNativeVts; -extern bool script1ParseOnly; - -bool IsHex(char, int *); - -static char *pEnd; - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int script1wrap YY_PROTO(( void )); -#else -extern int script1wrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void script1unput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef script1text_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int script1input YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( script1text, script1leng, 1, script1out ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( script1in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( script1in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, script1in )) == 0) \ - && ferror( script1in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int script1lex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after script1text and script1leng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( script1leng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (script1text[script1leng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 57 "script_lexer.l" - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! script1in ) - script1in = stdin; - - if ( ! script1out ) - script1out = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - script1_create_buffer( script1in, YY_BUF_SIZE ); - - script1_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_more_len = 0; - if ( yy_more_flag ) - { - yy_more_len = script1leng; - yy_more_flag = 0; - } - yy_cp = yy_c_buf_p; - - /* Support of script1text. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1306 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < script1leng; ++yyl ) - if ( script1text[yyl] == '\n' ) - ++script1lineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 58 "script_lexer.l" -{ /* skip charcters from 80H - FFH */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 60 "script_lexer.l" -{ - // copy script1 comment lines - strip off leading ## - int length = script1leng; - - // check to see how line is terminated - // - and remove termination - if ((script1text[script1leng-1] == LINEFEED) - && (script1text[script1leng-2] == CARRIAGERETURN)) - length -= 2; - else - length--; - - script1lval.string_ptr = (char*) malloc(length+1); - - memcpy(script1lval.string_ptr, &script1text[0], length); - script1lval.string_ptr[length] = NULLCHAR; - if (script1Session_ptr) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_NONE, 1, "%s", script1lval.string_ptr); - } - } - - free(script1lval.string_ptr); - script1lval.string_ptr = NULL; - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 89 "script_lexer.l" -{ /* extract file and line info from cpp comment lines: # Number ["file"] */ - char* iS = NULL; - char* nS = NULL; - iS = strstr(script1text, "# "); - if (iS != NULL) - { - nS = strstr(iS, " \""); - if (nS != NULL) - { - *nS++ = '\0'; - strcpy(script1CurrentFilename, nS); - } - script1CurrentFileOffset = atoi(iS+2); - script1CurrentLineNo = script1lineno; - } - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 105 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 110 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 115 "script_lexer.l" -{ /* skip empty lines */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 116 "script_lexer.l" -{ /* skip white space */ } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 117 "script_lexer.l" -{ /* continuation line */ } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 118 "script_lexer.l" -{ /* skip equal sign */ } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 119 "script_lexer.l" -{ /* skip semi-colon */ } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 120 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 121 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 122 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 123 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 124 "script_lexer.l" -{ script1lval.vr = ATTR_VR_AE; return VR; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 125 "script_lexer.l" -{ script1lval.vr = ATTR_VR_AS; return VR; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 126 "script_lexer.l" -{ script1lval.vr = ATTR_VR_AT; return VR; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 127 "script_lexer.l" -{ script1lval.vr = ATTR_VR_CS; return VR; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 128 "script_lexer.l" -{ script1lval.vr = ATTR_VR_DA; return VR; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 129 "script_lexer.l" -{ script1lval.vr = ATTR_VR_DS; return VR; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 130 "script_lexer.l" -{ script1lval.vr = ATTR_VR_DT; return VR; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 131 "script_lexer.l" -{ script1lval.vr = ATTR_VR_FD; return VR; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 132 "script_lexer.l" -{ script1lval.vr = ATTR_VR_FL; return VR; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 133 "script_lexer.l" -{ script1lval.vr = ATTR_VR_IS; return VR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 134 "script_lexer.l" -{ script1lval.vr = ATTR_VR_LO; return VR; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 135 "script_lexer.l" -{ script1lval.vr = ATTR_VR_LT; return VR; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 136 "script_lexer.l" -{ script1lval.vr = ATTR_VR_OB; return VR; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 137 "script_lexer.l" -{ script1lval.vr = ATTR_VR_OF; return VR; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 138 "script_lexer.l" -{ script1lval.vr = ATTR_VR_OV; return VR; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 139 "script_lexer.l" -{ script1lval.vr = ATTR_VR_OW; return VR; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 140 "script_lexer.l" -{ script1lval.vr = ATTR_VR_PN; return VR; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 141 "script_lexer.l" -{ script1lval.vr = ATTR_VR_SH; return VR; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 142 "script_lexer.l" -{ script1lval.vr = ATTR_VR_SL; return VR; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 143 "script_lexer.l" -{ script1lval.vr = ATTR_VR_SQ; return T_SQ; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 144 "script_lexer.l" -{ script1lval.vr = ATTR_VR_SS; return VR; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 145 "script_lexer.l" -{ script1lval.vr = ATTR_VR_ST; return VR; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 146 "script_lexer.l" -{ script1lval.vr = ATTR_VR_TM; return VR; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 147 "script_lexer.l" -{ script1lval.vr = ATTR_VR_UI; return VR; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 148 "script_lexer.l" -{ script1lval.vr = ATTR_VR_UL; return VR; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 149 "script_lexer.l" -{ script1lval.vr = ATTR_VR_UN; return VR; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 150 "script_lexer.l" -{ script1lval.vr = ATTR_VR_UR; return VR; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 151 "script_lexer.l" -{ script1lval.vr = ATTR_VR_US; return VR; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 152 "script_lexer.l" -{ script1lval.vr = ATTR_VR_UT; return VR; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 154 "script_lexer.l" -{ return T_SEND; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 156 "script_lexer.l" -{ return T_RESET; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 157 "script_lexer.l" -{ return T_CREATE; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 158 "script_lexer.l" -{ return T_SET; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 159 "script_lexer.l" -{ return T_COMPARE; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 160 "script_lexer.l" -{ return T_COMPARE_NOT; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 161 "script_lexer.l" -{ return T_COPY; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 162 "script_lexer.l" -{ return T_DELETE; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 164 "script_lexer.l" -{ return T_READ; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 165 "script_lexer.l" -{ return T_WRITE; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 167 "script_lexer.l" -{ return T_SYSTEM; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 168 "script_lexer.l" -{ return T_TIME; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 169 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 170 "script_lexer.l" -{ return T_DISPLAY; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 171 "script_lexer.l" -{ return T_ECHO; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 172 "script_lexer.l" -{ return T_ROLE; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 173 "script_lexer.l" -{ return T_CONFIRM; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 174 "script_lexer.l" -{ return T_DELAY; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 176 "script_lexer.l" -{ return T_APPL_ENTITY; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 177 "script_lexer.l" -{ return T_ADD_GROUP_LENGTH; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 178 "script_lexer.l" -{ return T_DEF_SQ_LENGTH; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 179 "script_lexer.l" -{ return T_POPULATE; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 180 "script_lexer.l" -{ return T_STRICT; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 181 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 182 "script_lexer.l" -{ return T_VALIDATION; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 183 "script_lexer.l" -{ script1lval.validationFlag = ALL; return VALIDATIONFLAG; } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 184 "script_lexer.l" -{ script1lval.validationFlag = USE_DEFINITION; return VALIDATIONFLAG; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 185 "script_lexer.l" -{ script1lval.validationFlag = USE_VR; return VALIDATIONFLAG; } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 186 "script_lexer.l" -{ script1lval.validationFlag = USE_REFERENCE; return VALIDATIONFLAG; } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 187 "script_lexer.l" -{ script1lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_VR); return VALIDATIONFLAG; } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 188 "script_lexer.l" -{ script1lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 189 "script_lexer.l" -{ script1lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_VR | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 190 "script_lexer.l" -{ script1lval.validationFlag = NONE; return VALIDATIONFLAG; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 192 "script_lexer.l" -{ return T_LANGUAGE; } - YY_BREAK -/* - * The LANGUAGE token is introduced to enable backward compatibility with - * VTS and ADVT - * Currently the ADVT language is fully supported by the parser - * To avoid conflicts and to have a more consistent language for DVT - * this language section has been introduced. Here some mappings between VTS - * language tokens and DVT language tokens are provided. - */ -case 78: -YY_RULE_SETUP -#line 202 "script_lexer.l" -{ - /* - * The VTS VALIDATE command is mapped on the DVT RECEIVE Command - */ - if (script1IsNativeVts) - { - return T_RECEIVE; - } - else - { - return T_VALIDATE; - } - } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 215 "script_lexer.l" -{ - /* - * The VTS VALDIMSE command is mapped on the DVT VALIDATE Command - */ - if (script1IsNativeVts) - { - return T_VALIDATE; - } - else - { - /* VALDIMSE is not part of the DVT language anymore */ - script1error("\"VALDIMSE\" is not a DVT script1 command. Use \"VALIDATE\" "); - } - } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 230 "script_lexer.l" -{ - /* - * The VTS RECEIVE command is mapped on the DVT IMPORT Command - */ - if (script1IsNativeVts) - { - return T_IMPORT; - } - else - { - return T_RECEIVE; - } - } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 244 "script_lexer.l" -{ - /* - * The VTS EXECUTE command is mapped on the DVT EXPORT Command - */ - if (script1IsNativeVts) - { - return T_EXPORT; - } - else - { - /* EXECUTE is not part of the DVT language anymore */ - script1error("\"EXECUTE\" is not a DVT script1 command. Use \"EXPORT\" "); - } - } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 259 "script_lexer.l" -{ - return T_IMPORT; - } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 263 "script_lexer.l" -{ - return T_EXPORT; - } - YY_BREAK -case 84: -#line 268 "script_lexer.l" -case 85: -YY_RULE_SETUP -#line 268 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CECHO_RQ; return COMMANDFIELD; } - YY_BREAK -case 86: -#line 270 "script_lexer.l" -case 87: -YY_RULE_SETUP -#line 270 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CECHO_RSP; return COMMANDFIELD; } - YY_BREAK -case 88: -#line 272 "script_lexer.l" -case 89: -YY_RULE_SETUP -#line 272 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CFIND_RQ; return COMMANDFIELD; } - YY_BREAK -case 90: -#line 274 "script_lexer.l" -case 91: -YY_RULE_SETUP -#line 274 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CFIND_RSP; return COMMANDFIELD; } - YY_BREAK -case 92: -#line 276 "script_lexer.l" -case 93: -YY_RULE_SETUP -#line 276 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 94: -#line 278 "script_lexer.l" -case 95: -YY_RULE_SETUP -#line 278 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 96: -#line 280 "script_lexer.l" -case 97: -YY_RULE_SETUP -#line 280 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CMOVE_RQ; return COMMANDFIELD; } - YY_BREAK -case 98: -#line 282 "script_lexer.l" -case 99: -YY_RULE_SETUP -#line 282 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CMOVE_RSP; return COMMANDFIELD; } - YY_BREAK -case 100: -#line 284 "script_lexer.l" -case 101: -YY_RULE_SETUP -#line 284 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CSTORE_RQ; return COMMANDFIELD; } - YY_BREAK -case 102: -#line 286 "script_lexer.l" -case 103: -YY_RULE_SETUP -#line 286 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CSTORE_RSP; return COMMANDFIELD; } - YY_BREAK -case 104: -#line 288 "script_lexer.l" -case 105: -YY_RULE_SETUP -#line 288 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_CCANCEL_RQ; return COMMANDFIELD; } - YY_BREAK -case 106: -#line 290 "script_lexer.l" -case 107: -YY_RULE_SETUP -#line 290 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NACTION_RQ; return COMMANDFIELD; } - YY_BREAK -case 108: -#line 292 "script_lexer.l" -case 109: -YY_RULE_SETUP -#line 292 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NACTION_RSP; return COMMANDFIELD; } - YY_BREAK -case 110: -#line 294 "script_lexer.l" -case 111: -YY_RULE_SETUP -#line 294 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NCREATE_RQ; return COMMANDFIELD; } - YY_BREAK -case 112: -#line 296 "script_lexer.l" -case 113: -YY_RULE_SETUP -#line 296 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NCREATE_RSP; return COMMANDFIELD; } - YY_BREAK -case 114: -#line 298 "script_lexer.l" -case 115: -YY_RULE_SETUP -#line 298 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NDELETE_RQ; return COMMANDFIELD; } - YY_BREAK -case 116: -#line 300 "script_lexer.l" -case 117: -YY_RULE_SETUP -#line 300 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NDELETE_RSP; return COMMANDFIELD; } - YY_BREAK -case 118: -#line 302 "script_lexer.l" -case 119: -YY_RULE_SETUP -#line 302 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NEVENTREPORT_RQ; return COMMANDFIELD; } - YY_BREAK -case 120: -#line 304 "script_lexer.l" -case 121: -YY_RULE_SETUP -#line 304 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NEVENTREPORT_RSP; return COMMANDFIELD; } - YY_BREAK -case 122: -#line 306 "script_lexer.l" -case 123: -YY_RULE_SETUP -#line 306 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 124: -#line 308 "script_lexer.l" -case 125: -YY_RULE_SETUP -#line 308 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 126: -#line 310 "script_lexer.l" -case 127: -YY_RULE_SETUP -#line 310 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NSET_RQ; return COMMANDFIELD; } - YY_BREAK -case 128: -#line 312 "script_lexer.l" -case 129: -YY_RULE_SETUP -#line 312 "script_lexer.l" -{ script1lval.commandField = DIMSE_CMD_NSET_RSP; return COMMANDFIELD; } - YY_BREAK -case 130: -#line 315 "script_lexer.l" -case 131: -YY_RULE_SETUP -#line 315 "script_lexer.l" -{ return T_ASSOCIATE_RQ; } - YY_BREAK -case 132: -#line 317 "script_lexer.l" -case 133: -YY_RULE_SETUP -#line 317 "script_lexer.l" -{ return T_ASSOCIATE_AC; } - YY_BREAK -case 134: -#line 319 "script_lexer.l" -case 135: -YY_RULE_SETUP -#line 319 "script_lexer.l" -{ return T_ASSOCIATE_RJ; } - YY_BREAK -case 136: -#line 321 "script_lexer.l" -case 137: -YY_RULE_SETUP -#line 321 "script_lexer.l" -{ return T_RELEASE_RQ; } - YY_BREAK -case 138: -#line 323 "script_lexer.l" -case 139: -YY_RULE_SETUP -#line 323 "script_lexer.l" -{ return T_RELEASE_RP; } - YY_BREAK -case 140: -#line 325 "script_lexer.l" -case 141: -YY_RULE_SETUP -#line 325 "script_lexer.l" -{ return T_ABORT_RQ; } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 327 "script_lexer.l" -{ return T_ALL; } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 328 "script_lexer.l" -{ return T_WAREHOUSE; } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 329 "script_lexer.l" -{ return T_ASSOCIATION; } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 330 "script_lexer.l" -{ return T_RELATION; } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 331 "script_lexer.l" -{ return T_EXECUTION_CONTEXT; } - YY_BREAK -case 147: -#line 334 "script_lexer.l" -case 148: -YY_RULE_SETUP -#line 334 "script_lexer.l" -{ return T_PROT_VER; } - YY_BREAK -case 149: -#line 336 "script_lexer.l" -case 150: -YY_RULE_SETUP -#line 336 "script_lexer.l" -{ return T_CALLED_AE; } - YY_BREAK -case 151: -#line 338 "script_lexer.l" -case 152: -YY_RULE_SETUP -#line 338 "script_lexer.l" -{ return T_CALLING_AE; } - YY_BREAK -case 153: -#line 340 "script_lexer.l" -case 154: -YY_RULE_SETUP -#line 340 "script_lexer.l" -{ return T_APPL_CTX; } - YY_BREAK -case 155: -#line 342 "script_lexer.l" -case 156: -#line 343 "script_lexer.l" -case 157: -YY_RULE_SETUP -#line 343 "script_lexer.l" -{ return T_PRES_CTX; } - YY_BREAK -case 158: -#line 345 "script_lexer.l" -case 159: -YY_RULE_SETUP -#line 345 "script_lexer.l" -{ return T_MAX_LEN; } - YY_BREAK -case 160: -#line 347 "script_lexer.l" -case 161: -YY_RULE_SETUP -#line 347 "script_lexer.l" -{ return T_IMPL_CLASS; } - YY_BREAK -case 162: -#line 349 "script_lexer.l" -case 163: -YY_RULE_SETUP -#line 349 "script_lexer.l" -{ return T_IMPL_VER; } - YY_BREAK -case 164: -YY_RULE_SETUP -#line 350 "script_lexer.l" -{ return T_SOP_EXTEND_NEG; } - YY_BREAK -case 165: -YY_RULE_SETUP -#line 351 "script_lexer.l" -{ return T_SCPSCU_ROLE; } - YY_BREAK -case 166: -YY_RULE_SETUP -#line 352 "script_lexer.l" -{ return T_ASYNC_WINDOW; } - YY_BREAK -case 167: -YY_RULE_SETUP -#line 353 "script_lexer.l" -{ return T_USER_ID_NEG; } - YY_BREAK -case 168: -YY_RULE_SETUP -#line 354 "script_lexer.l" -{ return T_RESULT; } - YY_BREAK -case 169: -YY_RULE_SETUP -#line 355 "script_lexer.l" -{ return T_SOURCE; } - YY_BREAK -case 170: -#line 357 "script_lexer.l" -case 171: -YY_RULE_SETUP -#line 357 "script_lexer.l" -{ return T_REASON; } - YY_BREAK -case 172: -#line 360 "script_lexer.l" -case 173: -YY_RULE_SETUP -#line 360 "script_lexer.l" -{ return T_FILEHEAD; } - YY_BREAK -case 174: -#line 362 "script_lexer.l" -case 175: -YY_RULE_SETUP -#line 362 "script_lexer.l" -{ return T_FILETAIL; } - YY_BREAK -case 176: -YY_RULE_SETUP -#line 364 "script_lexer.l" -{ return T_FILE_PREAMBLE; } - YY_BREAK -case 177: -YY_RULE_SETUP -#line 365 "script_lexer.l" -{ return T_DICOM_PREFIX; } - YY_BREAK -case 178: -#line 367 "script_lexer.l" -case 179: -YY_RULE_SETUP -#line 367 "script_lexer.l" -{ return T_TRANSFER_SYNTAX; } - YY_BREAK -case 180: -#line 369 "script_lexer.l" -case 181: -YY_RULE_SETUP -#line 369 "script_lexer.l" -{ return T_SECTOR_SIZE; } - YY_BREAK -case 182: -#line 371 "script_lexer.l" -case 183: -YY_RULE_SETUP -#line 371 "script_lexer.l" -{ return T_DATASET_TRAILING_PADDING; } - YY_BREAK -case 184: -#line 373 "script_lexer.l" -case 185: -YY_RULE_SETUP -#line 373 "script_lexer.l" -{ return T_PADDING_VALUE; } - YY_BREAK -case 186: -YY_RULE_SETUP -#line 375 "script_lexer.l" -{ return T_AUTOSET; } - YY_BREAK -case 187: -#line 377 "script_lexer.l" -case 188: -YY_RULE_SETUP -#line 377 "script_lexer.l" -{ return T_DEFINED_LENGTH; } - YY_BREAK -case 189: -YY_RULE_SETUP -#line 379 "script_lexer.l" -{ return T_NO; } - YY_BREAK -case 190: -YY_RULE_SETUP -#line 380 "script_lexer.l" -{ return T_YES; } - YY_BREAK -case 191: -YY_RULE_SETUP -#line 382 "script_lexer.l" -{ return T_OFF; } - YY_BREAK -case 192: -YY_RULE_SETUP -#line 383 "script_lexer.l" -{ return T_ON; } - YY_BREAK -case 193: -YY_RULE_SETUP -#line 385 "script_lexer.l" -{ return T_AND; } - YY_BREAK -case 194: -YY_RULE_SETUP -#line 386 "script_lexer.l" -{ return T_OR; } - YY_BREAK -case 195: -YY_RULE_SETUP -#line 388 "script_lexer.l" -{ script1lval.iomLevel = IOM_PATIENT; return IOMLEVEL; } - YY_BREAK -case 196: -YY_RULE_SETUP -#line 389 "script_lexer.l" -{ script1lval.iomLevel = IOM_STUDY; return IOMLEVEL; } - YY_BREAK -case 197: -YY_RULE_SETUP -#line 390 "script_lexer.l" -{ script1lval.iomLevel = IOM_SERIES; return IOMLEVEL; } - YY_BREAK -case 198: -YY_RULE_SETUP -#line 391 "script_lexer.l" -{ script1lval.iomLevel = IOM_IMAGE; return IOMLEVEL; } - YY_BREAK -case 199: -#line 394 "script_lexer.l" -case 200: -YY_RULE_SETUP -#line 394 "script_lexer.l" -{ script1lval.userProvider = UP_ACCEPTOR; return USERPROVIDER; } - YY_BREAK -case 201: -#line 396 "script_lexer.l" -case 202: -YY_RULE_SETUP -#line 396 "script_lexer.l" -{ script1lval.userProvider = UP_REQUESTOR; return USERPROVIDER; } - YY_BREAK -case 203: -#line 399 "script_lexer.l" -case 204: -YY_RULE_SETUP -#line 399 "script_lexer.l" -{ script1lval.hex = strtoul(script1text, &pEnd, 16); return HEXADECIMAL; } - YY_BREAK -case 205: -#line 402 "script_lexer.l" -case 206: -YY_RULE_SETUP -#line 402 "script_lexer.l" -{ script1lval.integer = atoi(script1text); return INTEGER; } - YY_BREAK -case 207: -YY_RULE_SETUP -#line 404 "script_lexer.l" -{ strncpy(script1lval.identifier, script1text, sizeof(script1lval.identifier)); return IDENTIFIER; } - YY_BREAK -case 208: -YY_RULE_SETUP -#line 406 "script_lexer.l" -{ for (script1leng = script1leng-2; script1leng >= 0; script1leng--) - /* concatenate line */ - unput(script1text[script1leng]); - } - YY_BREAK -case 209: -YY_RULE_SETUP -#line 411 "script_lexer.l" -{ int i = 1, j = 0; - - script1lval.string_ptr = (char*) malloc(script1leng+1); - if (script1lval.string_ptr == NULL) - { - char message[128]; - sprintf(message, "STRING of %d chars too long for parser - string truncated!", - script1leng-2); - script1error(message); - - script1lval.string_ptr = (char*) malloc(MAX_STRING_LEN); - - script1leng = MAX_STRING_LEN - 1; - } - - while (i < (script1leng-1)) - { - script1lval.string_ptr[j++] = script1text[i++]; - } - - script1lval.string_ptr[j] = NULLCHAR; - return STRING; - } - YY_BREAK -case 210: -YY_RULE_SETUP -#line 435 "script_lexer.l" -{ return script1text[0]; } - YY_BREAK -case 211: -YY_RULE_SETUP -#line 436 "script_lexer.l" -ECHO; - YY_BREAK - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - script1text_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed script1in at a new source and called - * script1lex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = script1in; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = script1text_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = script1text_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( script1wrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * script1text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = script1text_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - script1text_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = script1text_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = script1text_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of script1lex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = script1text_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - script1text_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - script1text_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - script1restart( script1in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - script1text_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = script1text_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - yy_is_jam = (yy_current_state == 1201); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void script1unput( int c, register char *yy_bp ) -#else -static void script1unput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up script1text */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --script1lineno; - - script1text_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int script1input() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - script1text_ptr = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - if ( script1wrap() ) - { - yy_c_buf_p = - script1text_ptr + YY_MORE_ADJ; - return EOF; - } - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return script1input(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = script1text_ptr + YY_MORE_ADJ; - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in script1input()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve script1text */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++script1lineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void script1restart( FILE *input_file ) -#else -void script1restart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = script1_create_buffer( script1in, YY_BUF_SIZE ); - - script1_init_buffer( yy_current_buffer, input_file ); - script1_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void script1_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void script1_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - script1_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (script1wrap()) processing, but the only time this flag - * is looked at is after script1wrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void script1_load_buffer_state( void ) -#else -void script1_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - script1text_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - script1in = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script1_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE script1_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script1_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in script1_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - script1_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void script1_delete_buffer( YY_BUFFER_STATE b ) -#else -void script1_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void script1_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void script1_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - script1_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void script1_flush_buffer( YY_BUFFER_STATE b ) -#else -void script1_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - script1_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script1_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE script1_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script1_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - script1_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script1_scan_string( yyconst char *str ) -#else -YY_BUFFER_STATE script1_scan_string( str ) -yyconst char *str; -#endif - { - int len; - for ( len = 0; str[len]; ++len ) - ; - - return script1_scan_bytes( str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script1_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE script1_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in script1_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = script1_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in script1_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up script1text. */ \ - script1text[script1leng] = yy_hold_char; \ - yy_c_buf_p = script1text + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - script1leng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef script1text_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - script1lex(); - return 0; - } -#endif -#line 436 "script_lexer.l" - - -//>>=========================================================================== - -void script1error(char *errmsg) - -// DESCRIPTION : YACC/LEX error function called when parsing of the -// DICOMScript fails. -// PRECONDITIONS : -// POSTCONDITIONS : -// EXCEPTIONS : -// NOTES : -//<<=========================================================================== -{ - LOG_CLASS* logger_ptr = script1Session_ptr->getLogger(); - - logger_ptr->text(LOG_ERROR, 1, - "%s - parsing Test Script; line %ld of %s", VAL_PREFIX_FAILED, - script1CurrentFileOffset + (script1lineno - script1CurrentLineNo), - script1CurrentFilename); - logger_ptr->text( LOG_ERROR, 1, "%s - around token : \"%s\"", errmsg, script1text); - -} - - diff --git a/DVTk_Library/Libraries/Scripting/script1_parser.cpp b/DVTk_Library/Libraries/Scripting/script1_parser.cpp deleted file mode 100644 index febca43..0000000 --- a/DVTk_Library/Libraries/Scripting/script1_parser.cpp +++ /dev/null @@ -1,5647 +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 script1error(char*); -extern int script1lex(void); -extern int script1lineno; - -extern SCRIPT_SESSION_CLASS *script1Session_ptr; - -typedef enum -{ - OPERAND_OR, - OPERAND_AND -} OPERAND_ENUM; - - -bool script1IsNativeVts = false; -char script1CurrentFilename[_MAX_PATH] = {" (not defined) "}; -long script1CurrentFileOffset = 0; -long script1CurrentLineNo = 0; -bool script1ParseOnly = 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 script1s!!! -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 script1r1[] = { 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 script1r2[] = { 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 script1defact[] = { 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 script1defgoto[] = { 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 script1pact[] = { 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 script1pgoto[] = {-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 script1errok (yyerrstatus = 0) -#define script1clearin (script1char = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto script1errlab1 -/* Like YYERROR except do call script1error. - 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 script1errlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (script1char == YYEMPTY && yylen == 1) \ - { script1char = (token), script1lval = (value); \ - script1char1 = YYTRANSLATE (script1char); \ - YYPOPSTACK; \ - goto script1backup; \ - } \ - else \ - { script1error ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX script1lex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX script1lex(&script1lval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX script1lex(&script1lval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX script1lex(&script1lval, YYLEX_PARAM) -#else -#define YYLEX script1lex(&script1lval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int script1char; /* the lookahead symbol */ -YYSTYPE script1lval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int script1nerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int script1debug; /* 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 script1parse (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 script1parse. 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 -script1parse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL -{ - register int script1state; - register int yyn; - register short *script1ssp; - register YYSTYPE *script1vsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int script1char1 = 0; /* lookahead token as an internal (translated) token number */ - - short script1ssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE script1vsa[YYINITDEPTH]; /* the semantic value stack */ - - short *script1ss = script1ssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *script1vs = script1vsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *script1lsp; - -#define YYPOPSTACK (script1vsp--, script1ssp--, script1lsp--) -#else -#define YYPOPSTACK (script1vsp--, script1ssp--) -#endif - - int script1stacksize = YYINITDEPTH; - -#ifdef YYPURE - int script1char; - YYSTYPE script1lval; - int script1nerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE script1val; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (script1debug) - fprintf(stderr, "Starting parse\n"); -#endif - - script1state = 0; - yyerrstatus = 0; - script1nerrs = 0; - script1char = 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. */ - - script1ssp = script1ss - 1; - script1vsp = script1vs; -#ifdef YYLSP_NEEDED - script1lsp = yyls; -#endif - -/* Push a new state, which is found in script1state . */ -/* 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: - - *++script1ssp = script1state; - - if (script1ssp >= script1ss + script1stacksize - 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 *script1vs1 = script1vs; - short *script1ss1 = script1ss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = script1ssp - script1ss + 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", - &script1ss1, size * sizeof (*script1ssp), - &script1vs1, size * sizeof (*script1vsp), - &yyls1, size * sizeof (*script1lsp), - &script1stacksize); -#else - yyoverflow("parser stack overflow", - &script1ss1, size * sizeof (*script1ssp), - &script1vs1, size * sizeof (*script1vsp), - &script1stacksize); -#endif - - script1ss = script1ss1; script1vs = script1vs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (script1stacksize >= YYMAXDEPTH) - { - script1error("parser stack overflow"); - return 2; - } - script1stacksize *= 2; - if (script1stacksize > YYMAXDEPTH) - script1stacksize = YYMAXDEPTH; - script1ss = (short *) alloca (script1stacksize * sizeof (*script1ssp)); - __yy_memcpy ((char *)script1ss1, (char *)script1ss, size * sizeof (*script1ssp)); - script1vs = (YYSTYPE *) alloca (script1stacksize * sizeof (*script1vsp)); - __yy_memcpy ((char *)script1vs1, (char *)script1vs, size * sizeof (*script1vsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (script1stacksize * sizeof (*script1lsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*script1lsp)); -#endif -#endif /* no yyoverflow */ - - script1ssp = script1ss + size - 1; - script1vsp = script1vs + size - 1; -#ifdef YYLSP_NEEDED - script1lsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (script1debug) - fprintf(stderr, "Stack size increased to %d\n", script1stacksize); -#endif - - if (script1ssp >= script1ss + script1stacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (script1debug) - fprintf(stderr, "Entering state %d\n", script1state); -#endif - - goto script1backup; - script1backup: - -/* 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 = script1pact[script1state]; - if (yyn == YYFLAG) - goto script1default; - - /* Not known => get a lookahead token if don't already have one. */ - - /* script1char is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (script1char == YYEMPTY) - { -#if YYDEBUG != 0 - if (script1debug) - fprintf(stderr, "Reading a token: "); -#endif - script1char = YYLEX; - } - - /* Convert token to internal form (in script1char1) for indexing tables with */ - - if (script1char <= 0) /* This means end of input. */ - { - script1char1 = 0; - script1char = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (script1debug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - script1char1 = YYTRANSLATE(script1char); - -#if YYDEBUG != 0 - if (script1debug) - { - fprintf (stderr, "Next token is %d (%s", script1char, yytname[script1char1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, script1char, script1lval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += script1char1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != script1char1) - goto script1default; - - 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 script1errlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto script1errlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (script1debug) - fprintf(stderr, "Shifting token %d (%s), ", script1char, yytname[script1char1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (script1char != YYEOF) - script1char = YYEMPTY; - - *++script1vsp = script1lval; -#ifdef YYLSP_NEEDED - *++script1lsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - script1state = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -script1default: - - yyn = script1defact[script1state]; - if (yyn == 0) - goto script1errlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = script1r2[yyn]; - if (yylen > 0) - script1val = script1vsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (script1debug) - { - 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[script1r1[yyn]]); - } -#endif - - - switch (yyn) { - -case 2: -#line 204 "script_parser.y" -{ - //cleanup - clearVTSUidMappings(); - ; - break;} -case 3: -#line 211 "script_parser.y" -{ - if (script1Session_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 4: -#line 218 "script_parser.y" -{ - if (script1Session_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 33: -#line 257 "script_parser.y" -{ - if (strcmp(script1vsp[0].string_ptr, "NATIVE_VTS") == 0) - { - script1IsNativeVts = true; - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[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 = script1Session_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(); - script1Session_ptr->resetAssociation(); - - // cleanup any outstanding relationships - // - from previous emulations / script1 executions - RELATIONSHIP->cleanup(); - - // reset the script1 execution context - script1Session_ptr->resetScriptExecutionContext(); - ; - break;} -case 35: -#line 295 "script_parser.y" -{ - // data warehouse should be emptied - LOG_CLASS *logger_ptr = script1Session_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 = script1Session_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."); - } - script1Session_ptr->resetAssociation(); - ; - break;} -case 37: -#line 322 "script_parser.y" -{ - // relation reset - // - backwards compatibility with VTS - LOG_CLASS *logger_ptr = script1Session_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 / script1 executions - RELATIONSHIP->cleanup(); - ; - break;} -case 38: -#line 339 "script_parser.y" -{ - // script1 execution context reset - LOG_CLASS *logger_ptr = script1Session_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 script1 execution context - script1Session_ptr->resetScriptExecutionContext(); - ; - break;} -case 39: -#line 356 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_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 (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_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 (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - BASE_CONFIRMER *confirmer_ptr = script1Session_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 434 "script_parser.y" -{ - if (!script1ParseOnly) - { - if ((wid1_ptr) && - (wid2_ptr)) - { - // copy the attribute in object 1 to that in object 2 - // - don't stop on returned error - copyAttribute(script1Session_ptr->getLogger(), wid1_ptr, group1, element1, wid2_ptr, group2, element2); - } - } - ; - break;} -case 44: -#line 452 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - // delay for given number of seconds - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DELAY %d seconds", script1vsp[0].integer); - } - - for (int sec = 0; sec < script1vsp[0].integer; sec++) - { - if (script1Session_ptr->isSessionStopped()) - { - YYACCEPT; - } -#ifdef _WINDOWS - Sleep(1000); -#else - sleep(1); -#endif - } - } - ; - break;} -case 47: -#line 484 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (wid1_ptr) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY object"); - } - - // display the referenced warehouse object - wid1_ptr->setLogger(script1Session_ptr->getLogger()); - - BASE_SERIALIZER *serializer_ptr = script1Session_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 (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY WAREHOUSE"); - } - WAREHOUSE->serialize(script1Session_ptr->getLogger()); - } - ; - break;} -case 49: -#line 575 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - // display string to user - logger_ptr->text(LOG_SCRIPT, 1, script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - - ; - break;} -case 53: -#line 602 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!sendAcse(script1Session_ptr, associateRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 54: -#line 609 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!sendAcse(script1Session_ptr, associateAc_ptr, identifier)) YYABORT; - } - ; - break;} -case 55: -#line 616 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!sendAcse(script1Session_ptr, associateRj_ptr, identifier)) YYABORT; - } - ; - break;} -case 56: -#line 623 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!sendAcse(script1Session_ptr, releaseRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 57: -#line 630 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!sendAcse(script1Session_ptr, releaseRp_ptr, identifier)) YYABORT; - } - ; - break;} -case 58: -#line 637 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!sendAcse(script1Session_ptr, abortRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 59: -#line 646 "script_parser.y" -{ - if (!script1ParseOnly) - { - /* Try to find the command object in the warehouse and send it */ - LOG_CLASS* logger_ptr = script1Session_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 (script1IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - resolveVTSUidMappings(cmd_ptr); - } - - if (!sendSop(script1Session_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 (!script1ParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = script1Session_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 (script1IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(script1Session_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 61: -#line 729 "script_parser.y" -{ - if (!script1ParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = script1Session_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 (script1IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(script1Session_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 63: -#line 786 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!importCommand(script1Session_ptr, commandField, identifier)) - { - YYABORT; - } - } - ; - break;} -case 64: -#line 796 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!importCommandDataset(script1Session_ptr, commandField, identifier, iodName, datasetidentifier)) - { - YYABORT; - } - } - ; - break;} -case 65: -#line 808 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setPopulateWithAttributes(true); - } - } - ; - break;} -case 66: -#line 825 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setPopulateWithAttributes(false); - } - } - ; - break;} -case 69: -#line 850 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - // set product role based on new setting for tool - if (script1vsp[0].userProvider == UP_REQUESTOR) - { - // tool role is now Requestor - // - product is therefore Acceptor - script1Session_ptr->setProductRoleIsRequestor(false); - script1Session_ptr->setProductRoleIsAcceptor(true); - } - else - { - // tool role is now Acceptor - // - product is therefore Requestor - script1Session_ptr->setProductRoleIsRequestor(true); - script1Session_ptr->setProductRoleIsAcceptor(false); - } - - if (logger_ptr) - { - if (script1vsp[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 (!script1ParseOnly) - { - // make system call within session - if (!systemCall(script1Session_ptr, script1vsp[0].string_ptr)) - { - YYABORT; - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 73: -#line 909 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_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 (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE ON"); - } - - // ignore command in debug mode - if (script1Session_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE ON"); - } - } - else - { - // enable the logger -// script1Session_ptr->enableLogger(); - - // resume the serializer -// BASE_SERIALIZER *serializer_ptr = script1Session_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Resume(); -// } - } - } - ; - break;} -case 76: -#line 973 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE OFF"); - } - - // ignore command in debug mode - if (script1Session_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE OFF"); - } - } - else - { - // disable the logger -// script1Session_ptr->disableLogger(); - - // pause the serializer -// BASE_SERIALIZER *serializer_ptr = script1Session_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Pause(); -// } - } - } - ; - break;} -case 78: -#line 1010 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "APPLICATION-ENTITY %s %s", script1vsp[-1].string_ptr, script1vsp[0].string_ptr); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setApplicationEntityName(script1vsp[-1].string_ptr); - script1ExecutionContext_ptr->setApplicationEntityVersion(script1vsp[0].string_ptr); - } - } - // free malloced string buffers - free(script1vsp[-1].string_ptr); - script1vsp[-1].string_ptr = NULL; - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - - ; - break;} -case 79: -#line 1036 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - switch(script1vsp[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 (script1vsp[0].validationFlag == (USE_DEFINITION | USE_VR)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-VR"); - else if (script1vsp[0].validationFlag == (USE_DEFINITION | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-REF"); - else if (script1vsp[0].validationFlag == (USE_VR | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-VR-AND-REF"); - break; - } - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setValidationFlag(script1vsp[0].validationFlag); - } - } - ; - break;} -case 80: -#line 1067 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setDefineSqLength(true); - } - } - ; - break;} -case 81: -#line 1084 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setDefineSqLength(false); - } - } - ; - break;} -case 82: -#line 1103 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setAddGroupLength(true); - } - } - ; - break;} -case 83: -#line 1120 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setAddGroupLength(false); - } - } - ; - break;} -case 84: -#line 1139 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setStrictValidation(true); - } - } - ; - break;} -case 85: -#line 1156 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script1ExecutionContext_ptr = script1Session_ptr->getScriptExecutionContext(); - if (script1ExecutionContext_ptr) - { - script1ExecutionContext_ptr->setStrictValidation(false); - } - } - ; - break;} -case 86: -#line 1175 "script_parser.y" -{ - if (!script1ParseOnly) - { - 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(script1Session_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 87: -#line 1214 "script_parser.y" -{ - if (!script1ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script1Session_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(script1Session_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) YYABORT; - } - - if (dataset_ptr) - { - if (!command_ptr) - { - compareDatasetValueWithWarehouse(script1Session_ptr->getLogger(), (char*)(iodName).c_str(), dataset_ptr); - } - - if (!storeObjectInWarehouse(script1Session_ptr->getLogger(), dataset_ptr->getIdentifier(), dataset_ptr)) - { - YYABORT; - } - else - { - LOG_CLASS *logger_ptr = script1Session_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 (!script1ParseOnly) - { - 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 = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // clean up - side effect of parser - delete dataset_ptr; - dataset_ptr = NULL; - - if (!storeObjectInWarehouse(script1Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 89: -#line 1290 "script_parser.y" -{ - if (!script1ParseOnly) - { - 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(script1Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 90: -#line 1311 "script_parser.y" -{ - if (!script1ParseOnly) - { - 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(script1Session_ptr->getLogger()); - - // use the item handle - if (item_handle_ptr->resolveReference() != NULL) - { - if (!storeObjectInWarehouse(script1Session_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 (!script1ParseOnly) - { - if (fileHead_ptr) - { - if (!storeObjectInWarehouse(script1Session_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 92: -#line 1358 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (fileTail_ptr) - { - if (!storeObjectInWarehouse(script1Session_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 93: -#line 1370 "script_parser.y" -{ - if (!script1ParseOnly) - { - 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(script1Session_ptr->getLogger(), identifier.c_str(), wid)) YYABORT; - } - ; - break;} -case 94: -#line 1419 "script_parser.y" -{ - if (!script1ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script1Session_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command delete - serializer_ptr->SerializeDSDeleteCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!removeObjectFromWarehouse(script1Session_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 (!script1ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script1Session_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(script1Session_ptr->getLogger(), datasetidentifier.c_str(), WID_DATASET)) - { - // then try deleting as an item - leave explicit WID_ITEM in call - if (!removeObjectFromWarehouse(script1Session_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 (!script1ParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(script1Session_ptr->getLogger(), identifier.c_str(), WID_FILEHEAD)) YYABORT; - } - ; - break;} -case 97: -#line 1471 "script_parser.y" -{ - if (!script1ParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(script1Session_ptr->getLogger(), identifier.c_str(), WID_FILETAIL)) YYABORT; - } - ; - break;} -case 98: -#line 1482 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(script1Session_ptr->getLogger(), script1Session_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 99: -#line 1493 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(script1Session_ptr->getLogger(), script1Session_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 100: -#line 1506 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!readFileDataset(script1Session_ptr, script1vsp[-1].string_ptr, dataset_ptr)) YYABORT; - } - // free malloced string buffer - free(script1vsp[-1].string_ptr); - script1vsp[-1].string_ptr = NULL; - - ; - break;} -case 101: -#line 1517 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!readFileDataset(script1Session_ptr, script1vsp[-1].string_ptr, script1vsp[0].hex)) YYABORT; - } - // free malloced string buffer - free(script1vsp[-1].string_ptr); - script1vsp[-1].string_ptr = NULL; - ; - break;} -case 102: -#line 1529 "script_parser.y" -{ - if (!script1ParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!receiveAcse(script1Session_ptr, associateRq_ptr, identifier)) - { - clearValidationObjects(script1Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!receiveAcse(script1Session_ptr, associateAc_ptr, identifier)) - { - clearValidationObjects(script1Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!receiveAcse(script1Session_ptr, associateRj_ptr, identifier)) - { - clearValidationObjects(script1Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!receiveAcse(script1Session_ptr, releaseRq_ptr, identifier)) - { - clearValidationObjects(script1Session_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!receiveAcse(script1Session_ptr, releaseRp_ptr, identifier)) - { - clearValidationObjects(script1Session_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!receiveAcse(script1Session_ptr, abortRq_ptr, identifier)) - { - clearValidationObjects(script1Session_ptr); - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!receiveAcse(script1Session_ptr, unknownPdu_ptr, identifier)) - { - clearValidationObjects(script1Session_ptr); - YYABORT; - } - - // parser cleanup - delete unknownPdu_ptr; - unknownPdu_ptr = NULL; - break; - default: break; - } - } - ; - break;} -case 103: -#line 1616 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!receiveSop(script1Session_ptr, command_ptr, dataset_ptr)) - { - clearValidationObjects(script1Session_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 (!script1ParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!sendAcse(script1Session_ptr, associateRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!sendAcse(script1Session_ptr, associateAc_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!sendAcse(script1Session_ptr, associateRj_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!sendAcse(script1Session_ptr, releaseRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!sendAcse(script1Session_ptr, releaseRp_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!sendAcse(script1Session_ptr, abortRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!sendAcse(script1Session_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 (!script1ParseOnly) - { - if (!sendSop(script1Session_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 (!script1ParseOnly) - { - // 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(script1Session_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 (!script1ParseOnly) - { - presContextId = (BYTE) script1vsp[-1].hex; - } - ; - break;} -case 108: -#line 1769 "script_parser.y" -{ - if (!script1ParseOnly) - { - presContextId = (BYTE) script1vsp[-1].integer; - } - ; - break;} -case 109: -#line 1778 "script_parser.y" -{ - if (!script1ParseOnly) - { - 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(script1Session_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 110: -#line 1817 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (command_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script1Session_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command set - serializer_ptr->SerializeDSSetCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!updateObjectInWarehouse(script1Session_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) - { - LOG_CLASS *logger_ptr = script1Session_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 (!script1ParseOnly) - { - if (dataset_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script1Session_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(script1Session_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 = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // then try updating as an item - if (!updateObjectInWarehouse(script1Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) - { - LOG_CLASS *logger_ptr = script1Session_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 (!script1ParseOnly) - { - if (fileHead_ptr) - { - if (!updateObjectInWarehouse(script1Session_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 113: -#line 1898 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (fileTail_ptr) - { - if (!updateObjectInWarehouse(script1Session_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 114: -#line 1910 "script_parser.y" -{ - if (!script1ParseOnly) - { - // try to validate the Sop Class - if (!validateSopAgainstList(script1Session_ptr, command_ptr, dataset_ptr)) - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(script1Session_ptr); - YYABORT; - } - else - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(script1Session_ptr); - } - } - ; - break;} -case 115: -#line 1934 "script_parser.y" -{ - if (!script1ParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = script1Session_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 (!script1ParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = script1Session_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 (!script1ParseOnly) - { - addReferenceObjects(script1Session_ptr,ref_command_ptr, ref_dataset_ptr, script1Session_ptr->getLogger()); - } - ; - break;} -case 119: -#line 1994 "script_parser.y" -{ - if (!script1ParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(script1Session_ptr,ref_command_ptr, ref_dataset_ptr, script1Session_ptr->getLogger()); - } - ; - break;} -case 120: -#line 2004 "script_parser.y" -{ - if (!script1ParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = script1Session_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 (!script1ParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = script1Session_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 (!script1ParseOnly) - { - // 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 (!script1ParseOnly) - { - addReferenceObjects(script1Session_ptr, command_ptr, dataset_ptr, script1Session_ptr->getLogger()); - } - ; - break;} -case 124: -#line 2082 "script_parser.y" -{ - if (!script1ParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(script1Session_ptr, command_ptr, dataset_ptr, script1Session_ptr->getLogger()); - } - ; - break;} -case 125: -#line 2090 "script_parser.y" -{ - if (!script1ParseOnly) - { - setLogicalOperand(OPERAND_AND); - addReferenceObjects(script1Session_ptr, command_ptr, dataset_ptr, script1Session_ptr->getLogger()); - } - ; - break;} -case 126: -#line 2100 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!writeFileHead(script1Session_ptr->getLogger(), script1vsp[-1].string_ptr, script1Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script1vsp[-1].string_ptr); - script1vsp[-1].string_ptr = NULL; - ; - break;} -case 127: -#line 2110 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!writeFileTail(script1Session_ptr->getLogger(), script1vsp[-1].string_ptr, script1Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script1vsp[-1].string_ptr); - script1vsp[-1].string_ptr = NULL; - ; - break;} -case 128: -#line 2120 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (!writeFileDataset(script1Session_ptr->getLogger(), script1vsp[-1].string_ptr, dataset_ptr,script1Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script1vsp[-1].string_ptr); - script1vsp[-1].string_ptr = NULL; - ; - break;} -case 142: -#line 2149 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store the user information - associateRq_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 145: -#line 2164 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set associate request protocol version parameter - associateRq_ptr->setProtocolVersion((UINT16) script1vsp[0].integer); - } - ; - break;} -case 146: -#line 2172 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - if (strlen(script1vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", script1vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request called Ae title parameter - associateRq_ptr->setCalledAeTitle((char*) script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 147: -#line 2196 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - if (strlen(script1vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", script1vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request calling Ae title parameter - associateRq_ptr->setCallingAeTitle((char*) script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 148: -#line 2220 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // set associate request application context parameter - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[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*) script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 150: -#line 2245 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) script1vsp[0].integer); - } - ; - break;} -case 151: -#line 2253 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 152: -#line 2277 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) script1vsp[0].string_ptr); - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 155: -#line 2291 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) script1vsp[-1].integer, (UINT16) script1vsp[0].integer); - } - ; - break;} -case 162: -#line 2311 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[-3].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script1vsp[-3].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script1vsp[-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 (!script1ParseOnly) - { - convertHex(script1vsp[-7].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[-7].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script1vsp[-7].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script1vsp[-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) script1vsp[-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 = script1vsp[-5].integer; - int scpRole = script1vsp[-3].integer; - - // check if roles explicitly defined by script1s - 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(script1vsp[-7].string_ptr); - script1vsp[-7].string_ptr = NULL; - ; - break;} -case 164: -#line 2427 "script_parser.y" -{ - if (!script1ParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 165: -#line 2435 "script_parser.y" -{ - if (!script1ParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 166: -#line 2445 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - transferSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - transferSyntaxName.setUid((char*) script1vsp[0].string_ptr); - - // check that we now have a valid transfer syntax - if (!transferSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script1vsp[0].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 169: -#line 2487 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[-3].string_ptr); - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassExtended.setUid((char*) uid.c_str()); - } - else - { - // store given uid - sopClassExtended.setUid((char*) script1vsp[-3].string_ptr); - - // check that we now have a valid transfer syntax - if (!sopClassExtended.isUidValid()) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script1vsp[-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(script1vsp[-3].string_ptr); - script1vsp[-3].string_ptr = NULL; - ; - break;} -case 172: -#line 2533 "script_parser.y" -{ - if (!script1ParseOnly) - { - // handle application info bytes - sopClassExtended.addApplicationInformation((BYTE) script1vsp[0].integer); - } - ; - break;} -case 175: -#line 2547 "script_parser.y" -{ - if (!script1ParseOnly) - { - UID_CLASS sopClassUid; - - convertHex(script1vsp[-5].string_ptr); - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[-5].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassUid.set((char*) uid.c_str()); - } - else - { - // store given uid - sopClassUid.set((char*) script1vsp[-5].string_ptr); - - // check that we now have a valid abstract syntax - if (!sopClassUid.isValid()) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script1vsp[-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) script1vsp[-3].integer); - scpScuRoleSelect.setScuRole((BYTE) script1vsp[-1].integer); - - // store scp scu role select - userInformation.addScpScuRoleSelect(scpScuRoleSelect); - } - // free malloced string buffer - free(script1vsp[-5].string_ptr); - script1vsp[-5].string_ptr = NULL; - ; - break;} -case 176: -#line 2595 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) script1vsp[-2].integer, (BYTE) script1vsp[-1].integer, script1vsp[0].string_ptr); - } - - // free malloced string buffer - free(script1vsp[0].string_ptr); - ; - break;} -case 177: -#line 2606 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) script1vsp[-3].integer, (BYTE) script1vsp[-2].integer, script1vsp[-1].string_ptr, script1vsp[0].string_ptr); - } - - // free malloced string buffer - free(script1vsp[-1].string_ptr); - free(script1vsp[0].string_ptr); - ; - break;} -case 178: -#line 2618 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation(script1vsp[0].string_ptr); - } - - // free malloced string buffer - free(script1vsp[0].string_ptr); - ; - break;} -case 180: -#line 2632 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store the user information - associateAc_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 183: -#line 2647 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set associate accept protocol version parameter - associateAc_ptr->setProtocolVersion((UINT16) script1vsp[0].integer); - } - ; - break;} -case 184: -#line 2655 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - if (strlen(script1vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", script1vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept called Ae title parameter - associateAc_ptr->setCalledAeTitle((char*) script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 185: -#line 2679 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - if (strlen(script1vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", script1vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept calling Ae title parameter - associateAc_ptr->setCallingAeTitle((char*) script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 186: -#line 2703 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // set associate accept application context parameter - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[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*) script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 188: -#line 2728 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) script1vsp[0].integer); - } - ; - break;} -case 189: -#line 2736 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 190: -#line 2760 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) script1vsp[0].string_ptr); - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 193: -#line 2774 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) script1vsp[-1].integer, (UINT16) script1vsp[0].integer); - } - ; - break;} -case 199: -#line 2793 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[-4].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[-4].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script1vsp[-4].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script1vsp[-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) script1vsp[-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(script1vsp[-4].string_ptr); - script1vsp[-4].string_ptr = NULL; - ; - break;} -case 200: -#line 2848 "script_parser.y" -{ - if (!script1ParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 202: -#line 2859 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[-2].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script1Session_ptr->getSopUid((char*) script1vsp[-2].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script1vsp[-2].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script1vsp[-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) script1vsp[-6].integer); - - // store the result - presAcContext.setResultReason((BYTE) script1vsp[-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) script1vsp[-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(script1vsp[-2].string_ptr); - script1vsp[-2].string_ptr = NULL; - ; - break;} -case 203: -#line 2929 "script_parser.y" -{ - if (!script1ParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 204: -#line 2937 "script_parser.y" -{ - if (!script1ParseOnly) - { - assocAcScuScpRolesDefined = false; - int scuRole = script1vsp[-4].integer; - int scpRole = script1vsp[-2].integer; - - // check if roles explicitly defined by script1s - 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 (!script1ParseOnly) - { - // set associate reject result parameter - associateRj_ptr->setResult((BYTE) script1vsp[0].integer); - } - ; - break;} -case 210: -#line 2974 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set associate reject source parameter - associateRj_ptr->setSource((BYTE) script1vsp[0].integer); - } - ; - break;} -case 211: -#line 2982 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set associate reject reason parameter - associateRj_ptr->setReason((BYTE) script1vsp[0].integer); - } - ; - break;} -case 218: -#line 3006 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set abort request source parameter - abortRq_ptr->setSource((BYTE) script1vsp[0].integer); - } - ; - break;} -case 219: -#line 3014 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set abort request reason parameter - abortRq_ptr->setReason((BYTE) script1vsp[0].integer); - } - ; - break;} -case 220: -#line 3024 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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(script1Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script1Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 221: -#line 3049 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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(script1Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_AC; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script1Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 222: -#line 3074 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set up default associate reject details - associateRj_ptr = new ASSOCIATE_RJ_CLASS(); - - // cascade the logger - associateRj_ptr->setLogger(script1Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RJ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script1Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 223: -#line 3094 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set up default release request details - releaseRq_ptr = new RELEASE_RQ_CLASS(); - - // cascade the logger - releaseRq_ptr->setLogger(script1Session_ptr->getLogger()); - - acseType = PDU_RELEASE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script1Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 224: -#line 3114 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set up default release response details - releaseRp_ptr = new RELEASE_RP_CLASS(); - - // cascade the logger - releaseRp_ptr->setLogger(script1Session_ptr->getLogger()); - - acseType = PDU_RELEASE_RP; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script1Session_ptr->getInstanceId()); - identifier = buffer; - - } - ; - break;} -case 225: -#line 3135 "script_parser.y" -{ - if (!script1ParseOnly) - { - // set up default abort request details - abortRq_ptr = new ABORT_RQ_CLASS(); - - // cascade the logger - abortRq_ptr->setLogger(script1Session_ptr->getLogger()); - - acseType = PDU_ABORT_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script1Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 233: -#line 3168 "script_parser.y" -{ - if (!script1ParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField); - - // cascade the logger - command_ptr->setLogger(script1Session_ptr->getLogger()); - dataset_ptr = NULL; - identifier = ""; - } - ; - break;} -case 234: -#line 3181 "script_parser.y" -{ - if (!script1ParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField, identifier); - - // cascade the logger - command_ptr->setLogger(script1Session_ptr->getLogger()); - dataset_ptr = NULL; - } - ; - break;} -case 235: -#line 3195 "script_parser.y" -{ - if (!script1ParseOnly) - { - // save command field locally - commandField = script1lval.commandField; - } - ; - break;} -case 236: -#line 3205 "script_parser.y" -{ - if (!script1ParseOnly) - { - // save identifier locally - identifier = script1lval.identifier; - } - ; - break;} -case 242: -#line 3226 "script_parser.y" -{ - if (!script1ParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName); - - // cascade the logger - dataset_ptr->setLogger(script1Session_ptr->getLogger()); - - bool addGroupLength = script1Session_ptr->getAddGroupLength(); - bool populateWithAttributes = script1Session_ptr->getAutoType2Attributes(); - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - addGroupLength = script1Session_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = script1Session_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = script1Session_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 (!script1ParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName, datasetidentifier); - - bool addGroupLength = script1Session_ptr->getAddGroupLength(); - bool populateWithAttributes = script1Session_ptr->getAutoType2Attributes(); - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - addGroupLength = script1Session_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = script1Session_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = script1Session_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 (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // save iod name locally - // - check first for iod name mapping - iodName = script1Session_ptr->getIodName((char*) script1vsp[0].string_ptr); - if (!iodName.length()) - { - // no name mapping - take iod name directly - iodName = (char*) script1vsp[0].string_ptr; - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 248: -#line 3311 "script_parser.y" -{ - if (!script1ParseOnly) - { - // save identifier locally - datasetidentifier = script1vsp[0].identifier; - } - ; - break;} -case 249: -#line 3319 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // save the identifier locally - datasetidentifier = script1vsp[0].string_ptr; - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 250: -#line 3333 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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 (!script1ParseOnly) - { - // 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 (!script1ParseOnly) - { - // 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(script1Session_ptr->getLogger()); - } - ; - break;} -case 254: -#line 3396 "script_parser.y" -{ - if (!script1ParseOnly) - { - // instantiate a new attribute - attribute_ptr[nd] = new DCM_ATTRIBUTE_CLASS(group, element); - - // cascade the logger - attribute_ptr[nd]->setLogger(script1Session_ptr->getLogger()); - - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - attribute_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 255: -#line 3416 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store tag locally - group = (UINT16) (script1lval.hex >> 16); - element = (UINT16) (script1lval.hex & 0x0000FFFF); - } - ; - break;} -case 258: -#line 3431 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (nd == 0) - { - LOG_CLASS *logger_ptr = script1Session_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 (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_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 = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 260: -#line 3491 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_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 = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 263: -#line 3533 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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(script1Session_ptr->getLogger()); - - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_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(script1Session_ptr->getLogger()); - - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 264: -#line 3576 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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(script1Session_ptr->getLogger()); - - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_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(script1Session_ptr->getLogger()); - - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 265: -#line 3620 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - // store item - identifier - item_ptr[nd]->setIdentifier(script1vsp[0].string_ptr); - item_ptr[nd]->setValueByReference(true); - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 266: -#line 3635 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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(script1Session_ptr->getLogger()); - - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_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(script1Session_ptr->getLogger()); - - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 267: -#line 3673 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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(script1Session_ptr->getLogger()); - - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_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(script1Session_ptr->getLogger()); - - bool definedLength = script1Session_ptr->getDefineSqLength(); - if (script1Session_ptr->getScriptExecutionContext()) - { - definedLength = script1Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 272: -#line 3721 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store item - attribute value - item_ptr[nd]->AddAttribute(attribute_ptr[nd]); - } - ; - break;} -case 274: -#line 3734 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_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", script1lineno); - } - 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", script1lineno); - } - YYABORT; - } - - // store attribute vr - attribute_ptr[nd]->SetVR(vr); - attribute_ptr[nd]->setDefinedLength(false); - } - ; - break;} -case 275: -#line 3767 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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 (!script1ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script1lval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = false; - } - ; - break;} -case 277: -#line 3789 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script1lval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = true; - } - ; - break;} -case 278: -#line 3799 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script1lval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = false; - } - ; - break;} -case 279: -#line 3809 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script1lval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = true; - } - ; - break;} -case 280: -#line 3819 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script1lval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = false; - } - ; - break;} -case 281: -#line 3829 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script1lval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = true; - } - ; - break;} -case 284: -#line 3845 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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 (!script1ParseOnly) - { - // 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 (!script1ParseOnly) - { - // special check for the Image Display Format ID / Pixel Data / FMI version attribute - // - these need to be handled differently for the ADVT script1s - if (((group == 0x2010) && - (element == 0x0010)) || - ((group == 0x7FE0) && - (element == 0x0010)) || - ((group == 0x0002) && - (element == 0x0001))) - { - convertDoubleBackslash(script1vsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(script1Session_ptr, script1vsp[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(script1vsp[0].string_ptr); - } - else - { - convertHex(script1vsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(script1Session_ptr, script1vsp[0].string_ptr, vr, group, element); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 287: -#line 3939 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store hex attribute value locally - value_ptr = hexValue(script1Session_ptr, script1vsp[0].hex, vr, group, element); - } - ; - break;} -case 288: -#line 3947 "script_parser.y" -{ - if (!script1ParseOnly) - { - // store integer attribute value locally - value_ptr = integerValue(script1Session_ptr, script1vsp[0].integer, vr, group, element); - } - ; - break;} -case 289: -#line 3955 "script_parser.y" -{ - if (!script1ParseOnly) - { - // autoset attribute value - value_ptr = autoSetValue(script1Session_ptr, vr, group, element); - } - ; - break;} -case 290: -#line 3964 "script_parser.y" -{ - if (!script1ParseOnly) - { - // copy tag to reference one - group1 = group; - element1 = element; - } - ; - break;} -case 291: -#line 3975 "script_parser.y" -{ - if (!script1ParseOnly) - { - // 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 (!script1ParseOnly) - { - // look up tag by name and get group & element returned - group = 0; - element = 0; - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 294: -#line 4003 "script_parser.y" -{ - if (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid1_ptr = retrieveFromWarehouse(script1Session_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 (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid1_ptr = retrieveFromWarehouse(script1Session_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(script1Session_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(script1Session_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 (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid2_ptr = retrieveFromWarehouse(script1Session_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 (!script1ParseOnly) - { - LOG_CLASS *logger_ptr = script1Session_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid2_ptr = retrieveFromWarehouse(script1Session_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(script1Session_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(script1Session_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 (!script1ParseOnly) - { - // 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 (!script1ParseOnly) - { - // 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 (!script1ParseOnly) - { - // default Item Number is 1 - index is then zero - itemNumber = 0; - } - ; - break;} -case 301: -#line 4175 "script_parser.y" -{ - if (!script1ParseOnly) - { - // take given Item Number - index is one less - itemNumber = script1vsp[-1].integer - 1; - } - ; - break;} -case 304: -#line 4189 "script_parser.y" -{ - if (!script1ParseOnly) - { - fileHead_ptr = new FILEHEAD_CLASS(); - - // cascade the logger - fileHead_ptr->setLogger(script1Session_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 310: -#line 4212 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPreambleValue(script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 311: -#line 4228 "script_parser.y" -{ - if (!script1ParseOnly) - { - convertHex(script1vsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPrefix(script1vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script1vsp[0].string_ptr); - script1vsp[0].string_ptr = NULL; - ; - break;} -case 312: -#line 4244 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (fileHead_ptr) - { - fileHead_ptr->setTransferSyntaxUid(transferSyntaxName.getUid()); - } - } - ; - break;} -case 315: -#line 4260 "script_parser.y" -{ - if (!script1ParseOnly) - { - fileTail_ptr = new FILETAIL_CLASS(); - - // cascade the logger - fileTail_ptr->setLogger(script1Session_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 321: -#line 4283 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(true); - } - } - ; - break;} -case 322: -#line 4293 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(false); - } - } - ; - break;} -case 323: -#line 4305 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setSectorSize(script1vsp[0].integer); - } - } - ; - break;} -case 324: -#line 4317 "script_parser.y" -{ - if (!script1ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setPaddingValue((BYTE)script1vsp[0].integer); - } - } - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "bison.simple" - - script1vsp -= yylen; - script1ssp -= yylen; -#ifdef YYLSP_NEEDED - script1lsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (script1debug) - { - short *ssp1 = script1ss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != script1ssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++script1vsp = script1val; - -#ifdef YYLSP_NEEDED - script1lsp++; - if (yylen == 0) - { - script1lsp->first_line = yylloc.first_line; - script1lsp->first_column = yylloc.first_column; - script1lsp->last_line = (script1lsp-1)->last_line; - script1lsp->last_column = (script1lsp-1)->last_column; - script1lsp->text = 0; - } - else - { - script1lsp->last_line = (script1lsp+yylen-1)->last_line; - script1lsp->last_column = (script1lsp+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 = script1r1[yyn]; - - script1state = script1pgoto[yyn - YYNTBASE] + *script1ssp; - if (script1state >= 0 && script1state <= YYLAST && yycheck[script1state] == *script1ssp) - script1state = yytable[script1state]; - else - script1state = script1defgoto[yyn - YYNTBASE]; - - goto yynewstate; - -script1errlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++script1nerrs; - -#ifdef YYERROR_VERBOSE - yyn = script1pact[script1state]; - - 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++; - } - } - script1error(msg); - free(msg); - } - else - script1error ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - script1error("parse error"); - } - - goto script1errlab1; -script1errlab1: /* 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 (script1char == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (script1debug) - fprintf(stderr, "Discarding token %d (%s).\n", script1char, yytname[script1char1]); -#endif - - script1char = 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 = script1defact[script1state]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto script1default; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (script1ssp == script1ss) YYABORT; - script1vsp--; - script1state = *--script1ssp; -#ifdef YYLSP_NEEDED - script1lsp--; -#endif - -#if YYDEBUG != 0 - if (script1debug) - { - short *ssp1 = script1ss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != script1ssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = script1pact[script1state]; - 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 (script1debug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++script1vsp = script1lval; -#ifdef YYLSP_NEEDED - *++script1lsp = yylloc; -#endif - - script1state = yyn; - goto yynewstate; -} -#line 4327 "script_parser.y" - - diff --git a/DVTk_Library/Libraries/Scripting/script1_parser.cpp.h b/DVTk_Library/Libraries/Scripting/script1_parser.cpp.h deleted file mode 100644 index f3ee64b..0000000 --- a/DVTk_Library/Libraries/Scripting/script1_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 script1lval; diff --git a/DVTk_Library/Libraries/Scripting/script2_lexer.cpp b/DVTk_Library/Libraries/Scripting/script2_lexer.cpp deleted file mode 100644 index 0feefe3..0000000 --- a/DVTk_Library/Libraries/Scripting/script2_lexer.cpp +++ /dev/null @@ -1,3409 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE script2restart( script2in ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int script2leng; -extern FILE *script2in, *script2out; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up script2text. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up script2text again */ \ - } \ - while ( 0 ) - -#define unput(c) script2unput( c, script2text_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via script2restart()), so that the user can continue scanning by - * just pointing script2in at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when script2text is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int script2leng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow script2wrap()'s to do buffer switches - * instead of setting up a fresh script2in. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void script2restart YY_PROTO(( FILE *input_file )); - -void script2_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void script2_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE script2_create_buffer YY_PROTO(( FILE *file, int size )); -void script2_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void script2_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void script2_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER script2_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE script2_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE script2_scan_string YY_PROTO(( yyconst char *str )); -YY_BUFFER_STATE script2_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer script2_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script2_create_buffer( script2in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script2_create_buffer( script2in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define script2wrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *script2in = (FILE *) 0, *script2out = (FILE *) 0; -typedef int yy_state_type; -#define YY_FLEX_LEX_COMPAT -extern int script2lineno; -int script2lineno = 1; -extern char script2text[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up script2text. - */ -#define YY_DO_BEFORE_ACTION \ - script2text_ptr = yy_bp; \ - script2text_ptr -= yy_more_len; \ - script2leng = (int) (yy_cp - script2text_ptr); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( script2leng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( script2text, script2text_ptr, script2leng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 211 -#define YY_END_OF_BUFFER 212 -static yyconst short int yy_acclist[969] = - { 0, - 212, 210, 211, 7, 210, 211, 7, 211, 210, 211, - 210, 211, 12, 210, 211, 14, 210, 211, 210, 211, - 206, 210, 211, 206, 210, 211, 10, 210, 211, 9, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 11, 210, 211, 13, 210, 211, 1, 210, - 211, 7, 210, 211, 6, 7, 211, 210, 211, 7, - 209, 5, 205, 206, 207, 207, 207, 207, 15, 207, - - 207, 207, 207, 16, 207, 17, 207, 207, 207, 207, - 207, 207, 18, 207, 207, 19, 207, 207, 207, 20, - 207, 21, 207, 207, 207, 207, 22, 207, 207, 23, - 207, 207, 24, 207, 207, 25, 207, 26, 207, 207, - 189, 207, 207, 27, 207, 28, 207, 192, 207, 194, - 207, 29, 207, 30, 207, 207, 31, 207, 207, 207, - 207, 207, 207, 207, 32, 207, 33, 207, 207, 34, - 207, 35, 207, 36, 207, 207, 207, 37, 207, 207, - 38, 207, 39, 207, 40, 207, 41, 207, 42, 207, - 43, 207, 207, 207, 207, 207, 207, 8, 7, 6, - - 7, 4, 5, 208, 203, 204, 204, 203, 207, 207, - 207, 142, 207, 193, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 191, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 199, 207, 207, 201, 207, 207, - 207, 207, 47, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 190, 207, 4, 2, - 4, 5, 207, 207, 207, 207, 207, 207, 207, 207, - - 207, 207, 207, 207, 50, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 58, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 52, 207, 207, 207, 207, 207, 207, - 207, 207, 59, 207, 207, 207, 207, 44, 207, 207, - 207, 207, 207, 207, 55, 207, 207, 207, 207, 207, - 207, 207, 207, 2, 4, 3, 4, 5, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - - 61, 207, 207, 207, 207, 207, 207, 207, 207, 198, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 45, 207, 207, 207, 207, 207, 207, - 207, 207, 196, 207, 207, 207, 207, 207, 207, 207, - 53, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 46, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 51, 207, 207, 207, 207, 207, - 83, 207, 207, 207, 207, 82, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 177, - - 207, 207, 207, 171, 207, 207, 207, 207, 207, 168, - 207, 207, 207, 207, 197, 207, 169, 207, 207, 54, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 186, 207, 140, 207, 207, 207, 207, 207, 48, 207, - 60, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 57, 207, 69, 207, 81, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 195, - 207, 207, 207, 207, 207, 207, 80, 207, 207, 207, - 207, 207, 207, 207, 207, 56, 67, 207, 207, 141, - 200, 207, 207, 207, 207, 207, 207, 93, 207, 207, - - 207, 207, 207, 207, 92, 207, 207, 207, 207, 207, - 207, 76, 207, 207, 207, 207, 77, 207, 207, 123, - 127, 207, 207, 207, 207, 122, 207, 207, 126, 207, - 207, 207, 65, 207, 176, 207, 207, 207, 207, 145, - 207, 207, 207, 207, 79, 207, 78, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 85, 89, 95, 97, - 207, 207, 207, 207, 84, 207, 207, 88, 207, 207, - 94, 207, 96, 207, 207, 207, 207, 207, 173, 175, - 172, 207, 174, 207, 207, 207, 125, 129, 207, 207, - 207, 207, 124, 207, 128, 207, 207, 207, 207, 207, - - 202, 207, 207, 207, 207, 143, 207, 207, 207, 207, - 207, 207, 87, 91, 99, 101, 207, 207, 207, 207, - 86, 207, 90, 207, 98, 207, 100, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 139, 137, 207, 207, 68, 207, 207, 144, 207, - 207, 207, 207, 105, 103, 207, 207, 49, 207, 104, - 207, 102, 207, 207, 207, 207, 207, 107, 111, 115, - 106, 207, 207, 110, 207, 207, 114, 207, 207, 207, - 207, 207, 207, 207, 181, 180, 207, 207, 207, 133, - 135, 131, 207, 207, 138, 207, 136, 207, 207, 207, - - 207, 207, 207, 207, 109, 113, 117, 108, 207, 112, - 207, 116, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 185, - 184, 207, 207, 207, 207, 207, 207, 132, 207, 134, - 207, 130, 207, 207, 207, 207, 188, 187, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 150, 149, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 179, 178, - 207, 63, 207, 152, 151, 207, 207, 64, 207, 207, - 207, 207, 207, 148, 147, 207, 207, 207, 207, 207, - 207, 207, 119, 118, 207, 207, 207, 170, 207, 66, - - 62, 207, 207, 207, 207, 207, 121, 120, 207, 207, - 207, 207, 71, 207, 207, 207, 207, 207, 207, 70, - 72, 207, 207, 207, 156, 155, 207, 207, 207, 207, - 207, 207, 165, 207, 207, 73, 75, 207, 207, 207, - 207, 207, 74, 207, 207, 159, 158, 207, 154, 153, - 207, 183, 182, 207, 161, 160, 207, 207, 146, 207, - 167, 207, 157, 163, 162, 207, 166, 164 - } ; - -static yyconst short int yy_accept[1203] = - { 0, - 1, 1, 1, 2, 4, 7, 9, 11, 13, 16, - 19, 21, 24, 27, 30, 33, 35, 37, 39, 41, - 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, - 63, 65, 67, 69, 71, 73, 76, 79, 82, 85, - 88, 90, 91, 91, 92, 92, 92, 93, 94, 95, - 95, 96, 97, 98, 99, 101, 102, 103, 104, 106, - 108, 109, 110, 110, 111, 112, 113, 115, 116, 118, - 119, 120, 122, 124, 125, 126, 127, 129, 130, 132, - 133, 135, 136, 138, 140, 141, 141, 143, 144, 146, - 148, 150, 152, 154, 156, 157, 159, 160, 161, 162, - - 163, 164, 165, 167, 169, 170, 172, 174, 176, 177, - 178, 180, 181, 183, 185, 187, 189, 191, 193, 194, - 195, 196, 197, 198, 199, 200, 202, 202, 202, 204, - 204, 204, 204, 205, 207, 208, 209, 210, 211, 212, - 214, 216, 217, 218, 219, 220, 221, 222, 222, 222, - 222, 222, 222, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 246, 246, - 246, 246, 246, 246, 247, 248, 249, 250, 251, 252, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - - 264, 265, 267, 268, 270, 271, 272, 273, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 289, 289, 290, 290, 290, 290, 293, 294, 295, - 295, 296, 297, 298, 299, 300, 301, 302, 302, 302, - 302, 302, 302, 302, 303, 304, 305, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 331, 331, 331, 331, 331, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, - - 357, 358, 360, 361, 361, 362, 363, 364, 365, 367, - 368, 369, 370, 371, 372, 373, 374, 374, 376, 376, - 379, 379, 380, 381, 381, 382, 383, 384, 385, 386, - 387, 388, 388, 388, 388, 388, 388, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 403, 404, 405, 406, 407, 408, 409, 409, 410, - 412, 413, 414, 415, 416, 416, 416, 416, 416, 416, - 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 436, - 437, 438, 439, 440, 441, 441, 442, 443, 445, 446, - - 447, 447, 448, 449, 450, 451, 453, 453, 454, 454, - 455, 456, 457, 458, 459, 460, 461, 461, 461, 461, - 461, 461, 461, 462, 463, 464, 465, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 477, 478, 479, 480, - 481, 483, 483, 483, 484, 485, 486, 488, 489, 490, - 490, 490, 490, 490, 490, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 502, 503, 504, 506, - 507, 508, 509, 510, 512, 513, 514, 515, 517, 517, - 519, 520, 522, 523, 523, 524, 525, 526, 527, 527, - 528, 528, 529, 530, 531, 533, 535, 536, 537, 537, - - 537, 537, 537, 537, 537, 537, 538, 539, 541, 543, - 544, 545, 546, 547, 548, 549, 550, 550, 551, 552, - 554, 556, 558, 558, 558, 559, 560, 561, 562, 563, - 563, 563, 563, 563, 563, 563, 564, 565, 566, 567, - 568, 569, 570, 572, 573, 574, 575, 576, 577, 579, - 580, 581, 582, 582, 582, 582, 583, 583, 583, 584, - 584, 585, 586, 589, 590, 591, 593, 593, 594, 595, - 596, 597, 598, 598, 598, 598, 599, 599, 599, 599, - 599, 600, 600, 601, 602, 603, 604, 605, 607, 608, - 609, 610, 610, 611, 611, 611, 612, 614, 614, 614, - - 614, 615, 616, 617, 619, 619, 620, 620, 620, 620, - 620, 621, 621, 622, 622, 623, 624, 625, 626, 628, - 629, 631, 632, 632, 633, 635, 637, 638, 639, 640, - 642, 642, 643, 643, 643, 643, 644, 644, 644, 645, - 645, 647, 649, 650, 651, 651, 652, 653, 654, 655, - 656, 657, 657, 658, 658, 659, 659, 660, 661, 661, - 661, 661, 662, 662, 663, 664, 665, 667, 668, 670, - 671, 673, 675, 676, 677, 677, 678, 678, 678, 679, - 679, 680, 681, 683, 685, 686, 686, 687, 687, 687, - 687, 687, 688, 689, 690, 691, 692, 693, 695, 697, - - 697, 698, 699, 699, 700, 701, 701, 703, 703, 703, - 703, 704, 704, 704, 704, 705, 705, 706, 708, 708, - 709, 709, 710, 711, 712, 713, 713, 714, 715, 716, - 717, 717, 717, 718, 718, 719, 720, 721, 723, 725, - 727, 729, 730, 730, 731, 731, 731, 732, 732, 733, - 733, 734, 734, 734, 734, 734, 735, 736, 737, 738, - 738, 739, 740, 740, 741, 742, 743, 744, 744, 744, - 744, 745, 745, 745, 745, 746, 746, 748, 748, 749, - 749, 749, 751, 752, 753, 754, 755, 756, 756, 757, - 757, 758, 760, 762, 764, 764, 765, 765, 765, 766, - - 766, 767, 767, 768, 769, 769, 770, 770, 771, 771, - 771, 773, 774, 776, 777, 779, 780, 781, 781, 782, - 783, 783, 784, 785, 785, 785, 786, 788, 788, 788, - 788, 789, 789, 789, 789, 790, 791, 792, 793, 794, - 795, 797, 799, 799, 800, 800, 801, 801, 802, 802, - 802, 803, 803, 804, 804, 805, 806, 807, 808, 808, - 810, 812, 814, 815, 815, 816, 817, 817, 818, 819, - 819, 819, 819, 819, 819, 820, 820, 820, 820, 820, - 821, 821, 822, 823, 823, 824, 824, 825, 825, 826, - 826, 826, 827, 827, 827, 827, 828, 828, 829, 829, - - 830, 831, 833, 833, 834, 834, 835, 836, 836, 836, - 836, 836, 836, 837, 837, 837, 837, 837, 838, 838, - 840, 842, 844, 844, 845, 845, 846, 846, 847, 847, - 848, 850, 850, 850, 850, 851, 851, 852, 852, 853, - 853, 854, 854, 855, 856, 856, 856, 856, 856, 856, - 857, 857, 857, 857, 857, 858, 858, 859, 861, 861, - 862, 862, 863, 863, 863, 863, 863, 863, 864, 864, - 865, 865, 866, 866, 867, 867, 868, 869, 869, 869, - 869, 869, 870, 872, 872, 873, 873, 873, 874, 874, - 875, 877, 877, 878, 879, 879, 879, 879, 879, 879, - - 879, 880, 881, 881, 882, 882, 883, 883, 884, 885, - 887, 888, 888, 888, 888, 888, 888, 888, 888, 889, - 889, 889, 890, 890, 890, 890, 890, 890, 890, 890, - 891, 892, 892, 893, 894, 894, 896, 897, 897, 898, - 900, 900, 900, 900, 901, 901, 901, 902, 903, 903, - 903, 904, 904, 904, 904, 904, 904, 904, 904, 905, - 906, 906, 907, 908, 910, 910, 911, 911, 911, 911, - 911, 911, 912, 912, 912, 913, 913, 913, 913, 913, - 914, 914, 914, 915, 916, 916, 917, 917, 918, 918, - 918, 918, 918, 918, 919, 919, 919, 920, 920, 921, - - 922, 922, 922, 922, 923, 924, 924, 925, 926, 928, - 928, 928, 928, 928, 928, 929, 929, 929, 930, 930, - 930, 930, 930, 930, 931, 932, 932, 933, 933, 934, - 934, 934, 934, 934, 935, 935, 935, 936, 936, 937, - 938, 938, 938, 939, 940, 940, 941, 941, 941, 941, - 941, 941, 942, 942, 942, 943, 944, 944, 944, 945, - 946, 947, 949, 949, 949, 949, 949, 950, 952, 952, - 953, 955, 956, 956, 958, 959, 959, 960, 960, 960, - 960, 960, 961, 961, 961, 962, 962, 962, 963, 964, - 964, 964, 965, 967, 967, 967, 967, 967, 967, 968, - - 969, 969 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 7, 1, 1, 1, 1, 8, - 9, 1, 10, 1, 11, 1, 1, 12, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 1, 14, 1, - 15, 1, 1, 1, 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, - 1, 42, 1, 1, 43, 1, 44, 44, 44, 44, - - 44, 44, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, - 1, 1, 46, 1, 47, 1, 1, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48 - } ; - -static yyconst int yy_meta[49] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 1, 1, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 1, 4, 5, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[1212] = - { 0, - 0, 47, 1305, 1306, 53, 57, 45, 1301, 1306, 1306, - 51, 53, 55, 1306, 1306, 82, 0, 60, 54, 57, - 53, 45, 75, 1287, 84, 91, 103, 77, 119, 98, - 123, 65, 88, 1282, 1298, 1306, 1306, 1306, 158, 164, - 138, 168, 132, 1306, 172, 1297, 1306, 70, 122, 164, - 0, 1269, 1280, 1278, 0, 1269, 1276, 1263, 145, 0, - 1258, 90, 162, 1265, 158, 1271, 0, 173, 1255, 171, - 1255, 0, 0, 1265, 1271, 124, 0, 1259, 0, 53, - 0, 1256, 0, 0, 1245, 184, 0, 193, 0, 1262, - 0, 0, 0, 0, 129, 0, 1251, 110, 198, 1254, - - 186, 202, 0, 0, 174, 0, 0, 188, 1246, 1251, - 0, 1262, 0, 0, 0, 0, 1257, 0, 1249, 1242, - 1241, 1249, 1238, 1306, 236, 242, 226, 1268, 1306, 239, - 1267, 220, 1306, 236, 1225, 241, 1235, 1247, 1255, 0, - 0, 1238, 1234, 1234, 1232, 233, 1241, 1244, 1241, 1234, - 1237, 1226, 1220, 1227, 1222, 1231, 1211, 1234, 1233, 1230, - 1223, 1226, 1215, 1209, 1227, 1218, 239, 240, 1211, 1223, - 1221, 1208, 1217, 1214, 230, 1213, 1210, 1215, 1199, 1211, - 1193, 1209, 1208, 1209, 1193, 1205, 1187, 1203, 1202, 0, - 1202, 1196, 1183, 242, 1183, 243, 1197, 245, 1180, 161, - - 1195, 1180, 1189, 0, 1177, 1192, 1186, 0, 1198, 1175, - 1183, 1187, 1170, 1184, 1174, 1169, 245, 1184, 1180, 1164, - 0, 1195, 1306, 1194, 269, 1193, 1306, 1160, 1163, 1171, - 1168, 1173, 1172, 1155, 1158, 1153, 1159, 1156, 1161, 1154, - 1147, 1144, 1150, 246, 1163, 1154, 0, 1142, 1147, 1152, - 1145, 1138, 1135, 1141, 1136, 1140, 1128, 1132, 1149, 1138, - 0, 1137, 1127, 1129, 225, 1141, 1140, 1126, 1122, 1129, - 1121, 1135, 1127, 1133, 1117, 1116, 1115, 1129, 1121, 1127, - 1111, 1110, 1120, 1123, 1115, 1113, 1116, 1119, 1108, 0, - 1107, 1112, 1100, 1118, 1113, 1097, 1104, 0, 1112, 1098, - - 1098, 0, 1107, 1108, 1107, 1106, 1083, 1102, 0, 1087, - 1109, 1095, 1099, 1087, 1093, 1095, 1111, 1306, 1110, 1306, - 271, 1101, 1076, 1077, 1091, 1084, 1084, 1086, 1072, 1074, - 1083, 1084, 1071, 1081, 1088, 1078, 1064, 1077, 1066, 1061, - 1060, 1072, 1073, 1060, 1070, 1045, 1067, 1053, 1065, 1064, - 0, 1063, 1055, 1065, 1060, 1044, 1043, 252, 255, 0, - 1049, 1041, 1059, 1038, 1049, 1056, 1051, 1041, 1058, 1057, - 1043, 1050, 1045, 1035, 1020, 1019, 1032, 1031, 1043, 1041, - 1018, 1027, 1037, 1025, 1016, 1028, 1017, 1016, 0, 1014, - 1012, 1012, 1013, 1011, 1017, 1023, 1007, 0, 1013, 1019, - - 1015, 1010, 1021, 1002, 1005, 0, 1001, 1003, 1002, 1015, - 1014, 996, 993, 992, 1008, 1009, 1004, 1012, 1011, 988, - 1009, 999, 262, 996, 997, 988, 0, 995, 971, 970, - 979, 968, 990, 974, 275, 0, 988, 967, 987, 985, - 0, 984, 987, 982, 985, 980, 0, 977, 970, 967, - 961, 960, 959, 960, 959, 961, 955, 954, 953, 954, - 953, 963, 949, 948, 955, 0, 946, 950, 936, 958, - 947, 956, 940, 0, 963, 962, 268, 0, 956, 0, - 960, 0, 950, 950, 934, 932, 946, 929, 932, 930, - 926, 926, 925, 929, 0, 0, 934, 923, 929, 922, - - 921, 257, 920, 941, 935, 934, 277, 906, 0, 921, - 914, 913, 261, 912, 901, 281, 909, 285, 923, 0, - 930, 0, 924, 915, 922, 913, 907, 915, 286, 905, - 913, 912, 920, 266, 267, 901, 909, 908, 884, 270, - 274, 292, 0, 906, 905, 908, 896, 903, 0, 892, - 909, 889, 885, 897, 882, 881, 880, 876, 879, 891, - 890, 289, 0, 875, 1306, 0, 877, 883, 290, 877, - 889, 884, 892, 283, 284, 1306, 871, 287, 868, 880, - 879, 882, 881, 867, 852, 291, 298, 0, 863, 299, - 860, 857, 856, 858, 862, 861, 0, 851, 867, 858, - - 865, 856, 847, 0, 854, 853, 868, 867, 866, 843, - 1306, 844, 1306, 843, 830, 829, 828, 837, 0, 838, - 0, 837, 830, 829, 0, 0, 830, 296, 840, 0, - 830, 829, 831, 821, 835, 834, 823, 840, 301, 826, - 0, 0, 824, 833, 841, 821, 839, 819, 818, 812, - 803, 812, 1306, 813, 1306, 812, 1306, 1306, 811, 302, - 830, 797, 819, 818, 807, 803, 0, 804, 0, 803, - 0, 0, 802, 306, 799, 798, 819, 809, 808, 793, - 1306, 1306, 0, 0, 810, 805, 804, 790, 789, 788, - 800, 1306, 1306, 786, 785, 784, 796, 0, 0, 799, - - 798, 789, 775, 774, 794, 295, 0, 782, 767, 724, - 12, 104, 161, 165, 194, 199, 293, 0, 310, 312, - 326, 314, 309, 326, 314, 316, 1306, 1306, 1306, 1306, - 318, 315, 316, 341, 310, 319, 323, 0, 0, 0, - 0, 325, 341, 342, 333, 332, 333, 343, 329, 336, - 337, 335, 336, 339, 341, 342, 343, 346, 348, 354, - 355, 353, 364, 365, 364, 1306, 1306, 367, 370, 369, - 370, 371, 368, 353, 354, 371, 0, 376, 386, 380, - 374, 0, 366, 358, 371, 1306, 1306, 380, 381, 372, - 373, 0, 0, 0, 385, 386, 391, 390, 391, 403, - - 391, 394, 395, 1306, 387, 1306, 388, 1306, 389, 391, - 0, 391, 0, 392, 0, 393, 395, 390, 391, 399, - 397, 398, 403, 422, 398, 1306, 0, 396, 417, 408, - 409, 404, 411, 423, 424, 1306, 1306, 1306, 433, 429, - 0, 0, 411, 412, 424, 425, 423, 424, 423, 418, - 419, 436, 426, 422, 423, 1306, 1306, 1306, 426, 0, - 0, 0, 427, 441, 443, 453, 431, 432, 437, 434, - 435, 436, 456, 439, 440, 436, 455, 448, 450, 450, - 451, 464, 458, 457, 458, 451, 452, 464, 465, 469, - 469, 470, 474, 475, 464, 469, 476, 477, 466, 467, - - 1306, 0, 485, 486, 481, 482, 473, 488, 485, 490, - 476, 496, 497, 503, 480, 487, 482, 489, 488, 0, - 0, 0, 500, 501, 495, 496, 495, 496, 491, 1306, - 0, 506, 507, 518, 519, 520, 489, 522, 491, 505, - 506, 507, 508, 504, 513, 511, 513, 519, 505, 506, - 517, 524, 513, 525, 515, 531, 1306, 0, 532, 533, - 532, 533, 533, 546, 547, 543, 542, 543, 530, 531, - 532, 533, 538, 539, 540, 541, 547, 552, 545, 556, - 546, 1306, 0, 557, 1306, 558, 546, 562, 550, 1306, - 0, 573, 542, 1306, 570, 557, 559, 560, 563, 571, - - 565, 573, 574, 575, 564, 565, 566, 567, 1306, 0, - 585, 586, 594, 586, 578, 586, 570, 570, 572, 596, - 582, 583, 586, 587, 588, 599, 592, 604, 588, 606, - 590, 606, 607, 1306, 595, 0, 596, 608, 609, 0, - 595, 613, 613, 1306, 603, 599, 1306, 600, 601, 621, - 622, 620, 613, 614, 631, 603, 610, 611, 612, 613, - 628, 629, 1306, 0, 611, 612, 628, 623, 643, 620, - 645, 614, 634, 640, 641, 650, 622, 623, 631, 1306, - 631, 642, 633, 644, 645, 646, 636, 637, 643, 645, - 646, 652, 648, 649, 649, 661, 662, 649, 1306, 1306, - - 663, 673, 655, 644, 658, 652, 653, 680, 0, 663, - 658, 674, 679, 680, 681, 669, 675, 676, 681, 669, - 682, 668, 676, 670, 678, 688, 689, 686, 1306, 691, - 690, 678, 686, 687, 682, 688, 689, 698, 1306, 1306, - 696, 710, 698, 680, 705, 706, 691, 688, 698, 705, - 710, 711, 721, 711, 712, 1306, 716, 707, 718, 709, - 1306, 0, 719, 705, 706, 712, 1306, 0, 705, 1306, - 0, 1306, 728, 0, 729, 718, 1306, 723, 719, 725, - 722, 723, 718, 737, 1306, 725, 735, 736, 1306, 722, - 739, 1306, 0, 735, 730, 731, 724, 734, 1306, 1306, - - 1306, 763, 768, 771, 775, 780, 783, 788, 793, 798, - 803 - } ; - -static yyconst short int yy_def[1212] = - { 0, - 1201, 1, 1201, 1201, 1201, 1201, 1202, 1203, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1205, 1201, 1202, 1201, 1206, 1203, 1201, 1201, 1201, 1207, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1201, 1201, 1201, 1208, 1205, 1201, 1205, - 1209, 1206, 1201, 1207, 1207, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1208, 1201, 1210, 1211, 1209, 1201, 1204, 1204, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1210, 1201, 1211, 1201, - 1211, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - - 1201, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, - - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, - - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - 1201, 1201, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - - 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1201, - 1204, 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1201, 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, - - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1204, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 0, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201 - } ; - -static yyconst short int yy_nxt[1355] = - { 0, - 4, 5, 6, 5, 5, 7, 8, 9, 10, 11, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 17, 17, 22, 17, 17, 23, 24, 25, 26, - 27, 17, 28, 29, 30, 31, 32, 33, 17, 34, - 17, 35, 17, 4, 4, 36, 37, 38, 39, 40, - 44, 39, 771, 41, 42, 42, 42, 42, 42, 42, - 42, 42, 48, 48, 49, 49, 49, 49, 174, 69, - 63, 77, 80, 70, 74, 64, 78, 71, 81, 79, - 119, 48, 48, 175, 120, 75, 45, 72, 73, 65, - 82, 50, 66, 67, 86, 76, 99, 50, 52, 53, - - 54, 55, 68, 121, 83, 146, 100, 89, 56, 84, - 57, 90, 58, 87, 772, 59, 60, 61, 95, 91, - 122, 110, 147, 92, 62, 111, 88, 93, 94, 194, - 112, 96, 97, 49, 49, 98, 101, 44, 102, 195, - 129, 103, 130, 171, 131, 104, 113, 191, 105, 114, - 106, 115, 107, 108, 172, 116, 117, 118, 109, 125, - 126, 42, 125, 192, 127, 42, 42, 42, 42, 42, - 42, 42, 42, 45, 133, 134, 134, 44, 143, 148, - 296, 149, 150, 151, 144, 155, 156, 773, 157, 152, - 159, 166, 160, 161, 162, 153, 297, 167, 774, 178, - - 163, 179, 180, 181, 209, 182, 164, 136, 184, 210, - 185, 186, 187, 196, 188, 197, 202, 183, 203, 205, - 211, 204, 1201, 212, 198, 44, 189, 775, 223, 199, - 206, 200, 224, 776, 207, 358, 208, 125, 126, 42, - 125, 129, 127, 42, 42, 42, 42, 134, 134, 235, - 225, 225, 136, 136, 257, 259, 267, 286, 258, 268, - 293, 290, 287, 312, 294, 338, 236, 359, 313, 339, - 260, 320, 505, 320, 442, 288, 291, 444, 555, 136, - 321, 321, 321, 321, 136, 517, 443, 582, 576, 445, - 577, 592, 588, 518, 589, 595, 605, 611, 613, 612, - - 614, 619, 623, 620, 506, 621, 703, 622, 642, 647, - 556, 714, 643, 648, 653, 655, 654, 656, 658, 583, - 659, 777, 667, 593, 668, 766, 767, 596, 606, 669, - 672, 670, 673, 730, 624, 731, 778, 741, 704, 742, - 779, 780, 782, 715, 783, 784, 785, 786, 787, 788, - 789, 790, 791, 792, 793, 794, 795, 796, 781, 797, - 798, 799, 800, 801, 802, 803, 804, 806, 805, 807, - 808, 810, 809, 811, 813, 812, 814, 815, 817, 816, - 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, - 828, 829, 830, 831, 832, 833, 834, 836, 837, 839, - - 840, 841, 842, 843, 844, 838, 845, 846, 847, 848, - 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 835, 867, - 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, - 878, 880, 879, 881, 882, 884, 885, 886, 887, 888, - 889, 890, 891, 892, 893, 896, 897, 898, 899, 900, - 901, 883, 902, 903, 905, 906, 907, 908, 894, 909, - 910, 911, 895, 912, 913, 914, 915, 916, 917, 918, - 919, 920, 921, 923, 924, 925, 926, 927, 928, 922, - 929, 930, 931, 932, 933, 904, 934, 935, 936, 937, - - 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, - 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, - 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, - 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, - 989, 990, 991, 992, 993, 994, 995, 996, 997, 999, - 1001, 968, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, - 1011, 1012, 998, 1013, 1014, 1015, 1016, 1017, 1000, 1002, - 1018, 1019, 1020, 1021, 1022, 1023, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1034, 1036, 1035, 1037, 1024, - - 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, - 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, - 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, - 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, - 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, - 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, - 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, - 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, - 1118, 1119, 1121, 1122, 1123, 1120, 1124, 1125, 1126, 1127, - 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, - - 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, - 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, - 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, - 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, - 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, - 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, - 1198, 1199, 1200, 43, 770, 43, 43, 43, 46, 46, - 46, 46, 46, 51, 51, 128, 128, 128, 128, 128, - 132, 132, 132, 132, 132, 135, 769, 135, 222, 222, - 222, 222, 222, 226, 226, 226, 226, 226, 317, 317, - - 317, 317, 317, 319, 319, 319, 319, 319, 768, 765, - 764, 763, 762, 761, 760, 759, 758, 757, 756, 755, - 754, 753, 752, 751, 750, 749, 748, 747, 746, 745, - 744, 743, 740, 739, 738, 737, 736, 735, 734, 733, - 732, 729, 728, 727, 726, 725, 724, 723, 722, 721, - 720, 719, 718, 717, 716, 713, 712, 711, 710, 709, - 708, 707, 706, 705, 702, 701, 700, 699, 698, 697, - 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, - 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, - 676, 675, 674, 671, 666, 665, 664, 663, 662, 661, - - 660, 657, 652, 651, 650, 649, 646, 645, 644, 641, - 640, 639, 638, 637, 636, 635, 634, 633, 632, 631, - 630, 629, 628, 627, 626, 625, 618, 617, 616, 615, - 610, 609, 608, 607, 604, 603, 602, 601, 600, 599, - 598, 597, 594, 591, 590, 587, 586, 585, 584, 581, - 580, 579, 578, 575, 574, 573, 572, 571, 570, 569, - 568, 567, 566, 565, 564, 563, 562, 561, 560, 559, - 558, 557, 554, 553, 552, 551, 550, 549, 548, 547, - 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, - 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, - - 526, 525, 524, 523, 522, 521, 520, 519, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 504, 503, - 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, - 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, - 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, - 452, 451, 450, 449, 448, 447, 446, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 320, 318, 406, 405, 404, 403, 402, 401, - 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, - 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, - 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 360, 357, 356, 355, 354, 353, 352, 351, 350, 349, - 348, 347, 346, 345, 344, 343, 342, 341, 340, 337, - 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, - 326, 325, 324, 323, 322, 227, 318, 223, 316, 315, - - 314, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 295, 292, 289, 285, 284, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 272, 271, 270, 269, 266, 265, 264, 263, 262, - 261, 256, 255, 254, 253, 252, 251, 250, 249, 248, - 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, - 237, 234, 233, 232, 231, 230, 229, 228, 1201, 227, - 129, 221, 220, 219, 218, 217, 216, 215, 214, 213, - 201, 193, 190, 177, 176, 173, 170, 169, 168, 165, - 158, 154, 145, 142, 141, 140, 139, 138, 137, 47, - - 124, 123, 85, 47, 1201, 3, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yyconst short int yy_chk[1355] = - { 0, - 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, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 7, 2, 711, 2, 5, 5, 5, 5, 6, 6, - 6, 6, 11, 11, 12, 12, 13, 13, 80, 19, - 18, 21, 22, 19, 20, 18, 21, 19, 22, 21, - 32, 48, 48, 80, 32, 20, 7, 19, 19, 18, - 23, 12, 18, 18, 25, 20, 28, 12, 16, 16, - - 16, 16, 18, 33, 23, 62, 28, 26, 16, 23, - 16, 26, 16, 25, 712, 16, 16, 16, 27, 26, - 33, 30, 62, 26, 16, 30, 25, 26, 26, 98, - 30, 27, 27, 49, 49, 27, 29, 43, 29, 98, - 41, 29, 41, 76, 41, 29, 31, 95, 29, 31, - 29, 31, 29, 29, 76, 31, 31, 31, 29, 39, - 39, 39, 39, 95, 39, 40, 40, 40, 40, 42, - 42, 42, 42, 43, 45, 50, 50, 45, 59, 63, - 200, 63, 63, 63, 59, 65, 65, 713, 65, 63, - 68, 70, 68, 68, 68, 63, 200, 70, 714, 86, - - 68, 86, 86, 86, 105, 86, 68, 50, 88, 105, - 88, 88, 88, 99, 88, 99, 101, 86, 101, 102, - 108, 101, 132, 108, 99, 132, 88, 715, 127, 99, - 102, 99, 127, 716, 102, 265, 102, 125, 125, 125, - 125, 130, 125, 126, 126, 126, 126, 134, 134, 146, - 130, 130, 136, 136, 167, 168, 175, 194, 167, 175, - 198, 196, 194, 217, 198, 244, 146, 265, 217, 244, - 168, 225, 423, 321, 358, 194, 196, 359, 477, 134, - 225, 225, 321, 321, 136, 435, 358, 507, 502, 359, - 502, 516, 513, 435, 513, 518, 529, 534, 535, 534, - - 535, 540, 542, 540, 423, 541, 628, 541, 562, 569, - 477, 639, 562, 569, 574, 575, 574, 575, 578, 507, - 578, 717, 586, 516, 586, 706, 706, 518, 529, 587, - 590, 587, 590, 660, 542, 660, 719, 674, 628, 674, - 720, 721, 722, 639, 723, 724, 725, 726, 731, 732, - 733, 734, 735, 736, 737, 742, 743, 744, 721, 745, - 746, 747, 748, 749, 750, 751, 752, 753, 752, 753, - 754, 755, 754, 756, 757, 756, 757, 758, 759, 758, - 760, 761, 762, 763, 764, 765, 768, 769, 770, 771, - 772, 773, 774, 775, 776, 778, 779, 780, 781, 783, - - 784, 785, 785, 788, 789, 781, 790, 791, 795, 796, - 797, 798, 799, 800, 801, 802, 803, 805, 807, 809, - 810, 812, 814, 816, 817, 818, 819, 820, 779, 821, - 822, 823, 824, 825, 828, 829, 830, 831, 832, 833, - 834, 835, 834, 839, 840, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 859, 863, - 864, 840, 865, 866, 867, 868, 869, 870, 852, 871, - 872, 873, 852, 874, 875, 876, 877, 878, 879, 880, - 881, 882, 883, 884, 885, 886, 887, 888, 889, 883, - 890, 891, 892, 893, 894, 866, 895, 896, 897, 898, - - 899, 900, 903, 904, 905, 906, 907, 908, 909, 910, - 911, 912, 913, 914, 915, 916, 917, 918, 919, 923, - 924, 925, 926, 927, 928, 929, 932, 933, 934, 935, - 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, - 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, - 956, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 968, 935, 969, 970, 971, 972, 973, 974, 975, 976, - 977, 978, 966, 979, 980, 981, 984, 986, 967, 968, - 987, 988, 989, 992, 993, 995, 996, 997, 998, 999, - 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1005, 1006, 995, - - 1007, 1008, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, - 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1035, 1037, 1038, 1039, 1041, - 1042, 1043, 1045, 1046, 1048, 1049, 1050, 1051, 1052, 1053, - 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1065, - 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, - 1076, 1077, 1078, 1079, 1081, 1082, 1083, 1084, 1085, 1086, - 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, - 1097, 1098, 1101, 1102, 1103, 1098, 1104, 1105, 1106, 1107, - 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, - - 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, - 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1141, - 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, - 1152, 1153, 1154, 1155, 1157, 1158, 1159, 1160, 1163, 1164, - 1165, 1166, 1169, 1173, 1175, 1176, 1178, 1179, 1180, 1181, - 1182, 1183, 1184, 1186, 1187, 1188, 1190, 1191, 1194, 1195, - 1196, 1197, 1198, 1202, 710, 1202, 1202, 1202, 1203, 1203, - 1203, 1203, 1203, 1204, 1204, 1205, 1205, 1205, 1205, 1205, - 1206, 1206, 1206, 1206, 1206, 1207, 709, 1207, 1208, 1208, - 1208, 1208, 1208, 1209, 1209, 1209, 1209, 1209, 1210, 1210, - - 1210, 1210, 1210, 1211, 1211, 1211, 1211, 1211, 708, 705, - 704, 703, 702, 701, 700, 697, 696, 695, 694, 691, - 690, 689, 688, 687, 686, 685, 680, 679, 678, 677, - 676, 675, 673, 670, 668, 666, 665, 664, 663, 662, - 661, 659, 656, 654, 652, 651, 650, 649, 648, 647, - 646, 645, 644, 643, 640, 638, 637, 636, 635, 634, - 633, 632, 631, 629, 627, 624, 623, 622, 620, 618, - 617, 616, 615, 614, 612, 610, 609, 608, 607, 606, - 605, 603, 602, 601, 600, 599, 598, 596, 595, 594, - 593, 592, 591, 589, 585, 584, 583, 582, 581, 580, - - 579, 577, 573, 572, 571, 570, 568, 567, 564, 561, - 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, - 550, 548, 547, 546, 545, 544, 539, 538, 537, 536, - 533, 532, 531, 530, 528, 527, 526, 525, 524, 523, - 521, 519, 517, 515, 514, 512, 511, 510, 508, 506, - 505, 504, 503, 501, 500, 499, 498, 497, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 481, 479, 476, 475, 473, 472, 471, 470, 469, 468, - 467, 465, 464, 463, 462, 461, 460, 459, 458, 457, - 456, 455, 454, 453, 452, 451, 450, 449, 448, 446, - - 445, 444, 443, 442, 440, 439, 438, 437, 434, 433, - 432, 431, 430, 429, 428, 426, 425, 424, 422, 421, - 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, - 410, 409, 408, 407, 405, 404, 403, 402, 401, 400, - 399, 397, 396, 395, 394, 393, 392, 391, 390, 388, - 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, - 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, - 367, 366, 365, 364, 363, 362, 361, 357, 356, 355, - 354, 353, 352, 350, 349, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, - - 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, - 323, 322, 319, 317, 316, 315, 314, 313, 312, 311, - 310, 308, 307, 306, 305, 304, 303, 301, 300, 299, - 297, 296, 295, 294, 293, 292, 291, 289, 288, 287, - 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, - 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, - 266, 264, 263, 262, 260, 259, 258, 257, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 246, 245, 243, - 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, - 232, 231, 230, 229, 228, 226, 224, 222, 220, 219, - - 218, 216, 215, 214, 213, 212, 211, 210, 209, 207, - 206, 205, 203, 202, 201, 199, 197, 195, 193, 192, - 191, 189, 188, 187, 186, 185, 184, 183, 182, 181, - 180, 179, 178, 177, 176, 174, 173, 172, 171, 170, - 169, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 145, 144, 143, 142, 139, 138, 137, 135, 131, - 128, 123, 122, 121, 120, 119, 117, 112, 110, 109, - 100, 97, 90, 85, 82, 78, 75, 74, 71, 69, - 66, 64, 61, 58, 57, 56, 54, 53, 52, 46, - - 35, 34, 24, 8, 3, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up script2text */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -static int yy_more_flag = 0; -static int yy_more_len = 0; -#define yymore() (yy_more_flag = 1) -#define YY_MORE_ADJ yy_more_len -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char script2text[YYLMAX]; -char *script2text_ptr; -#line 1 "script_lexer.l" -#define INITIAL 0 -#line 2 "script_lexer.l" -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -//***************************************************************************** -// DESCRIPTION : Script Lexer -//***************************************************************************** - -#ifdef _WINDOWS -#pragma warning (disable : 4102) -#pragma warning (disable : 4273) -#pragma warning (disable : 4786) -#endif - -//***************************************************************************** -// EXTERNAL DECLARATIONS -//***************************************************************************** -#include -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "Iutility.h" // Utility component interface -#include "Iwarehouse.h" // Warehouse component interface -#include "Idicom.h" // Dicom component interface -#include "Inetwork.h" // Network component interface -#include "Imedia.h" // Media File component interface -#include "Isession.h" // Test Session component interface - -#include "script2_parser.cpp.h" - -extern void script2error(char*); - -extern FILE *script2in; -extern int script2lineno; -extern char script2CurrentFilename[_MAX_PATH]; -extern long script2CurrentFileOffset; -extern long script2CurrentLineNo; -extern SCRIPT_SESSION_CLASS *script2Session_ptr; -extern bool script2IsNativeVts; -extern bool script2ParseOnly; - -bool IsHex(char, int *); - -static char *pEnd; - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int script2wrap YY_PROTO(( void )); -#else -extern int script2wrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void script2unput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef script2text_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int script2input YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( script2text, script2leng, 1, script2out ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( script2in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( script2in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, script2in )) == 0) \ - && ferror( script2in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int script2lex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after script2text and script2leng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( script2leng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (script2text[script2leng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 57 "script_lexer.l" - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! script2in ) - script2in = stdin; - - if ( ! script2out ) - script2out = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - script2_create_buffer( script2in, YY_BUF_SIZE ); - - script2_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_more_len = 0; - if ( yy_more_flag ) - { - yy_more_len = script2leng; - yy_more_flag = 0; - } - yy_cp = yy_c_buf_p; - - /* Support of script2text. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1306 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < script2leng; ++yyl ) - if ( script2text[yyl] == '\n' ) - ++script2lineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 58 "script_lexer.l" -{ /* skip charcters from 80H - FFH */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 60 "script_lexer.l" -{ - // copy script2 comment lines - strip off leading ## - int length = script2leng; - - // check to see how line is terminated - // - and remove termination - if ((script2text[script2leng-1] == LINEFEED) - && (script2text[script2leng-2] == CARRIAGERETURN)) - length -= 2; - else - length--; - - script2lval.string_ptr = (char*) malloc(length+1); - - memcpy(script2lval.string_ptr, &script2text[0], length); - script2lval.string_ptr[length] = NULLCHAR; - if (script2Session_ptr) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_NONE, 1, "%s", script2lval.string_ptr); - } - } - - free(script2lval.string_ptr); - script2lval.string_ptr = NULL; - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 89 "script_lexer.l" -{ /* extract file and line info from cpp comment lines: # Number ["file"] */ - char* iS = NULL; - char* nS = NULL; - iS = strstr(script2text, "# "); - if (iS != NULL) - { - nS = strstr(iS, " \""); - if (nS != NULL) - { - *nS++ = '\0'; - strcpy(script2CurrentFilename, nS); - } - script2CurrentFileOffset = atoi(iS+2); - script2CurrentLineNo = script2lineno; - } - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 105 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 110 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 115 "script_lexer.l" -{ /* skip empty lines */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 116 "script_lexer.l" -{ /* skip white space */ } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 117 "script_lexer.l" -{ /* continuation line */ } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 118 "script_lexer.l" -{ /* skip equal sign */ } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 119 "script_lexer.l" -{ /* skip semi-colon */ } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 120 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 121 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 122 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 123 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 124 "script_lexer.l" -{ script2lval.vr = ATTR_VR_AE; return VR; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 125 "script_lexer.l" -{ script2lval.vr = ATTR_VR_AS; return VR; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 126 "script_lexer.l" -{ script2lval.vr = ATTR_VR_AT; return VR; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 127 "script_lexer.l" -{ script2lval.vr = ATTR_VR_CS; return VR; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 128 "script_lexer.l" -{ script2lval.vr = ATTR_VR_DA; return VR; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 129 "script_lexer.l" -{ script2lval.vr = ATTR_VR_DS; return VR; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 130 "script_lexer.l" -{ script2lval.vr = ATTR_VR_DT; return VR; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 131 "script_lexer.l" -{ script2lval.vr = ATTR_VR_FD; return VR; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 132 "script_lexer.l" -{ script2lval.vr = ATTR_VR_FL; return VR; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 133 "script_lexer.l" -{ script2lval.vr = ATTR_VR_IS; return VR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 134 "script_lexer.l" -{ script2lval.vr = ATTR_VR_LO; return VR; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 135 "script_lexer.l" -{ script2lval.vr = ATTR_VR_LT; return VR; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 136 "script_lexer.l" -{ script2lval.vr = ATTR_VR_OB; return VR; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 137 "script_lexer.l" -{ script2lval.vr = ATTR_VR_OF; return VR; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 138 "script_lexer.l" -{ script2lval.vr = ATTR_VR_OV; return VR; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 139 "script_lexer.l" -{ script2lval.vr = ATTR_VR_OW; return VR; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 140 "script_lexer.l" -{ script2lval.vr = ATTR_VR_PN; return VR; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 141 "script_lexer.l" -{ script2lval.vr = ATTR_VR_SH; return VR; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 142 "script_lexer.l" -{ script2lval.vr = ATTR_VR_SL; return VR; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 143 "script_lexer.l" -{ script2lval.vr = ATTR_VR_SQ; return T_SQ; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 144 "script_lexer.l" -{ script2lval.vr = ATTR_VR_SS; return VR; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 145 "script_lexer.l" -{ script2lval.vr = ATTR_VR_ST; return VR; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 146 "script_lexer.l" -{ script2lval.vr = ATTR_VR_TM; return VR; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 147 "script_lexer.l" -{ script2lval.vr = ATTR_VR_UI; return VR; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 148 "script_lexer.l" -{ script2lval.vr = ATTR_VR_UL; return VR; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 149 "script_lexer.l" -{ script2lval.vr = ATTR_VR_UN; return VR; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 150 "script_lexer.l" -{ script2lval.vr = ATTR_VR_UR; return VR; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 151 "script_lexer.l" -{ script2lval.vr = ATTR_VR_US; return VR; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 152 "script_lexer.l" -{ script2lval.vr = ATTR_VR_UT; return VR; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 154 "script_lexer.l" -{ return T_SEND; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 156 "script_lexer.l" -{ return T_RESET; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 157 "script_lexer.l" -{ return T_CREATE; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 158 "script_lexer.l" -{ return T_SET; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 159 "script_lexer.l" -{ return T_COMPARE; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 160 "script_lexer.l" -{ return T_COMPARE_NOT; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 161 "script_lexer.l" -{ return T_COPY; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 162 "script_lexer.l" -{ return T_DELETE; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 164 "script_lexer.l" -{ return T_READ; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 165 "script_lexer.l" -{ return T_WRITE; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 167 "script_lexer.l" -{ return T_SYSTEM; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 168 "script_lexer.l" -{ return T_TIME; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 169 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 170 "script_lexer.l" -{ return T_DISPLAY; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 171 "script_lexer.l" -{ return T_ECHO; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 172 "script_lexer.l" -{ return T_ROLE; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 173 "script_lexer.l" -{ return T_CONFIRM; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 174 "script_lexer.l" -{ return T_DELAY; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 176 "script_lexer.l" -{ return T_APPL_ENTITY; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 177 "script_lexer.l" -{ return T_ADD_GROUP_LENGTH; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 178 "script_lexer.l" -{ return T_DEF_SQ_LENGTH; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 179 "script_lexer.l" -{ return T_POPULATE; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 180 "script_lexer.l" -{ return T_STRICT; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 181 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 182 "script_lexer.l" -{ return T_VALIDATION; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 183 "script_lexer.l" -{ script2lval.validationFlag = ALL; return VALIDATIONFLAG; } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 184 "script_lexer.l" -{ script2lval.validationFlag = USE_DEFINITION; return VALIDATIONFLAG; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 185 "script_lexer.l" -{ script2lval.validationFlag = USE_VR; return VALIDATIONFLAG; } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 186 "script_lexer.l" -{ script2lval.validationFlag = USE_REFERENCE; return VALIDATIONFLAG; } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 187 "script_lexer.l" -{ script2lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_VR); return VALIDATIONFLAG; } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 188 "script_lexer.l" -{ script2lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 189 "script_lexer.l" -{ script2lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_VR | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 190 "script_lexer.l" -{ script2lval.validationFlag = NONE; return VALIDATIONFLAG; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 192 "script_lexer.l" -{ return T_LANGUAGE; } - YY_BREAK -/* - * The LANGUAGE token is introduced to enable backward compatibility with - * VTS and ADVT - * Currently the ADVT language is fully supported by the parser - * To avoid conflicts and to have a more consistent language for DVT - * this language section has been introduced. Here some mappings between VTS - * language tokens and DVT language tokens are provided. - */ -case 78: -YY_RULE_SETUP -#line 202 "script_lexer.l" -{ - /* - * The VTS VALIDATE command is mapped on the DVT RECEIVE Command - */ - if (script2IsNativeVts) - { - return T_RECEIVE; - } - else - { - return T_VALIDATE; - } - } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 215 "script_lexer.l" -{ - /* - * The VTS VALDIMSE command is mapped on the DVT VALIDATE Command - */ - if (script2IsNativeVts) - { - return T_VALIDATE; - } - else - { - /* VALDIMSE is not part of the DVT language anymore */ - script2error("\"VALDIMSE\" is not a DVT script2 command. Use \"VALIDATE\" "); - } - } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 230 "script_lexer.l" -{ - /* - * The VTS RECEIVE command is mapped on the DVT IMPORT Command - */ - if (script2IsNativeVts) - { - return T_IMPORT; - } - else - { - return T_RECEIVE; - } - } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 244 "script_lexer.l" -{ - /* - * The VTS EXECUTE command is mapped on the DVT EXPORT Command - */ - if (script2IsNativeVts) - { - return T_EXPORT; - } - else - { - /* EXECUTE is not part of the DVT language anymore */ - script2error("\"EXECUTE\" is not a DVT script2 command. Use \"EXPORT\" "); - } - } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 259 "script_lexer.l" -{ - return T_IMPORT; - } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 263 "script_lexer.l" -{ - return T_EXPORT; - } - YY_BREAK -case 84: -#line 268 "script_lexer.l" -case 85: -YY_RULE_SETUP -#line 268 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CECHO_RQ; return COMMANDFIELD; } - YY_BREAK -case 86: -#line 270 "script_lexer.l" -case 87: -YY_RULE_SETUP -#line 270 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CECHO_RSP; return COMMANDFIELD; } - YY_BREAK -case 88: -#line 272 "script_lexer.l" -case 89: -YY_RULE_SETUP -#line 272 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CFIND_RQ; return COMMANDFIELD; } - YY_BREAK -case 90: -#line 274 "script_lexer.l" -case 91: -YY_RULE_SETUP -#line 274 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CFIND_RSP; return COMMANDFIELD; } - YY_BREAK -case 92: -#line 276 "script_lexer.l" -case 93: -YY_RULE_SETUP -#line 276 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 94: -#line 278 "script_lexer.l" -case 95: -YY_RULE_SETUP -#line 278 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 96: -#line 280 "script_lexer.l" -case 97: -YY_RULE_SETUP -#line 280 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CMOVE_RQ; return COMMANDFIELD; } - YY_BREAK -case 98: -#line 282 "script_lexer.l" -case 99: -YY_RULE_SETUP -#line 282 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CMOVE_RSP; return COMMANDFIELD; } - YY_BREAK -case 100: -#line 284 "script_lexer.l" -case 101: -YY_RULE_SETUP -#line 284 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CSTORE_RQ; return COMMANDFIELD; } - YY_BREAK -case 102: -#line 286 "script_lexer.l" -case 103: -YY_RULE_SETUP -#line 286 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CSTORE_RSP; return COMMANDFIELD; } - YY_BREAK -case 104: -#line 288 "script_lexer.l" -case 105: -YY_RULE_SETUP -#line 288 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_CCANCEL_RQ; return COMMANDFIELD; } - YY_BREAK -case 106: -#line 290 "script_lexer.l" -case 107: -YY_RULE_SETUP -#line 290 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NACTION_RQ; return COMMANDFIELD; } - YY_BREAK -case 108: -#line 292 "script_lexer.l" -case 109: -YY_RULE_SETUP -#line 292 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NACTION_RSP; return COMMANDFIELD; } - YY_BREAK -case 110: -#line 294 "script_lexer.l" -case 111: -YY_RULE_SETUP -#line 294 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NCREATE_RQ; return COMMANDFIELD; } - YY_BREAK -case 112: -#line 296 "script_lexer.l" -case 113: -YY_RULE_SETUP -#line 296 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NCREATE_RSP; return COMMANDFIELD; } - YY_BREAK -case 114: -#line 298 "script_lexer.l" -case 115: -YY_RULE_SETUP -#line 298 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NDELETE_RQ; return COMMANDFIELD; } - YY_BREAK -case 116: -#line 300 "script_lexer.l" -case 117: -YY_RULE_SETUP -#line 300 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NDELETE_RSP; return COMMANDFIELD; } - YY_BREAK -case 118: -#line 302 "script_lexer.l" -case 119: -YY_RULE_SETUP -#line 302 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NEVENTREPORT_RQ; return COMMANDFIELD; } - YY_BREAK -case 120: -#line 304 "script_lexer.l" -case 121: -YY_RULE_SETUP -#line 304 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NEVENTREPORT_RSP; return COMMANDFIELD; } - YY_BREAK -case 122: -#line 306 "script_lexer.l" -case 123: -YY_RULE_SETUP -#line 306 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 124: -#line 308 "script_lexer.l" -case 125: -YY_RULE_SETUP -#line 308 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 126: -#line 310 "script_lexer.l" -case 127: -YY_RULE_SETUP -#line 310 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NSET_RQ; return COMMANDFIELD; } - YY_BREAK -case 128: -#line 312 "script_lexer.l" -case 129: -YY_RULE_SETUP -#line 312 "script_lexer.l" -{ script2lval.commandField = DIMSE_CMD_NSET_RSP; return COMMANDFIELD; } - YY_BREAK -case 130: -#line 315 "script_lexer.l" -case 131: -YY_RULE_SETUP -#line 315 "script_lexer.l" -{ return T_ASSOCIATE_RQ; } - YY_BREAK -case 132: -#line 317 "script_lexer.l" -case 133: -YY_RULE_SETUP -#line 317 "script_lexer.l" -{ return T_ASSOCIATE_AC; } - YY_BREAK -case 134: -#line 319 "script_lexer.l" -case 135: -YY_RULE_SETUP -#line 319 "script_lexer.l" -{ return T_ASSOCIATE_RJ; } - YY_BREAK -case 136: -#line 321 "script_lexer.l" -case 137: -YY_RULE_SETUP -#line 321 "script_lexer.l" -{ return T_RELEASE_RQ; } - YY_BREAK -case 138: -#line 323 "script_lexer.l" -case 139: -YY_RULE_SETUP -#line 323 "script_lexer.l" -{ return T_RELEASE_RP; } - YY_BREAK -case 140: -#line 325 "script_lexer.l" -case 141: -YY_RULE_SETUP -#line 325 "script_lexer.l" -{ return T_ABORT_RQ; } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 327 "script_lexer.l" -{ return T_ALL; } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 328 "script_lexer.l" -{ return T_WAREHOUSE; } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 329 "script_lexer.l" -{ return T_ASSOCIATION; } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 330 "script_lexer.l" -{ return T_RELATION; } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 331 "script_lexer.l" -{ return T_EXECUTION_CONTEXT; } - YY_BREAK -case 147: -#line 334 "script_lexer.l" -case 148: -YY_RULE_SETUP -#line 334 "script_lexer.l" -{ return T_PROT_VER; } - YY_BREAK -case 149: -#line 336 "script_lexer.l" -case 150: -YY_RULE_SETUP -#line 336 "script_lexer.l" -{ return T_CALLED_AE; } - YY_BREAK -case 151: -#line 338 "script_lexer.l" -case 152: -YY_RULE_SETUP -#line 338 "script_lexer.l" -{ return T_CALLING_AE; } - YY_BREAK -case 153: -#line 340 "script_lexer.l" -case 154: -YY_RULE_SETUP -#line 340 "script_lexer.l" -{ return T_APPL_CTX; } - YY_BREAK -case 155: -#line 342 "script_lexer.l" -case 156: -#line 343 "script_lexer.l" -case 157: -YY_RULE_SETUP -#line 343 "script_lexer.l" -{ return T_PRES_CTX; } - YY_BREAK -case 158: -#line 345 "script_lexer.l" -case 159: -YY_RULE_SETUP -#line 345 "script_lexer.l" -{ return T_MAX_LEN; } - YY_BREAK -case 160: -#line 347 "script_lexer.l" -case 161: -YY_RULE_SETUP -#line 347 "script_lexer.l" -{ return T_IMPL_CLASS; } - YY_BREAK -case 162: -#line 349 "script_lexer.l" -case 163: -YY_RULE_SETUP -#line 349 "script_lexer.l" -{ return T_IMPL_VER; } - YY_BREAK -case 164: -YY_RULE_SETUP -#line 350 "script_lexer.l" -{ return T_SOP_EXTEND_NEG; } - YY_BREAK -case 165: -YY_RULE_SETUP -#line 351 "script_lexer.l" -{ return T_SCPSCU_ROLE; } - YY_BREAK -case 166: -YY_RULE_SETUP -#line 352 "script_lexer.l" -{ return T_ASYNC_WINDOW; } - YY_BREAK -case 167: -YY_RULE_SETUP -#line 353 "script_lexer.l" -{ return T_USER_ID_NEG; } - YY_BREAK -case 168: -YY_RULE_SETUP -#line 354 "script_lexer.l" -{ return T_RESULT; } - YY_BREAK -case 169: -YY_RULE_SETUP -#line 355 "script_lexer.l" -{ return T_SOURCE; } - YY_BREAK -case 170: -#line 357 "script_lexer.l" -case 171: -YY_RULE_SETUP -#line 357 "script_lexer.l" -{ return T_REASON; } - YY_BREAK -case 172: -#line 360 "script_lexer.l" -case 173: -YY_RULE_SETUP -#line 360 "script_lexer.l" -{ return T_FILEHEAD; } - YY_BREAK -case 174: -#line 362 "script_lexer.l" -case 175: -YY_RULE_SETUP -#line 362 "script_lexer.l" -{ return T_FILETAIL; } - YY_BREAK -case 176: -YY_RULE_SETUP -#line 364 "script_lexer.l" -{ return T_FILE_PREAMBLE; } - YY_BREAK -case 177: -YY_RULE_SETUP -#line 365 "script_lexer.l" -{ return T_DICOM_PREFIX; } - YY_BREAK -case 178: -#line 367 "script_lexer.l" -case 179: -YY_RULE_SETUP -#line 367 "script_lexer.l" -{ return T_TRANSFER_SYNTAX; } - YY_BREAK -case 180: -#line 369 "script_lexer.l" -case 181: -YY_RULE_SETUP -#line 369 "script_lexer.l" -{ return T_SECTOR_SIZE; } - YY_BREAK -case 182: -#line 371 "script_lexer.l" -case 183: -YY_RULE_SETUP -#line 371 "script_lexer.l" -{ return T_DATASET_TRAILING_PADDING; } - YY_BREAK -case 184: -#line 373 "script_lexer.l" -case 185: -YY_RULE_SETUP -#line 373 "script_lexer.l" -{ return T_PADDING_VALUE; } - YY_BREAK -case 186: -YY_RULE_SETUP -#line 375 "script_lexer.l" -{ return T_AUTOSET; } - YY_BREAK -case 187: -#line 377 "script_lexer.l" -case 188: -YY_RULE_SETUP -#line 377 "script_lexer.l" -{ return T_DEFINED_LENGTH; } - YY_BREAK -case 189: -YY_RULE_SETUP -#line 379 "script_lexer.l" -{ return T_NO; } - YY_BREAK -case 190: -YY_RULE_SETUP -#line 380 "script_lexer.l" -{ return T_YES; } - YY_BREAK -case 191: -YY_RULE_SETUP -#line 382 "script_lexer.l" -{ return T_OFF; } - YY_BREAK -case 192: -YY_RULE_SETUP -#line 383 "script_lexer.l" -{ return T_ON; } - YY_BREAK -case 193: -YY_RULE_SETUP -#line 385 "script_lexer.l" -{ return T_AND; } - YY_BREAK -case 194: -YY_RULE_SETUP -#line 386 "script_lexer.l" -{ return T_OR; } - YY_BREAK -case 195: -YY_RULE_SETUP -#line 388 "script_lexer.l" -{ script2lval.iomLevel = IOM_PATIENT; return IOMLEVEL; } - YY_BREAK -case 196: -YY_RULE_SETUP -#line 389 "script_lexer.l" -{ script2lval.iomLevel = IOM_STUDY; return IOMLEVEL; } - YY_BREAK -case 197: -YY_RULE_SETUP -#line 390 "script_lexer.l" -{ script2lval.iomLevel = IOM_SERIES; return IOMLEVEL; } - YY_BREAK -case 198: -YY_RULE_SETUP -#line 391 "script_lexer.l" -{ script2lval.iomLevel = IOM_IMAGE; return IOMLEVEL; } - YY_BREAK -case 199: -#line 394 "script_lexer.l" -case 200: -YY_RULE_SETUP -#line 394 "script_lexer.l" -{ script2lval.userProvider = UP_ACCEPTOR; return USERPROVIDER; } - YY_BREAK -case 201: -#line 396 "script_lexer.l" -case 202: -YY_RULE_SETUP -#line 396 "script_lexer.l" -{ script2lval.userProvider = UP_REQUESTOR; return USERPROVIDER; } - YY_BREAK -case 203: -#line 399 "script_lexer.l" -case 204: -YY_RULE_SETUP -#line 399 "script_lexer.l" -{ script2lval.hex = strtoul(script2text, &pEnd, 16); return HEXADECIMAL; } - YY_BREAK -case 205: -#line 402 "script_lexer.l" -case 206: -YY_RULE_SETUP -#line 402 "script_lexer.l" -{ script2lval.integer = atoi(script2text); return INTEGER; } - YY_BREAK -case 207: -YY_RULE_SETUP -#line 404 "script_lexer.l" -{ strncpy(script2lval.identifier, script2text, sizeof(script2lval.identifier)); return IDENTIFIER; } - YY_BREAK -case 208: -YY_RULE_SETUP -#line 406 "script_lexer.l" -{ for (script2leng = script2leng-2; script2leng >= 0; script2leng--) - /* concatenate line */ - unput(script2text[script2leng]); - } - YY_BREAK -case 209: -YY_RULE_SETUP -#line 411 "script_lexer.l" -{ int i = 1, j = 0; - - script2lval.string_ptr = (char*) malloc(script2leng+1); - if (script2lval.string_ptr == NULL) - { - char message[128]; - sprintf(message, "STRING of %d chars too long for parser - string truncated!", - script2leng-2); - script2error(message); - - script2lval.string_ptr = (char*) malloc(MAX_STRING_LEN); - - script2leng = MAX_STRING_LEN - 1; - } - - while (i < (script2leng-1)) - { - script2lval.string_ptr[j++] = script2text[i++]; - } - - script2lval.string_ptr[j] = NULLCHAR; - return STRING; - } - YY_BREAK -case 210: -YY_RULE_SETUP -#line 435 "script_lexer.l" -{ return script2text[0]; } - YY_BREAK -case 211: -YY_RULE_SETUP -#line 436 "script_lexer.l" -ECHO; - YY_BREAK - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - script2text_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed script2in at a new source and called - * script2lex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = script2in; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = script2text_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = script2text_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( script2wrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * script2text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = script2text_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - script2text_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = script2text_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = script2text_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of script2lex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = script2text_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - script2text_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - script2text_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - script2restart( script2in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - script2text_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = script2text_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - yy_is_jam = (yy_current_state == 1201); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void script2unput( int c, register char *yy_bp ) -#else -static void script2unput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up script2text */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --script2lineno; - - script2text_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int script2input() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - script2text_ptr = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - if ( script2wrap() ) - { - yy_c_buf_p = - script2text_ptr + YY_MORE_ADJ; - return EOF; - } - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return script2input(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = script2text_ptr + YY_MORE_ADJ; - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in script2input()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve script2text */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++script2lineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void script2restart( FILE *input_file ) -#else -void script2restart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = script2_create_buffer( script2in, YY_BUF_SIZE ); - - script2_init_buffer( yy_current_buffer, input_file ); - script2_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void script2_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void script2_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - script2_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (script2wrap()) processing, but the only time this flag - * is looked at is after script2wrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void script2_load_buffer_state( void ) -#else -void script2_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - script2text_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - script2in = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script2_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE script2_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script2_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in script2_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - script2_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void script2_delete_buffer( YY_BUFFER_STATE b ) -#else -void script2_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void script2_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void script2_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - script2_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void script2_flush_buffer( YY_BUFFER_STATE b ) -#else -void script2_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - script2_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script2_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE script2_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script2_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - script2_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script2_scan_string( yyconst char *str ) -#else -YY_BUFFER_STATE script2_scan_string( str ) -yyconst char *str; -#endif - { - int len; - for ( len = 0; str[len]; ++len ) - ; - - return script2_scan_bytes( str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script2_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE script2_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in script2_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = script2_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in script2_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up script2text. */ \ - script2text[script2leng] = yy_hold_char; \ - yy_c_buf_p = script2text + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - script2leng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef script2text_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - script2lex(); - return 0; - } -#endif -#line 436 "script_lexer.l" - - -//>>=========================================================================== - -void script2error(char *errmsg) - -// DESCRIPTION : YACC/LEX error function called when parsing of the -// DICOMScript fails. -// PRECONDITIONS : -// POSTCONDITIONS : -// EXCEPTIONS : -// NOTES : -//<<=========================================================================== -{ - LOG_CLASS* logger_ptr = script2Session_ptr->getLogger(); - - logger_ptr->text(LOG_ERROR, 1, - "%s - parsing Test Script; line %ld of %s", VAL_PREFIX_FAILED, - script2CurrentFileOffset + (script2lineno - script2CurrentLineNo), - script2CurrentFilename); - logger_ptr->text( LOG_ERROR, 1, "%s - around token : \"%s\"", errmsg, script2text); - -} - - diff --git a/DVTk_Library/Libraries/Scripting/script2_parser.cpp b/DVTk_Library/Libraries/Scripting/script2_parser.cpp deleted file mode 100644 index 55e78f5..0000000 --- a/DVTk_Library/Libraries/Scripting/script2_parser.cpp +++ /dev/null @@ -1,5647 +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 script2error(char*); -extern int script2lex(void); -extern int script2lineno; - -extern SCRIPT_SESSION_CLASS *script2Session_ptr; - -typedef enum -{ - OPERAND_OR, - OPERAND_AND -} OPERAND_ENUM; - - -bool script2IsNativeVts = false; -char script2CurrentFilename[_MAX_PATH] = {" (not defined) "}; -long script2CurrentFileOffset = 0; -long script2CurrentLineNo = 0; -bool script2ParseOnly = 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 script2s!!! -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 script2r1[] = { 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 script2r2[] = { 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 script2defact[] = { 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 script2defgoto[] = { 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 script2pact[] = { 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 script2pgoto[] = {-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 script2errok (yyerrstatus = 0) -#define script2clearin (script2char = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto script2errlab1 -/* Like YYERROR except do call script2error. - 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 script2errlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (script2char == YYEMPTY && yylen == 1) \ - { script2char = (token), script2lval = (value); \ - script2char1 = YYTRANSLATE (script2char); \ - YYPOPSTACK; \ - goto script2backup; \ - } \ - else \ - { script2error ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX script2lex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX script2lex(&script2lval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX script2lex(&script2lval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX script2lex(&script2lval, YYLEX_PARAM) -#else -#define YYLEX script2lex(&script2lval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int script2char; /* the lookahead symbol */ -YYSTYPE script2lval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int script2nerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int script2debug; /* 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 script2parse (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 script2parse. 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 -script2parse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL -{ - register int script2state; - register int yyn; - register short *script2ssp; - register YYSTYPE *script2vsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int script2char1 = 0; /* lookahead token as an internal (translated) token number */ - - short script2ssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE script2vsa[YYINITDEPTH]; /* the semantic value stack */ - - short *script2ss = script2ssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *script2vs = script2vsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *script2lsp; - -#define YYPOPSTACK (script2vsp--, script2ssp--, script2lsp--) -#else -#define YYPOPSTACK (script2vsp--, script2ssp--) -#endif - - int script2stacksize = YYINITDEPTH; - -#ifdef YYPURE - int script2char; - YYSTYPE script2lval; - int script2nerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE script2val; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (script2debug) - fprintf(stderr, "Starting parse\n"); -#endif - - script2state = 0; - yyerrstatus = 0; - script2nerrs = 0; - script2char = 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. */ - - script2ssp = script2ss - 1; - script2vsp = script2vs; -#ifdef YYLSP_NEEDED - script2lsp = yyls; -#endif - -/* Push a new state, which is found in script2state . */ -/* 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: - - *++script2ssp = script2state; - - if (script2ssp >= script2ss + script2stacksize - 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 *script2vs1 = script2vs; - short *script2ss1 = script2ss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = script2ssp - script2ss + 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", - &script2ss1, size * sizeof (*script2ssp), - &script2vs1, size * sizeof (*script2vsp), - &yyls1, size * sizeof (*script2lsp), - &script2stacksize); -#else - yyoverflow("parser stack overflow", - &script2ss1, size * sizeof (*script2ssp), - &script2vs1, size * sizeof (*script2vsp), - &script2stacksize); -#endif - - script2ss = script2ss1; script2vs = script2vs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (script2stacksize >= YYMAXDEPTH) - { - script2error("parser stack overflow"); - return 2; - } - script2stacksize *= 2; - if (script2stacksize > YYMAXDEPTH) - script2stacksize = YYMAXDEPTH; - script2ss = (short *) alloca (script2stacksize * sizeof (*script2ssp)); - __yy_memcpy ((char *)script2ss1, (char *)script2ss, size * sizeof (*script2ssp)); - script2vs = (YYSTYPE *) alloca (script2stacksize * sizeof (*script2vsp)); - __yy_memcpy ((char *)script2vs1, (char *)script2vs, size * sizeof (*script2vsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (script2stacksize * sizeof (*script2lsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*script2lsp)); -#endif -#endif /* no yyoverflow */ - - script2ssp = script2ss + size - 1; - script2vsp = script2vs + size - 1; -#ifdef YYLSP_NEEDED - script2lsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (script2debug) - fprintf(stderr, "Stack size increased to %d\n", script2stacksize); -#endif - - if (script2ssp >= script2ss + script2stacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (script2debug) - fprintf(stderr, "Entering state %d\n", script2state); -#endif - - goto script2backup; - script2backup: - -/* 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 = script2pact[script2state]; - if (yyn == YYFLAG) - goto script2default; - - /* Not known => get a lookahead token if don't already have one. */ - - /* script2char is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (script2char == YYEMPTY) - { -#if YYDEBUG != 0 - if (script2debug) - fprintf(stderr, "Reading a token: "); -#endif - script2char = YYLEX; - } - - /* Convert token to internal form (in script2char1) for indexing tables with */ - - if (script2char <= 0) /* This means end of input. */ - { - script2char1 = 0; - script2char = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (script2debug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - script2char1 = YYTRANSLATE(script2char); - -#if YYDEBUG != 0 - if (script2debug) - { - fprintf (stderr, "Next token is %d (%s", script2char, yytname[script2char1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, script2char, script2lval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += script2char1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != script2char1) - goto script2default; - - 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 script2errlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto script2errlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (script2debug) - fprintf(stderr, "Shifting token %d (%s), ", script2char, yytname[script2char1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (script2char != YYEOF) - script2char = YYEMPTY; - - *++script2vsp = script2lval; -#ifdef YYLSP_NEEDED - *++script2lsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - script2state = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -script2default: - - yyn = script2defact[script2state]; - if (yyn == 0) - goto script2errlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = script2r2[yyn]; - if (yylen > 0) - script2val = script2vsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (script2debug) - { - 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[script2r1[yyn]]); - } -#endif - - - switch (yyn) { - -case 2: -#line 204 "script_parser.y" -{ - //cleanup - clearVTSUidMappings(); - ; - break;} -case 3: -#line 211 "script_parser.y" -{ - if (script2Session_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 4: -#line 218 "script_parser.y" -{ - if (script2Session_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 33: -#line 257 "script_parser.y" -{ - if (strcmp(script2vsp[0].string_ptr, "NATIVE_VTS") == 0) - { - script2IsNativeVts = true; - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[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 = script2Session_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(); - script2Session_ptr->resetAssociation(); - - // cleanup any outstanding relationships - // - from previous emulations / script2 executions - RELATIONSHIP->cleanup(); - - // reset the script2 execution context - script2Session_ptr->resetScriptExecutionContext(); - ; - break;} -case 35: -#line 295 "script_parser.y" -{ - // data warehouse should be emptied - LOG_CLASS *logger_ptr = script2Session_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 = script2Session_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."); - } - script2Session_ptr->resetAssociation(); - ; - break;} -case 37: -#line 322 "script_parser.y" -{ - // relation reset - // - backwards compatibility with VTS - LOG_CLASS *logger_ptr = script2Session_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 / script2 executions - RELATIONSHIP->cleanup(); - ; - break;} -case 38: -#line 339 "script_parser.y" -{ - // script2 execution context reset - LOG_CLASS *logger_ptr = script2Session_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 script2 execution context - script2Session_ptr->resetScriptExecutionContext(); - ; - break;} -case 39: -#line 356 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_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 (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_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 (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - BASE_CONFIRMER *confirmer_ptr = script2Session_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 434 "script_parser.y" -{ - if (!script2ParseOnly) - { - if ((wid1_ptr) && - (wid2_ptr)) - { - // copy the attribute in object 1 to that in object 2 - // - don't stop on returned error - copyAttribute(script2Session_ptr->getLogger(), wid1_ptr, group1, element1, wid2_ptr, group2, element2); - } - } - ; - break;} -case 44: -#line 452 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - // delay for given number of seconds - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DELAY %d seconds", script2vsp[0].integer); - } - - for (int sec = 0; sec < script2vsp[0].integer; sec++) - { - if (script2Session_ptr->isSessionStopped()) - { - YYACCEPT; - } -#ifdef _WINDOWS - Sleep(1000); -#else - sleep(1); -#endif - } - } - ; - break;} -case 47: -#line 484 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (wid1_ptr) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY object"); - } - - // display the referenced warehouse object - wid1_ptr->setLogger(script2Session_ptr->getLogger()); - - BASE_SERIALIZER *serializer_ptr = script2Session_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 (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY WAREHOUSE"); - } - WAREHOUSE->serialize(script2Session_ptr->getLogger()); - } - ; - break;} -case 49: -#line 575 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - // display string to user - logger_ptr->text(LOG_SCRIPT, 1, script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - - ; - break;} -case 53: -#line 602 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!sendAcse(script2Session_ptr, associateRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 54: -#line 609 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!sendAcse(script2Session_ptr, associateAc_ptr, identifier)) YYABORT; - } - ; - break;} -case 55: -#line 616 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!sendAcse(script2Session_ptr, associateRj_ptr, identifier)) YYABORT; - } - ; - break;} -case 56: -#line 623 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!sendAcse(script2Session_ptr, releaseRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 57: -#line 630 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!sendAcse(script2Session_ptr, releaseRp_ptr, identifier)) YYABORT; - } - ; - break;} -case 58: -#line 637 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!sendAcse(script2Session_ptr, abortRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 59: -#line 646 "script_parser.y" -{ - if (!script2ParseOnly) - { - /* Try to find the command object in the warehouse and send it */ - LOG_CLASS* logger_ptr = script2Session_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 (script2IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - resolveVTSUidMappings(cmd_ptr); - } - - if (!sendSop(script2Session_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 (!script2ParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = script2Session_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 (script2IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(script2Session_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 61: -#line 729 "script_parser.y" -{ - if (!script2ParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = script2Session_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 (script2IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(script2Session_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 63: -#line 786 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!importCommand(script2Session_ptr, commandField, identifier)) - { - YYABORT; - } - } - ; - break;} -case 64: -#line 796 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!importCommandDataset(script2Session_ptr, commandField, identifier, iodName, datasetidentifier)) - { - YYABORT; - } - } - ; - break;} -case 65: -#line 808 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setPopulateWithAttributes(true); - } - } - ; - break;} -case 66: -#line 825 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setPopulateWithAttributes(false); - } - } - ; - break;} -case 69: -#line 850 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - // set product role based on new setting for tool - if (script2vsp[0].userProvider == UP_REQUESTOR) - { - // tool role is now Requestor - // - product is therefore Acceptor - script2Session_ptr->setProductRoleIsRequestor(false); - script2Session_ptr->setProductRoleIsAcceptor(true); - } - else - { - // tool role is now Acceptor - // - product is therefore Requestor - script2Session_ptr->setProductRoleIsRequestor(true); - script2Session_ptr->setProductRoleIsAcceptor(false); - } - - if (logger_ptr) - { - if (script2vsp[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 (!script2ParseOnly) - { - // make system call within session - if (!systemCall(script2Session_ptr, script2vsp[0].string_ptr)) - { - YYABORT; - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 73: -#line 909 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_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 (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE ON"); - } - - // ignore command in debug mode - if (script2Session_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE ON"); - } - } - else - { - // enable the logger -// script2Session_ptr->enableLogger(); - - // resume the serializer -// BASE_SERIALIZER *serializer_ptr = script2Session_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Resume(); -// } - } - } - ; - break;} -case 76: -#line 973 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE OFF"); - } - - // ignore command in debug mode - if (script2Session_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE OFF"); - } - } - else - { - // disable the logger -// script2Session_ptr->disableLogger(); - - // pause the serializer -// BASE_SERIALIZER *serializer_ptr = script2Session_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Pause(); -// } - } - } - ; - break;} -case 78: -#line 1010 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "APPLICATION-ENTITY %s %s", script2vsp[-1].string_ptr, script2vsp[0].string_ptr); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setApplicationEntityName(script2vsp[-1].string_ptr); - script2ExecutionContext_ptr->setApplicationEntityVersion(script2vsp[0].string_ptr); - } - } - // free malloced string buffers - free(script2vsp[-1].string_ptr); - script2vsp[-1].string_ptr = NULL; - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - - ; - break;} -case 79: -#line 1036 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - switch(script2vsp[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 (script2vsp[0].validationFlag == (USE_DEFINITION | USE_VR)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-VR"); - else if (script2vsp[0].validationFlag == (USE_DEFINITION | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-REF"); - else if (script2vsp[0].validationFlag == (USE_VR | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-VR-AND-REF"); - break; - } - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setValidationFlag(script2vsp[0].validationFlag); - } - } - ; - break;} -case 80: -#line 1067 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setDefineSqLength(true); - } - } - ; - break;} -case 81: -#line 1084 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setDefineSqLength(false); - } - } - ; - break;} -case 82: -#line 1103 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setAddGroupLength(true); - } - } - ; - break;} -case 83: -#line 1120 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setAddGroupLength(false); - } - } - ; - break;} -case 84: -#line 1139 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setStrictValidation(true); - } - } - ; - break;} -case 85: -#line 1156 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script2ExecutionContext_ptr = script2Session_ptr->getScriptExecutionContext(); - if (script2ExecutionContext_ptr) - { - script2ExecutionContext_ptr->setStrictValidation(false); - } - } - ; - break;} -case 86: -#line 1175 "script_parser.y" -{ - if (!script2ParseOnly) - { - 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(script2Session_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 87: -#line 1214 "script_parser.y" -{ - if (!script2ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script2Session_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(script2Session_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) YYABORT; - } - - if (dataset_ptr) - { - if (!command_ptr) - { - compareDatasetValueWithWarehouse(script2Session_ptr->getLogger(), (char*)(iodName).c_str(), dataset_ptr); - } - - if (!storeObjectInWarehouse(script2Session_ptr->getLogger(), dataset_ptr->getIdentifier(), dataset_ptr)) - { - YYABORT; - } - else - { - LOG_CLASS *logger_ptr = script2Session_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 (!script2ParseOnly) - { - 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 = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // clean up - side effect of parser - delete dataset_ptr; - dataset_ptr = NULL; - - if (!storeObjectInWarehouse(script2Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 89: -#line 1290 "script_parser.y" -{ - if (!script2ParseOnly) - { - 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(script2Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 90: -#line 1311 "script_parser.y" -{ - if (!script2ParseOnly) - { - 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(script2Session_ptr->getLogger()); - - // use the item handle - if (item_handle_ptr->resolveReference() != NULL) - { - if (!storeObjectInWarehouse(script2Session_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 (!script2ParseOnly) - { - if (fileHead_ptr) - { - if (!storeObjectInWarehouse(script2Session_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 92: -#line 1358 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (fileTail_ptr) - { - if (!storeObjectInWarehouse(script2Session_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 93: -#line 1370 "script_parser.y" -{ - if (!script2ParseOnly) - { - 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(script2Session_ptr->getLogger(), identifier.c_str(), wid)) YYABORT; - } - ; - break;} -case 94: -#line 1419 "script_parser.y" -{ - if (!script2ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script2Session_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command delete - serializer_ptr->SerializeDSDeleteCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!removeObjectFromWarehouse(script2Session_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 (!script2ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script2Session_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(script2Session_ptr->getLogger(), datasetidentifier.c_str(), WID_DATASET)) - { - // then try deleting as an item - leave explicit WID_ITEM in call - if (!removeObjectFromWarehouse(script2Session_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 (!script2ParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(script2Session_ptr->getLogger(), identifier.c_str(), WID_FILEHEAD)) YYABORT; - } - ; - break;} -case 97: -#line 1471 "script_parser.y" -{ - if (!script2ParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(script2Session_ptr->getLogger(), identifier.c_str(), WID_FILETAIL)) YYABORT; - } - ; - break;} -case 98: -#line 1482 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(script2Session_ptr->getLogger(), script2Session_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 99: -#line 1493 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(script2Session_ptr->getLogger(), script2Session_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 100: -#line 1506 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!readFileDataset(script2Session_ptr, script2vsp[-1].string_ptr, dataset_ptr)) YYABORT; - } - // free malloced string buffer - free(script2vsp[-1].string_ptr); - script2vsp[-1].string_ptr = NULL; - - ; - break;} -case 101: -#line 1517 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!readFileDataset(script2Session_ptr, script2vsp[-1].string_ptr, script2vsp[0].hex)) YYABORT; - } - // free malloced string buffer - free(script2vsp[-1].string_ptr); - script2vsp[-1].string_ptr = NULL; - ; - break;} -case 102: -#line 1529 "script_parser.y" -{ - if (!script2ParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!receiveAcse(script2Session_ptr, associateRq_ptr, identifier)) - { - clearValidationObjects(script2Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!receiveAcse(script2Session_ptr, associateAc_ptr, identifier)) - { - clearValidationObjects(script2Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!receiveAcse(script2Session_ptr, associateRj_ptr, identifier)) - { - clearValidationObjects(script2Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!receiveAcse(script2Session_ptr, releaseRq_ptr, identifier)) - { - clearValidationObjects(script2Session_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!receiveAcse(script2Session_ptr, releaseRp_ptr, identifier)) - { - clearValidationObjects(script2Session_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!receiveAcse(script2Session_ptr, abortRq_ptr, identifier)) - { - clearValidationObjects(script2Session_ptr); - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!receiveAcse(script2Session_ptr, unknownPdu_ptr, identifier)) - { - clearValidationObjects(script2Session_ptr); - YYABORT; - } - - // parser cleanup - delete unknownPdu_ptr; - unknownPdu_ptr = NULL; - break; - default: break; - } - } - ; - break;} -case 103: -#line 1616 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!receiveSop(script2Session_ptr, command_ptr, dataset_ptr)) - { - clearValidationObjects(script2Session_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 (!script2ParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!sendAcse(script2Session_ptr, associateRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!sendAcse(script2Session_ptr, associateAc_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!sendAcse(script2Session_ptr, associateRj_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!sendAcse(script2Session_ptr, releaseRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!sendAcse(script2Session_ptr, releaseRp_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!sendAcse(script2Session_ptr, abortRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!sendAcse(script2Session_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 (!script2ParseOnly) - { - if (!sendSop(script2Session_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 (!script2ParseOnly) - { - // 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(script2Session_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 (!script2ParseOnly) - { - presContextId = (BYTE) script2vsp[-1].hex; - } - ; - break;} -case 108: -#line 1769 "script_parser.y" -{ - if (!script2ParseOnly) - { - presContextId = (BYTE) script2vsp[-1].integer; - } - ; - break;} -case 109: -#line 1778 "script_parser.y" -{ - if (!script2ParseOnly) - { - 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(script2Session_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 110: -#line 1817 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (command_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script2Session_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command set - serializer_ptr->SerializeDSSetCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!updateObjectInWarehouse(script2Session_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) - { - LOG_CLASS *logger_ptr = script2Session_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 (!script2ParseOnly) - { - if (dataset_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script2Session_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(script2Session_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 = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // then try updating as an item - if (!updateObjectInWarehouse(script2Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) - { - LOG_CLASS *logger_ptr = script2Session_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 (!script2ParseOnly) - { - if (fileHead_ptr) - { - if (!updateObjectInWarehouse(script2Session_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 113: -#line 1898 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (fileTail_ptr) - { - if (!updateObjectInWarehouse(script2Session_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 114: -#line 1910 "script_parser.y" -{ - if (!script2ParseOnly) - { - // try to validate the Sop Class - if (!validateSopAgainstList(script2Session_ptr, command_ptr, dataset_ptr)) - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(script2Session_ptr); - YYABORT; - } - else - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(script2Session_ptr); - } - } - ; - break;} -case 115: -#line 1934 "script_parser.y" -{ - if (!script2ParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = script2Session_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 (!script2ParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = script2Session_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 (!script2ParseOnly) - { - addReferenceObjects(script2Session_ptr,ref_command_ptr, ref_dataset_ptr, script2Session_ptr->getLogger()); - } - ; - break;} -case 119: -#line 1994 "script_parser.y" -{ - if (!script2ParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(script2Session_ptr,ref_command_ptr, ref_dataset_ptr, script2Session_ptr->getLogger()); - } - ; - break;} -case 120: -#line 2004 "script_parser.y" -{ - if (!script2ParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = script2Session_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 (!script2ParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = script2Session_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 (!script2ParseOnly) - { - // 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 (!script2ParseOnly) - { - addReferenceObjects(script2Session_ptr, command_ptr, dataset_ptr, script2Session_ptr->getLogger()); - } - ; - break;} -case 124: -#line 2082 "script_parser.y" -{ - if (!script2ParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(script2Session_ptr, command_ptr, dataset_ptr, script2Session_ptr->getLogger()); - } - ; - break;} -case 125: -#line 2090 "script_parser.y" -{ - if (!script2ParseOnly) - { - setLogicalOperand(OPERAND_AND); - addReferenceObjects(script2Session_ptr, command_ptr, dataset_ptr, script2Session_ptr->getLogger()); - } - ; - break;} -case 126: -#line 2100 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!writeFileHead(script2Session_ptr->getLogger(), script2vsp[-1].string_ptr, script2Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script2vsp[-1].string_ptr); - script2vsp[-1].string_ptr = NULL; - ; - break;} -case 127: -#line 2110 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!writeFileTail(script2Session_ptr->getLogger(), script2vsp[-1].string_ptr, script2Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script2vsp[-1].string_ptr); - script2vsp[-1].string_ptr = NULL; - ; - break;} -case 128: -#line 2120 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (!writeFileDataset(script2Session_ptr->getLogger(), script2vsp[-1].string_ptr, dataset_ptr,script2Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script2vsp[-1].string_ptr); - script2vsp[-1].string_ptr = NULL; - ; - break;} -case 142: -#line 2149 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store the user information - associateRq_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 145: -#line 2164 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set associate request protocol version parameter - associateRq_ptr->setProtocolVersion((UINT16) script2vsp[0].integer); - } - ; - break;} -case 146: -#line 2172 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - if (strlen(script2vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", script2vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request called Ae title parameter - associateRq_ptr->setCalledAeTitle((char*) script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 147: -#line 2196 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - if (strlen(script2vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", script2vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request calling Ae title parameter - associateRq_ptr->setCallingAeTitle((char*) script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 148: -#line 2220 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // set associate request application context parameter - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[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*) script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 150: -#line 2245 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) script2vsp[0].integer); - } - ; - break;} -case 151: -#line 2253 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 152: -#line 2277 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) script2vsp[0].string_ptr); - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 155: -#line 2291 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) script2vsp[-1].integer, (UINT16) script2vsp[0].integer); - } - ; - break;} -case 162: -#line 2311 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[-3].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script2vsp[-3].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script2vsp[-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 (!script2ParseOnly) - { - convertHex(script2vsp[-7].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[-7].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script2vsp[-7].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script2vsp[-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) script2vsp[-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 = script2vsp[-5].integer; - int scpRole = script2vsp[-3].integer; - - // check if roles explicitly defined by script2s - 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(script2vsp[-7].string_ptr); - script2vsp[-7].string_ptr = NULL; - ; - break;} -case 164: -#line 2427 "script_parser.y" -{ - if (!script2ParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 165: -#line 2435 "script_parser.y" -{ - if (!script2ParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 166: -#line 2445 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - transferSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - transferSyntaxName.setUid((char*) script2vsp[0].string_ptr); - - // check that we now have a valid transfer syntax - if (!transferSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script2vsp[0].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 169: -#line 2487 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[-3].string_ptr); - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassExtended.setUid((char*) uid.c_str()); - } - else - { - // store given uid - sopClassExtended.setUid((char*) script2vsp[-3].string_ptr); - - // check that we now have a valid transfer syntax - if (!sopClassExtended.isUidValid()) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script2vsp[-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(script2vsp[-3].string_ptr); - script2vsp[-3].string_ptr = NULL; - ; - break;} -case 172: -#line 2533 "script_parser.y" -{ - if (!script2ParseOnly) - { - // handle application info bytes - sopClassExtended.addApplicationInformation((BYTE) script2vsp[0].integer); - } - ; - break;} -case 175: -#line 2547 "script_parser.y" -{ - if (!script2ParseOnly) - { - UID_CLASS sopClassUid; - - convertHex(script2vsp[-5].string_ptr); - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[-5].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassUid.set((char*) uid.c_str()); - } - else - { - // store given uid - sopClassUid.set((char*) script2vsp[-5].string_ptr); - - // check that we now have a valid abstract syntax - if (!sopClassUid.isValid()) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script2vsp[-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) script2vsp[-3].integer); - scpScuRoleSelect.setScuRole((BYTE) script2vsp[-1].integer); - - // store scp scu role select - userInformation.addScpScuRoleSelect(scpScuRoleSelect); - } - // free malloced string buffer - free(script2vsp[-5].string_ptr); - script2vsp[-5].string_ptr = NULL; - ; - break;} -case 176: -#line 2595 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) script2vsp[-2].integer, (BYTE) script2vsp[-1].integer, script2vsp[0].string_ptr); - } - - // free malloced string buffer - free(script2vsp[0].string_ptr); - ; - break;} -case 177: -#line 2606 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) script2vsp[-3].integer, (BYTE) script2vsp[-2].integer, script2vsp[-1].string_ptr, script2vsp[0].string_ptr); - } - - // free malloced string buffer - free(script2vsp[-1].string_ptr); - free(script2vsp[0].string_ptr); - ; - break;} -case 178: -#line 2618 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation(script2vsp[0].string_ptr); - } - - // free malloced string buffer - free(script2vsp[0].string_ptr); - ; - break;} -case 180: -#line 2632 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store the user information - associateAc_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 183: -#line 2647 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set associate accept protocol version parameter - associateAc_ptr->setProtocolVersion((UINT16) script2vsp[0].integer); - } - ; - break;} -case 184: -#line 2655 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - if (strlen(script2vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", script2vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept called Ae title parameter - associateAc_ptr->setCalledAeTitle((char*) script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 185: -#line 2679 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - if (strlen(script2vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", script2vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept calling Ae title parameter - associateAc_ptr->setCallingAeTitle((char*) script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 186: -#line 2703 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // set associate accept application context parameter - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[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*) script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 188: -#line 2728 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) script2vsp[0].integer); - } - ; - break;} -case 189: -#line 2736 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 190: -#line 2760 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) script2vsp[0].string_ptr); - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 193: -#line 2774 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) script2vsp[-1].integer, (UINT16) script2vsp[0].integer); - } - ; - break;} -case 199: -#line 2793 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[-4].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[-4].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script2vsp[-4].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script2vsp[-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) script2vsp[-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(script2vsp[-4].string_ptr); - script2vsp[-4].string_ptr = NULL; - ; - break;} -case 200: -#line 2848 "script_parser.y" -{ - if (!script2ParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 202: -#line 2859 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[-2].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script2Session_ptr->getSopUid((char*) script2vsp[-2].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script2vsp[-2].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script2vsp[-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) script2vsp[-6].integer); - - // store the result - presAcContext.setResultReason((BYTE) script2vsp[-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) script2vsp[-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(script2vsp[-2].string_ptr); - script2vsp[-2].string_ptr = NULL; - ; - break;} -case 203: -#line 2929 "script_parser.y" -{ - if (!script2ParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 204: -#line 2937 "script_parser.y" -{ - if (!script2ParseOnly) - { - assocAcScuScpRolesDefined = false; - int scuRole = script2vsp[-4].integer; - int scpRole = script2vsp[-2].integer; - - // check if roles explicitly defined by script2s - 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 (!script2ParseOnly) - { - // set associate reject result parameter - associateRj_ptr->setResult((BYTE) script2vsp[0].integer); - } - ; - break;} -case 210: -#line 2974 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set associate reject source parameter - associateRj_ptr->setSource((BYTE) script2vsp[0].integer); - } - ; - break;} -case 211: -#line 2982 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set associate reject reason parameter - associateRj_ptr->setReason((BYTE) script2vsp[0].integer); - } - ; - break;} -case 218: -#line 3006 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set abort request source parameter - abortRq_ptr->setSource((BYTE) script2vsp[0].integer); - } - ; - break;} -case 219: -#line 3014 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set abort request reason parameter - abortRq_ptr->setReason((BYTE) script2vsp[0].integer); - } - ; - break;} -case 220: -#line 3024 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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(script2Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script2Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 221: -#line 3049 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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(script2Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_AC; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script2Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 222: -#line 3074 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set up default associate reject details - associateRj_ptr = new ASSOCIATE_RJ_CLASS(); - - // cascade the logger - associateRj_ptr->setLogger(script2Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RJ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script2Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 223: -#line 3094 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set up default release request details - releaseRq_ptr = new RELEASE_RQ_CLASS(); - - // cascade the logger - releaseRq_ptr->setLogger(script2Session_ptr->getLogger()); - - acseType = PDU_RELEASE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script2Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 224: -#line 3114 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set up default release response details - releaseRp_ptr = new RELEASE_RP_CLASS(); - - // cascade the logger - releaseRp_ptr->setLogger(script2Session_ptr->getLogger()); - - acseType = PDU_RELEASE_RP; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script2Session_ptr->getInstanceId()); - identifier = buffer; - - } - ; - break;} -case 225: -#line 3135 "script_parser.y" -{ - if (!script2ParseOnly) - { - // set up default abort request details - abortRq_ptr = new ABORT_RQ_CLASS(); - - // cascade the logger - abortRq_ptr->setLogger(script2Session_ptr->getLogger()); - - acseType = PDU_ABORT_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script2Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 233: -#line 3168 "script_parser.y" -{ - if (!script2ParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField); - - // cascade the logger - command_ptr->setLogger(script2Session_ptr->getLogger()); - dataset_ptr = NULL; - identifier = ""; - } - ; - break;} -case 234: -#line 3181 "script_parser.y" -{ - if (!script2ParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField, identifier); - - // cascade the logger - command_ptr->setLogger(script2Session_ptr->getLogger()); - dataset_ptr = NULL; - } - ; - break;} -case 235: -#line 3195 "script_parser.y" -{ - if (!script2ParseOnly) - { - // save command field locally - commandField = script2lval.commandField; - } - ; - break;} -case 236: -#line 3205 "script_parser.y" -{ - if (!script2ParseOnly) - { - // save identifier locally - identifier = script2lval.identifier; - } - ; - break;} -case 242: -#line 3226 "script_parser.y" -{ - if (!script2ParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName); - - // cascade the logger - dataset_ptr->setLogger(script2Session_ptr->getLogger()); - - bool addGroupLength = script2Session_ptr->getAddGroupLength(); - bool populateWithAttributes = script2Session_ptr->getAutoType2Attributes(); - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - addGroupLength = script2Session_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = script2Session_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = script2Session_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 (!script2ParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName, datasetidentifier); - - bool addGroupLength = script2Session_ptr->getAddGroupLength(); - bool populateWithAttributes = script2Session_ptr->getAutoType2Attributes(); - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - addGroupLength = script2Session_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = script2Session_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = script2Session_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 (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // save iod name locally - // - check first for iod name mapping - iodName = script2Session_ptr->getIodName((char*) script2vsp[0].string_ptr); - if (!iodName.length()) - { - // no name mapping - take iod name directly - iodName = (char*) script2vsp[0].string_ptr; - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 248: -#line 3311 "script_parser.y" -{ - if (!script2ParseOnly) - { - // save identifier locally - datasetidentifier = script2vsp[0].identifier; - } - ; - break;} -case 249: -#line 3319 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // save the identifier locally - datasetidentifier = script2vsp[0].string_ptr; - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 250: -#line 3333 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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 (!script2ParseOnly) - { - // 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 (!script2ParseOnly) - { - // 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(script2Session_ptr->getLogger()); - } - ; - break;} -case 254: -#line 3396 "script_parser.y" -{ - if (!script2ParseOnly) - { - // instantiate a new attribute - attribute_ptr[nd] = new DCM_ATTRIBUTE_CLASS(group, element); - - // cascade the logger - attribute_ptr[nd]->setLogger(script2Session_ptr->getLogger()); - - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - attribute_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 255: -#line 3416 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store tag locally - group = (UINT16) (script2lval.hex >> 16); - element = (UINT16) (script2lval.hex & 0x0000FFFF); - } - ; - break;} -case 258: -#line 3431 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (nd == 0) - { - LOG_CLASS *logger_ptr = script2Session_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 (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_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 = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 260: -#line 3491 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_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 = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 263: -#line 3533 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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(script2Session_ptr->getLogger()); - - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_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(script2Session_ptr->getLogger()); - - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 264: -#line 3576 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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(script2Session_ptr->getLogger()); - - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_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(script2Session_ptr->getLogger()); - - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 265: -#line 3620 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - // store item - identifier - item_ptr[nd]->setIdentifier(script2vsp[0].string_ptr); - item_ptr[nd]->setValueByReference(true); - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 266: -#line 3635 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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(script2Session_ptr->getLogger()); - - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_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(script2Session_ptr->getLogger()); - - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 267: -#line 3673 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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(script2Session_ptr->getLogger()); - - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_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(script2Session_ptr->getLogger()); - - bool definedLength = script2Session_ptr->getDefineSqLength(); - if (script2Session_ptr->getScriptExecutionContext()) - { - definedLength = script2Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 272: -#line 3721 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store item - attribute value - item_ptr[nd]->AddAttribute(attribute_ptr[nd]); - } - ; - break;} -case 274: -#line 3734 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_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", script2lineno); - } - 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", script2lineno); - } - YYABORT; - } - - // store attribute vr - attribute_ptr[nd]->SetVR(vr); - attribute_ptr[nd]->setDefinedLength(false); - } - ; - break;} -case 275: -#line 3767 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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 (!script2ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script2lval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = false; - } - ; - break;} -case 277: -#line 3789 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script2lval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = true; - } - ; - break;} -case 278: -#line 3799 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script2lval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = false; - } - ; - break;} -case 279: -#line 3809 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script2lval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = true; - } - ; - break;} -case 280: -#line 3819 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script2lval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = false; - } - ; - break;} -case 281: -#line 3829 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script2lval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = true; - } - ; - break;} -case 284: -#line 3845 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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 (!script2ParseOnly) - { - // 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 (!script2ParseOnly) - { - // special check for the Image Display Format ID / Pixel Data / FMI version attribute - // - these need to be handled differently for the ADVT script2s - if (((group == 0x2010) && - (element == 0x0010)) || - ((group == 0x7FE0) && - (element == 0x0010)) || - ((group == 0x0002) && - (element == 0x0001))) - { - convertDoubleBackslash(script2vsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(script2Session_ptr, script2vsp[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(script2vsp[0].string_ptr); - } - else - { - convertHex(script2vsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(script2Session_ptr, script2vsp[0].string_ptr, vr, group, element); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 287: -#line 3939 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store hex attribute value locally - value_ptr = hexValue(script2Session_ptr, script2vsp[0].hex, vr, group, element); - } - ; - break;} -case 288: -#line 3947 "script_parser.y" -{ - if (!script2ParseOnly) - { - // store integer attribute value locally - value_ptr = integerValue(script2Session_ptr, script2vsp[0].integer, vr, group, element); - } - ; - break;} -case 289: -#line 3955 "script_parser.y" -{ - if (!script2ParseOnly) - { - // autoset attribute value - value_ptr = autoSetValue(script2Session_ptr, vr, group, element); - } - ; - break;} -case 290: -#line 3964 "script_parser.y" -{ - if (!script2ParseOnly) - { - // copy tag to reference one - group1 = group; - element1 = element; - } - ; - break;} -case 291: -#line 3975 "script_parser.y" -{ - if (!script2ParseOnly) - { - // 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 (!script2ParseOnly) - { - // look up tag by name and get group & element returned - group = 0; - element = 0; - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 294: -#line 4003 "script_parser.y" -{ - if (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid1_ptr = retrieveFromWarehouse(script2Session_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 (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid1_ptr = retrieveFromWarehouse(script2Session_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(script2Session_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(script2Session_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 (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid2_ptr = retrieveFromWarehouse(script2Session_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 (!script2ParseOnly) - { - LOG_CLASS *logger_ptr = script2Session_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid2_ptr = retrieveFromWarehouse(script2Session_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(script2Session_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(script2Session_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 (!script2ParseOnly) - { - // 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 (!script2ParseOnly) - { - // 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 (!script2ParseOnly) - { - // default Item Number is 1 - index is then zero - itemNumber = 0; - } - ; - break;} -case 301: -#line 4175 "script_parser.y" -{ - if (!script2ParseOnly) - { - // take given Item Number - index is one less - itemNumber = script2vsp[-1].integer - 1; - } - ; - break;} -case 304: -#line 4189 "script_parser.y" -{ - if (!script2ParseOnly) - { - fileHead_ptr = new FILEHEAD_CLASS(); - - // cascade the logger - fileHead_ptr->setLogger(script2Session_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 310: -#line 4212 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPreambleValue(script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 311: -#line 4228 "script_parser.y" -{ - if (!script2ParseOnly) - { - convertHex(script2vsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPrefix(script2vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script2vsp[0].string_ptr); - script2vsp[0].string_ptr = NULL; - ; - break;} -case 312: -#line 4244 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (fileHead_ptr) - { - fileHead_ptr->setTransferSyntaxUid(transferSyntaxName.getUid()); - } - } - ; - break;} -case 315: -#line 4260 "script_parser.y" -{ - if (!script2ParseOnly) - { - fileTail_ptr = new FILETAIL_CLASS(); - - // cascade the logger - fileTail_ptr->setLogger(script2Session_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 321: -#line 4283 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(true); - } - } - ; - break;} -case 322: -#line 4293 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(false); - } - } - ; - break;} -case 323: -#line 4305 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setSectorSize(script2vsp[0].integer); - } - } - ; - break;} -case 324: -#line 4317 "script_parser.y" -{ - if (!script2ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setPaddingValue((BYTE)script2vsp[0].integer); - } - } - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "bison.simple" - - script2vsp -= yylen; - script2ssp -= yylen; -#ifdef YYLSP_NEEDED - script2lsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (script2debug) - { - short *ssp1 = script2ss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != script2ssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++script2vsp = script2val; - -#ifdef YYLSP_NEEDED - script2lsp++; - if (yylen == 0) - { - script2lsp->first_line = yylloc.first_line; - script2lsp->first_column = yylloc.first_column; - script2lsp->last_line = (script2lsp-1)->last_line; - script2lsp->last_column = (script2lsp-1)->last_column; - script2lsp->text = 0; - } - else - { - script2lsp->last_line = (script2lsp+yylen-1)->last_line; - script2lsp->last_column = (script2lsp+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 = script2r1[yyn]; - - script2state = script2pgoto[yyn - YYNTBASE] + *script2ssp; - if (script2state >= 0 && script2state <= YYLAST && yycheck[script2state] == *script2ssp) - script2state = yytable[script2state]; - else - script2state = script2defgoto[yyn - YYNTBASE]; - - goto yynewstate; - -script2errlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++script2nerrs; - -#ifdef YYERROR_VERBOSE - yyn = script2pact[script2state]; - - 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++; - } - } - script2error(msg); - free(msg); - } - else - script2error ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - script2error("parse error"); - } - - goto script2errlab1; -script2errlab1: /* 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 (script2char == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (script2debug) - fprintf(stderr, "Discarding token %d (%s).\n", script2char, yytname[script2char1]); -#endif - - script2char = 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 = script2defact[script2state]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto script2default; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (script2ssp == script2ss) YYABORT; - script2vsp--; - script2state = *--script2ssp; -#ifdef YYLSP_NEEDED - script2lsp--; -#endif - -#if YYDEBUG != 0 - if (script2debug) - { - short *ssp1 = script2ss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != script2ssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = script2pact[script2state]; - 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 (script2debug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++script2vsp = script2lval; -#ifdef YYLSP_NEEDED - *++script2lsp = yylloc; -#endif - - script2state = yyn; - goto yynewstate; -} -#line 4327 "script_parser.y" - - diff --git a/DVTk_Library/Libraries/Scripting/script2_parser.cpp.h b/DVTk_Library/Libraries/Scripting/script2_parser.cpp.h deleted file mode 100644 index b514449..0000000 --- a/DVTk_Library/Libraries/Scripting/script2_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 script2lval; diff --git a/DVTk_Library/Libraries/Scripting/script3_lexer.cpp b/DVTk_Library/Libraries/Scripting/script3_lexer.cpp deleted file mode 100644 index 4c6acc1..0000000 --- a/DVTk_Library/Libraries/Scripting/script3_lexer.cpp +++ /dev/null @@ -1,3409 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE script3restart( script3in ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int script3leng; -extern FILE *script3in, *script3out; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up script3text. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up script3text again */ \ - } \ - while ( 0 ) - -#define unput(c) script3unput( c, script3text_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via script3restart()), so that the user can continue scanning by - * just pointing script3in at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when script3text is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int script3leng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow script3wrap()'s to do buffer switches - * instead of setting up a fresh script3in. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void script3restart YY_PROTO(( FILE *input_file )); - -void script3_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void script3_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE script3_create_buffer YY_PROTO(( FILE *file, int size )); -void script3_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void script3_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void script3_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER script3_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE script3_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE script3_scan_string YY_PROTO(( yyconst char *str )); -YY_BUFFER_STATE script3_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer script3_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script3_create_buffer( script3in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script3_create_buffer( script3in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define script3wrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *script3in = (FILE *) 0, *script3out = (FILE *) 0; -typedef int yy_state_type; -#define YY_FLEX_LEX_COMPAT -extern int script3lineno; -int script3lineno = 1; -extern char script3text[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up script3text. - */ -#define YY_DO_BEFORE_ACTION \ - script3text_ptr = yy_bp; \ - script3text_ptr -= yy_more_len; \ - script3leng = (int) (yy_cp - script3text_ptr); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( script3leng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( script3text, script3text_ptr, script3leng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 211 -#define YY_END_OF_BUFFER 212 -static yyconst short int yy_acclist[969] = - { 0, - 212, 210, 211, 7, 210, 211, 7, 211, 210, 211, - 210, 211, 12, 210, 211, 14, 210, 211, 210, 211, - 206, 210, 211, 206, 210, 211, 10, 210, 211, 9, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 11, 210, 211, 13, 210, 211, 1, 210, - 211, 7, 210, 211, 6, 7, 211, 210, 211, 7, - 209, 5, 205, 206, 207, 207, 207, 207, 15, 207, - - 207, 207, 207, 16, 207, 17, 207, 207, 207, 207, - 207, 207, 18, 207, 207, 19, 207, 207, 207, 20, - 207, 21, 207, 207, 207, 207, 22, 207, 207, 23, - 207, 207, 24, 207, 207, 25, 207, 26, 207, 207, - 189, 207, 207, 27, 207, 28, 207, 192, 207, 194, - 207, 29, 207, 30, 207, 207, 31, 207, 207, 207, - 207, 207, 207, 207, 32, 207, 33, 207, 207, 34, - 207, 35, 207, 36, 207, 207, 207, 37, 207, 207, - 38, 207, 39, 207, 40, 207, 41, 207, 42, 207, - 43, 207, 207, 207, 207, 207, 207, 8, 7, 6, - - 7, 4, 5, 208, 203, 204, 204, 203, 207, 207, - 207, 142, 207, 193, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 191, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 199, 207, 207, 201, 207, 207, - 207, 207, 47, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 190, 207, 4, 2, - 4, 5, 207, 207, 207, 207, 207, 207, 207, 207, - - 207, 207, 207, 207, 50, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 58, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 52, 207, 207, 207, 207, 207, 207, - 207, 207, 59, 207, 207, 207, 207, 44, 207, 207, - 207, 207, 207, 207, 55, 207, 207, 207, 207, 207, - 207, 207, 207, 2, 4, 3, 4, 5, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - - 61, 207, 207, 207, 207, 207, 207, 207, 207, 198, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 45, 207, 207, 207, 207, 207, 207, - 207, 207, 196, 207, 207, 207, 207, 207, 207, 207, - 53, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 46, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 51, 207, 207, 207, 207, 207, - 83, 207, 207, 207, 207, 82, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 177, - - 207, 207, 207, 171, 207, 207, 207, 207, 207, 168, - 207, 207, 207, 207, 197, 207, 169, 207, 207, 54, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 186, 207, 140, 207, 207, 207, 207, 207, 48, 207, - 60, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 57, 207, 69, 207, 81, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 195, - 207, 207, 207, 207, 207, 207, 80, 207, 207, 207, - 207, 207, 207, 207, 207, 56, 67, 207, 207, 141, - 200, 207, 207, 207, 207, 207, 207, 93, 207, 207, - - 207, 207, 207, 207, 92, 207, 207, 207, 207, 207, - 207, 76, 207, 207, 207, 207, 77, 207, 207, 123, - 127, 207, 207, 207, 207, 122, 207, 207, 126, 207, - 207, 207, 65, 207, 176, 207, 207, 207, 207, 145, - 207, 207, 207, 207, 79, 207, 78, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 85, 89, 95, 97, - 207, 207, 207, 207, 84, 207, 207, 88, 207, 207, - 94, 207, 96, 207, 207, 207, 207, 207, 173, 175, - 172, 207, 174, 207, 207, 207, 125, 129, 207, 207, - 207, 207, 124, 207, 128, 207, 207, 207, 207, 207, - - 202, 207, 207, 207, 207, 143, 207, 207, 207, 207, - 207, 207, 87, 91, 99, 101, 207, 207, 207, 207, - 86, 207, 90, 207, 98, 207, 100, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 139, 137, 207, 207, 68, 207, 207, 144, 207, - 207, 207, 207, 105, 103, 207, 207, 49, 207, 104, - 207, 102, 207, 207, 207, 207, 207, 107, 111, 115, - 106, 207, 207, 110, 207, 207, 114, 207, 207, 207, - 207, 207, 207, 207, 181, 180, 207, 207, 207, 133, - 135, 131, 207, 207, 138, 207, 136, 207, 207, 207, - - 207, 207, 207, 207, 109, 113, 117, 108, 207, 112, - 207, 116, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 185, - 184, 207, 207, 207, 207, 207, 207, 132, 207, 134, - 207, 130, 207, 207, 207, 207, 188, 187, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 150, 149, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 179, 178, - 207, 63, 207, 152, 151, 207, 207, 64, 207, 207, - 207, 207, 207, 148, 147, 207, 207, 207, 207, 207, - 207, 207, 119, 118, 207, 207, 207, 170, 207, 66, - - 62, 207, 207, 207, 207, 207, 121, 120, 207, 207, - 207, 207, 71, 207, 207, 207, 207, 207, 207, 70, - 72, 207, 207, 207, 156, 155, 207, 207, 207, 207, - 207, 207, 165, 207, 207, 73, 75, 207, 207, 207, - 207, 207, 74, 207, 207, 159, 158, 207, 154, 153, - 207, 183, 182, 207, 161, 160, 207, 207, 146, 207, - 167, 207, 157, 163, 162, 207, 166, 164 - } ; - -static yyconst short int yy_accept[1203] = - { 0, - 1, 1, 1, 2, 4, 7, 9, 11, 13, 16, - 19, 21, 24, 27, 30, 33, 35, 37, 39, 41, - 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, - 63, 65, 67, 69, 71, 73, 76, 79, 82, 85, - 88, 90, 91, 91, 92, 92, 92, 93, 94, 95, - 95, 96, 97, 98, 99, 101, 102, 103, 104, 106, - 108, 109, 110, 110, 111, 112, 113, 115, 116, 118, - 119, 120, 122, 124, 125, 126, 127, 129, 130, 132, - 133, 135, 136, 138, 140, 141, 141, 143, 144, 146, - 148, 150, 152, 154, 156, 157, 159, 160, 161, 162, - - 163, 164, 165, 167, 169, 170, 172, 174, 176, 177, - 178, 180, 181, 183, 185, 187, 189, 191, 193, 194, - 195, 196, 197, 198, 199, 200, 202, 202, 202, 204, - 204, 204, 204, 205, 207, 208, 209, 210, 211, 212, - 214, 216, 217, 218, 219, 220, 221, 222, 222, 222, - 222, 222, 222, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 246, 246, - 246, 246, 246, 246, 247, 248, 249, 250, 251, 252, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - - 264, 265, 267, 268, 270, 271, 272, 273, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 289, 289, 290, 290, 290, 290, 293, 294, 295, - 295, 296, 297, 298, 299, 300, 301, 302, 302, 302, - 302, 302, 302, 302, 303, 304, 305, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 331, 331, 331, 331, 331, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, - - 357, 358, 360, 361, 361, 362, 363, 364, 365, 367, - 368, 369, 370, 371, 372, 373, 374, 374, 376, 376, - 379, 379, 380, 381, 381, 382, 383, 384, 385, 386, - 387, 388, 388, 388, 388, 388, 388, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 403, 404, 405, 406, 407, 408, 409, 409, 410, - 412, 413, 414, 415, 416, 416, 416, 416, 416, 416, - 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 436, - 437, 438, 439, 440, 441, 441, 442, 443, 445, 446, - - 447, 447, 448, 449, 450, 451, 453, 453, 454, 454, - 455, 456, 457, 458, 459, 460, 461, 461, 461, 461, - 461, 461, 461, 462, 463, 464, 465, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 477, 478, 479, 480, - 481, 483, 483, 483, 484, 485, 486, 488, 489, 490, - 490, 490, 490, 490, 490, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 502, 503, 504, 506, - 507, 508, 509, 510, 512, 513, 514, 515, 517, 517, - 519, 520, 522, 523, 523, 524, 525, 526, 527, 527, - 528, 528, 529, 530, 531, 533, 535, 536, 537, 537, - - 537, 537, 537, 537, 537, 537, 538, 539, 541, 543, - 544, 545, 546, 547, 548, 549, 550, 550, 551, 552, - 554, 556, 558, 558, 558, 559, 560, 561, 562, 563, - 563, 563, 563, 563, 563, 563, 564, 565, 566, 567, - 568, 569, 570, 572, 573, 574, 575, 576, 577, 579, - 580, 581, 582, 582, 582, 582, 583, 583, 583, 584, - 584, 585, 586, 589, 590, 591, 593, 593, 594, 595, - 596, 597, 598, 598, 598, 598, 599, 599, 599, 599, - 599, 600, 600, 601, 602, 603, 604, 605, 607, 608, - 609, 610, 610, 611, 611, 611, 612, 614, 614, 614, - - 614, 615, 616, 617, 619, 619, 620, 620, 620, 620, - 620, 621, 621, 622, 622, 623, 624, 625, 626, 628, - 629, 631, 632, 632, 633, 635, 637, 638, 639, 640, - 642, 642, 643, 643, 643, 643, 644, 644, 644, 645, - 645, 647, 649, 650, 651, 651, 652, 653, 654, 655, - 656, 657, 657, 658, 658, 659, 659, 660, 661, 661, - 661, 661, 662, 662, 663, 664, 665, 667, 668, 670, - 671, 673, 675, 676, 677, 677, 678, 678, 678, 679, - 679, 680, 681, 683, 685, 686, 686, 687, 687, 687, - 687, 687, 688, 689, 690, 691, 692, 693, 695, 697, - - 697, 698, 699, 699, 700, 701, 701, 703, 703, 703, - 703, 704, 704, 704, 704, 705, 705, 706, 708, 708, - 709, 709, 710, 711, 712, 713, 713, 714, 715, 716, - 717, 717, 717, 718, 718, 719, 720, 721, 723, 725, - 727, 729, 730, 730, 731, 731, 731, 732, 732, 733, - 733, 734, 734, 734, 734, 734, 735, 736, 737, 738, - 738, 739, 740, 740, 741, 742, 743, 744, 744, 744, - 744, 745, 745, 745, 745, 746, 746, 748, 748, 749, - 749, 749, 751, 752, 753, 754, 755, 756, 756, 757, - 757, 758, 760, 762, 764, 764, 765, 765, 765, 766, - - 766, 767, 767, 768, 769, 769, 770, 770, 771, 771, - 771, 773, 774, 776, 777, 779, 780, 781, 781, 782, - 783, 783, 784, 785, 785, 785, 786, 788, 788, 788, - 788, 789, 789, 789, 789, 790, 791, 792, 793, 794, - 795, 797, 799, 799, 800, 800, 801, 801, 802, 802, - 802, 803, 803, 804, 804, 805, 806, 807, 808, 808, - 810, 812, 814, 815, 815, 816, 817, 817, 818, 819, - 819, 819, 819, 819, 819, 820, 820, 820, 820, 820, - 821, 821, 822, 823, 823, 824, 824, 825, 825, 826, - 826, 826, 827, 827, 827, 827, 828, 828, 829, 829, - - 830, 831, 833, 833, 834, 834, 835, 836, 836, 836, - 836, 836, 836, 837, 837, 837, 837, 837, 838, 838, - 840, 842, 844, 844, 845, 845, 846, 846, 847, 847, - 848, 850, 850, 850, 850, 851, 851, 852, 852, 853, - 853, 854, 854, 855, 856, 856, 856, 856, 856, 856, - 857, 857, 857, 857, 857, 858, 858, 859, 861, 861, - 862, 862, 863, 863, 863, 863, 863, 863, 864, 864, - 865, 865, 866, 866, 867, 867, 868, 869, 869, 869, - 869, 869, 870, 872, 872, 873, 873, 873, 874, 874, - 875, 877, 877, 878, 879, 879, 879, 879, 879, 879, - - 879, 880, 881, 881, 882, 882, 883, 883, 884, 885, - 887, 888, 888, 888, 888, 888, 888, 888, 888, 889, - 889, 889, 890, 890, 890, 890, 890, 890, 890, 890, - 891, 892, 892, 893, 894, 894, 896, 897, 897, 898, - 900, 900, 900, 900, 901, 901, 901, 902, 903, 903, - 903, 904, 904, 904, 904, 904, 904, 904, 904, 905, - 906, 906, 907, 908, 910, 910, 911, 911, 911, 911, - 911, 911, 912, 912, 912, 913, 913, 913, 913, 913, - 914, 914, 914, 915, 916, 916, 917, 917, 918, 918, - 918, 918, 918, 918, 919, 919, 919, 920, 920, 921, - - 922, 922, 922, 922, 923, 924, 924, 925, 926, 928, - 928, 928, 928, 928, 928, 929, 929, 929, 930, 930, - 930, 930, 930, 930, 931, 932, 932, 933, 933, 934, - 934, 934, 934, 934, 935, 935, 935, 936, 936, 937, - 938, 938, 938, 939, 940, 940, 941, 941, 941, 941, - 941, 941, 942, 942, 942, 943, 944, 944, 944, 945, - 946, 947, 949, 949, 949, 949, 949, 950, 952, 952, - 953, 955, 956, 956, 958, 959, 959, 960, 960, 960, - 960, 960, 961, 961, 961, 962, 962, 962, 963, 964, - 964, 964, 965, 967, 967, 967, 967, 967, 967, 968, - - 969, 969 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 7, 1, 1, 1, 1, 8, - 9, 1, 10, 1, 11, 1, 1, 12, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 1, 14, 1, - 15, 1, 1, 1, 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, - 1, 42, 1, 1, 43, 1, 44, 44, 44, 44, - - 44, 44, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, - 1, 1, 46, 1, 47, 1, 1, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48 - } ; - -static yyconst int yy_meta[49] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 1, 1, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 1, 4, 5, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[1212] = - { 0, - 0, 47, 1305, 1306, 53, 57, 45, 1301, 1306, 1306, - 51, 53, 55, 1306, 1306, 82, 0, 60, 54, 57, - 53, 45, 75, 1287, 84, 91, 103, 77, 119, 98, - 123, 65, 88, 1282, 1298, 1306, 1306, 1306, 158, 164, - 138, 168, 132, 1306, 172, 1297, 1306, 70, 122, 164, - 0, 1269, 1280, 1278, 0, 1269, 1276, 1263, 145, 0, - 1258, 90, 162, 1265, 158, 1271, 0, 173, 1255, 171, - 1255, 0, 0, 1265, 1271, 124, 0, 1259, 0, 53, - 0, 1256, 0, 0, 1245, 184, 0, 193, 0, 1262, - 0, 0, 0, 0, 129, 0, 1251, 110, 198, 1254, - - 186, 202, 0, 0, 174, 0, 0, 188, 1246, 1251, - 0, 1262, 0, 0, 0, 0, 1257, 0, 1249, 1242, - 1241, 1249, 1238, 1306, 236, 242, 226, 1268, 1306, 239, - 1267, 220, 1306, 236, 1225, 241, 1235, 1247, 1255, 0, - 0, 1238, 1234, 1234, 1232, 233, 1241, 1244, 1241, 1234, - 1237, 1226, 1220, 1227, 1222, 1231, 1211, 1234, 1233, 1230, - 1223, 1226, 1215, 1209, 1227, 1218, 239, 240, 1211, 1223, - 1221, 1208, 1217, 1214, 230, 1213, 1210, 1215, 1199, 1211, - 1193, 1209, 1208, 1209, 1193, 1205, 1187, 1203, 1202, 0, - 1202, 1196, 1183, 242, 1183, 243, 1197, 245, 1180, 161, - - 1195, 1180, 1189, 0, 1177, 1192, 1186, 0, 1198, 1175, - 1183, 1187, 1170, 1184, 1174, 1169, 245, 1184, 1180, 1164, - 0, 1195, 1306, 1194, 269, 1193, 1306, 1160, 1163, 1171, - 1168, 1173, 1172, 1155, 1158, 1153, 1159, 1156, 1161, 1154, - 1147, 1144, 1150, 246, 1163, 1154, 0, 1142, 1147, 1152, - 1145, 1138, 1135, 1141, 1136, 1140, 1128, 1132, 1149, 1138, - 0, 1137, 1127, 1129, 225, 1141, 1140, 1126, 1122, 1129, - 1121, 1135, 1127, 1133, 1117, 1116, 1115, 1129, 1121, 1127, - 1111, 1110, 1120, 1123, 1115, 1113, 1116, 1119, 1108, 0, - 1107, 1112, 1100, 1118, 1113, 1097, 1104, 0, 1112, 1098, - - 1098, 0, 1107, 1108, 1107, 1106, 1083, 1102, 0, 1087, - 1109, 1095, 1099, 1087, 1093, 1095, 1111, 1306, 1110, 1306, - 271, 1101, 1076, 1077, 1091, 1084, 1084, 1086, 1072, 1074, - 1083, 1084, 1071, 1081, 1088, 1078, 1064, 1077, 1066, 1061, - 1060, 1072, 1073, 1060, 1070, 1045, 1067, 1053, 1065, 1064, - 0, 1063, 1055, 1065, 1060, 1044, 1043, 252, 255, 0, - 1049, 1041, 1059, 1038, 1049, 1056, 1051, 1041, 1058, 1057, - 1043, 1050, 1045, 1035, 1020, 1019, 1032, 1031, 1043, 1041, - 1018, 1027, 1037, 1025, 1016, 1028, 1017, 1016, 0, 1014, - 1012, 1012, 1013, 1011, 1017, 1023, 1007, 0, 1013, 1019, - - 1015, 1010, 1021, 1002, 1005, 0, 1001, 1003, 1002, 1015, - 1014, 996, 993, 992, 1008, 1009, 1004, 1012, 1011, 988, - 1009, 999, 262, 996, 997, 988, 0, 995, 971, 970, - 979, 968, 990, 974, 275, 0, 988, 967, 987, 985, - 0, 984, 987, 982, 985, 980, 0, 977, 970, 967, - 961, 960, 959, 960, 959, 961, 955, 954, 953, 954, - 953, 963, 949, 948, 955, 0, 946, 950, 936, 958, - 947, 956, 940, 0, 963, 962, 268, 0, 956, 0, - 960, 0, 950, 950, 934, 932, 946, 929, 932, 930, - 926, 926, 925, 929, 0, 0, 934, 923, 929, 922, - - 921, 257, 920, 941, 935, 934, 277, 906, 0, 921, - 914, 913, 261, 912, 901, 281, 909, 285, 923, 0, - 930, 0, 924, 915, 922, 913, 907, 915, 286, 905, - 913, 912, 920, 266, 267, 901, 909, 908, 884, 270, - 274, 292, 0, 906, 905, 908, 896, 903, 0, 892, - 909, 889, 885, 897, 882, 881, 880, 876, 879, 891, - 890, 289, 0, 875, 1306, 0, 877, 883, 290, 877, - 889, 884, 892, 283, 284, 1306, 871, 287, 868, 880, - 879, 882, 881, 867, 852, 291, 298, 0, 863, 299, - 860, 857, 856, 858, 862, 861, 0, 851, 867, 858, - - 865, 856, 847, 0, 854, 853, 868, 867, 866, 843, - 1306, 844, 1306, 843, 830, 829, 828, 837, 0, 838, - 0, 837, 830, 829, 0, 0, 830, 296, 840, 0, - 830, 829, 831, 821, 835, 834, 823, 840, 301, 826, - 0, 0, 824, 833, 841, 821, 839, 819, 818, 812, - 803, 812, 1306, 813, 1306, 812, 1306, 1306, 811, 302, - 830, 797, 819, 818, 807, 803, 0, 804, 0, 803, - 0, 0, 802, 306, 799, 798, 819, 809, 808, 793, - 1306, 1306, 0, 0, 810, 805, 804, 790, 789, 788, - 800, 1306, 1306, 786, 785, 784, 796, 0, 0, 799, - - 798, 789, 775, 774, 794, 295, 0, 782, 767, 724, - 12, 104, 161, 165, 194, 199, 293, 0, 310, 312, - 326, 314, 309, 326, 314, 316, 1306, 1306, 1306, 1306, - 318, 315, 316, 341, 310, 319, 323, 0, 0, 0, - 0, 325, 341, 342, 333, 332, 333, 343, 329, 336, - 337, 335, 336, 339, 341, 342, 343, 346, 348, 354, - 355, 353, 364, 365, 364, 1306, 1306, 367, 370, 369, - 370, 371, 368, 353, 354, 371, 0, 376, 386, 380, - 374, 0, 366, 358, 371, 1306, 1306, 380, 381, 372, - 373, 0, 0, 0, 385, 386, 391, 390, 391, 403, - - 391, 394, 395, 1306, 387, 1306, 388, 1306, 389, 391, - 0, 391, 0, 392, 0, 393, 395, 390, 391, 399, - 397, 398, 403, 422, 398, 1306, 0, 396, 417, 408, - 409, 404, 411, 423, 424, 1306, 1306, 1306, 433, 429, - 0, 0, 411, 412, 424, 425, 423, 424, 423, 418, - 419, 436, 426, 422, 423, 1306, 1306, 1306, 426, 0, - 0, 0, 427, 441, 443, 453, 431, 432, 437, 434, - 435, 436, 456, 439, 440, 436, 455, 448, 450, 450, - 451, 464, 458, 457, 458, 451, 452, 464, 465, 469, - 469, 470, 474, 475, 464, 469, 476, 477, 466, 467, - - 1306, 0, 485, 486, 481, 482, 473, 488, 485, 490, - 476, 496, 497, 503, 480, 487, 482, 489, 488, 0, - 0, 0, 500, 501, 495, 496, 495, 496, 491, 1306, - 0, 506, 507, 518, 519, 520, 489, 522, 491, 505, - 506, 507, 508, 504, 513, 511, 513, 519, 505, 506, - 517, 524, 513, 525, 515, 531, 1306, 0, 532, 533, - 532, 533, 533, 546, 547, 543, 542, 543, 530, 531, - 532, 533, 538, 539, 540, 541, 547, 552, 545, 556, - 546, 1306, 0, 557, 1306, 558, 546, 562, 550, 1306, - 0, 573, 542, 1306, 570, 557, 559, 560, 563, 571, - - 565, 573, 574, 575, 564, 565, 566, 567, 1306, 0, - 585, 586, 594, 586, 578, 586, 570, 570, 572, 596, - 582, 583, 586, 587, 588, 599, 592, 604, 588, 606, - 590, 606, 607, 1306, 595, 0, 596, 608, 609, 0, - 595, 613, 613, 1306, 603, 599, 1306, 600, 601, 621, - 622, 620, 613, 614, 631, 603, 610, 611, 612, 613, - 628, 629, 1306, 0, 611, 612, 628, 623, 643, 620, - 645, 614, 634, 640, 641, 650, 622, 623, 631, 1306, - 631, 642, 633, 644, 645, 646, 636, 637, 643, 645, - 646, 652, 648, 649, 649, 661, 662, 649, 1306, 1306, - - 663, 673, 655, 644, 658, 652, 653, 680, 0, 663, - 658, 674, 679, 680, 681, 669, 675, 676, 681, 669, - 682, 668, 676, 670, 678, 688, 689, 686, 1306, 691, - 690, 678, 686, 687, 682, 688, 689, 698, 1306, 1306, - 696, 710, 698, 680, 705, 706, 691, 688, 698, 705, - 710, 711, 721, 711, 712, 1306, 716, 707, 718, 709, - 1306, 0, 719, 705, 706, 712, 1306, 0, 705, 1306, - 0, 1306, 728, 0, 729, 718, 1306, 723, 719, 725, - 722, 723, 718, 737, 1306, 725, 735, 736, 1306, 722, - 739, 1306, 0, 735, 730, 731, 724, 734, 1306, 1306, - - 1306, 763, 768, 771, 775, 780, 783, 788, 793, 798, - 803 - } ; - -static yyconst short int yy_def[1212] = - { 0, - 1201, 1, 1201, 1201, 1201, 1201, 1202, 1203, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1205, 1201, 1202, 1201, 1206, 1203, 1201, 1201, 1201, 1207, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1201, 1201, 1201, 1208, 1205, 1201, 1205, - 1209, 1206, 1201, 1207, 1207, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1208, 1201, 1210, 1211, 1209, 1201, 1204, 1204, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1210, 1201, 1211, 1201, - 1211, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - - 1201, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, - - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, - - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - 1201, 1201, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - - 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1201, - 1204, 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1201, 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, - - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1204, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 0, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201 - } ; - -static yyconst short int yy_nxt[1355] = - { 0, - 4, 5, 6, 5, 5, 7, 8, 9, 10, 11, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 17, 17, 22, 17, 17, 23, 24, 25, 26, - 27, 17, 28, 29, 30, 31, 32, 33, 17, 34, - 17, 35, 17, 4, 4, 36, 37, 38, 39, 40, - 44, 39, 771, 41, 42, 42, 42, 42, 42, 42, - 42, 42, 48, 48, 49, 49, 49, 49, 174, 69, - 63, 77, 80, 70, 74, 64, 78, 71, 81, 79, - 119, 48, 48, 175, 120, 75, 45, 72, 73, 65, - 82, 50, 66, 67, 86, 76, 99, 50, 52, 53, - - 54, 55, 68, 121, 83, 146, 100, 89, 56, 84, - 57, 90, 58, 87, 772, 59, 60, 61, 95, 91, - 122, 110, 147, 92, 62, 111, 88, 93, 94, 194, - 112, 96, 97, 49, 49, 98, 101, 44, 102, 195, - 129, 103, 130, 171, 131, 104, 113, 191, 105, 114, - 106, 115, 107, 108, 172, 116, 117, 118, 109, 125, - 126, 42, 125, 192, 127, 42, 42, 42, 42, 42, - 42, 42, 42, 45, 133, 134, 134, 44, 143, 148, - 296, 149, 150, 151, 144, 155, 156, 773, 157, 152, - 159, 166, 160, 161, 162, 153, 297, 167, 774, 178, - - 163, 179, 180, 181, 209, 182, 164, 136, 184, 210, - 185, 186, 187, 196, 188, 197, 202, 183, 203, 205, - 211, 204, 1201, 212, 198, 44, 189, 775, 223, 199, - 206, 200, 224, 776, 207, 358, 208, 125, 126, 42, - 125, 129, 127, 42, 42, 42, 42, 134, 134, 235, - 225, 225, 136, 136, 257, 259, 267, 286, 258, 268, - 293, 290, 287, 312, 294, 338, 236, 359, 313, 339, - 260, 320, 505, 320, 442, 288, 291, 444, 555, 136, - 321, 321, 321, 321, 136, 517, 443, 582, 576, 445, - 577, 592, 588, 518, 589, 595, 605, 611, 613, 612, - - 614, 619, 623, 620, 506, 621, 703, 622, 642, 647, - 556, 714, 643, 648, 653, 655, 654, 656, 658, 583, - 659, 777, 667, 593, 668, 766, 767, 596, 606, 669, - 672, 670, 673, 730, 624, 731, 778, 741, 704, 742, - 779, 780, 782, 715, 783, 784, 785, 786, 787, 788, - 789, 790, 791, 792, 793, 794, 795, 796, 781, 797, - 798, 799, 800, 801, 802, 803, 804, 806, 805, 807, - 808, 810, 809, 811, 813, 812, 814, 815, 817, 816, - 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, - 828, 829, 830, 831, 832, 833, 834, 836, 837, 839, - - 840, 841, 842, 843, 844, 838, 845, 846, 847, 848, - 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 835, 867, - 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, - 878, 880, 879, 881, 882, 884, 885, 886, 887, 888, - 889, 890, 891, 892, 893, 896, 897, 898, 899, 900, - 901, 883, 902, 903, 905, 906, 907, 908, 894, 909, - 910, 911, 895, 912, 913, 914, 915, 916, 917, 918, - 919, 920, 921, 923, 924, 925, 926, 927, 928, 922, - 929, 930, 931, 932, 933, 904, 934, 935, 936, 937, - - 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, - 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, - 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, - 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, - 989, 990, 991, 992, 993, 994, 995, 996, 997, 999, - 1001, 968, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, - 1011, 1012, 998, 1013, 1014, 1015, 1016, 1017, 1000, 1002, - 1018, 1019, 1020, 1021, 1022, 1023, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1034, 1036, 1035, 1037, 1024, - - 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, - 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, - 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, - 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, - 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, - 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, - 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, - 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, - 1118, 1119, 1121, 1122, 1123, 1120, 1124, 1125, 1126, 1127, - 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, - - 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, - 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, - 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, - 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, - 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, - 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, - 1198, 1199, 1200, 43, 770, 43, 43, 43, 46, 46, - 46, 46, 46, 51, 51, 128, 128, 128, 128, 128, - 132, 132, 132, 132, 132, 135, 769, 135, 222, 222, - 222, 222, 222, 226, 226, 226, 226, 226, 317, 317, - - 317, 317, 317, 319, 319, 319, 319, 319, 768, 765, - 764, 763, 762, 761, 760, 759, 758, 757, 756, 755, - 754, 753, 752, 751, 750, 749, 748, 747, 746, 745, - 744, 743, 740, 739, 738, 737, 736, 735, 734, 733, - 732, 729, 728, 727, 726, 725, 724, 723, 722, 721, - 720, 719, 718, 717, 716, 713, 712, 711, 710, 709, - 708, 707, 706, 705, 702, 701, 700, 699, 698, 697, - 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, - 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, - 676, 675, 674, 671, 666, 665, 664, 663, 662, 661, - - 660, 657, 652, 651, 650, 649, 646, 645, 644, 641, - 640, 639, 638, 637, 636, 635, 634, 633, 632, 631, - 630, 629, 628, 627, 626, 625, 618, 617, 616, 615, - 610, 609, 608, 607, 604, 603, 602, 601, 600, 599, - 598, 597, 594, 591, 590, 587, 586, 585, 584, 581, - 580, 579, 578, 575, 574, 573, 572, 571, 570, 569, - 568, 567, 566, 565, 564, 563, 562, 561, 560, 559, - 558, 557, 554, 553, 552, 551, 550, 549, 548, 547, - 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, - 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, - - 526, 525, 524, 523, 522, 521, 520, 519, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 504, 503, - 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, - 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, - 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, - 452, 451, 450, 449, 448, 447, 446, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 320, 318, 406, 405, 404, 403, 402, 401, - 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, - 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, - 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 360, 357, 356, 355, 354, 353, 352, 351, 350, 349, - 348, 347, 346, 345, 344, 343, 342, 341, 340, 337, - 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, - 326, 325, 324, 323, 322, 227, 318, 223, 316, 315, - - 314, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 295, 292, 289, 285, 284, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 272, 271, 270, 269, 266, 265, 264, 263, 262, - 261, 256, 255, 254, 253, 252, 251, 250, 249, 248, - 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, - 237, 234, 233, 232, 231, 230, 229, 228, 1201, 227, - 129, 221, 220, 219, 218, 217, 216, 215, 214, 213, - 201, 193, 190, 177, 176, 173, 170, 169, 168, 165, - 158, 154, 145, 142, 141, 140, 139, 138, 137, 47, - - 124, 123, 85, 47, 1201, 3, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yyconst short int yy_chk[1355] = - { 0, - 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, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 7, 2, 711, 2, 5, 5, 5, 5, 6, 6, - 6, 6, 11, 11, 12, 12, 13, 13, 80, 19, - 18, 21, 22, 19, 20, 18, 21, 19, 22, 21, - 32, 48, 48, 80, 32, 20, 7, 19, 19, 18, - 23, 12, 18, 18, 25, 20, 28, 12, 16, 16, - - 16, 16, 18, 33, 23, 62, 28, 26, 16, 23, - 16, 26, 16, 25, 712, 16, 16, 16, 27, 26, - 33, 30, 62, 26, 16, 30, 25, 26, 26, 98, - 30, 27, 27, 49, 49, 27, 29, 43, 29, 98, - 41, 29, 41, 76, 41, 29, 31, 95, 29, 31, - 29, 31, 29, 29, 76, 31, 31, 31, 29, 39, - 39, 39, 39, 95, 39, 40, 40, 40, 40, 42, - 42, 42, 42, 43, 45, 50, 50, 45, 59, 63, - 200, 63, 63, 63, 59, 65, 65, 713, 65, 63, - 68, 70, 68, 68, 68, 63, 200, 70, 714, 86, - - 68, 86, 86, 86, 105, 86, 68, 50, 88, 105, - 88, 88, 88, 99, 88, 99, 101, 86, 101, 102, - 108, 101, 132, 108, 99, 132, 88, 715, 127, 99, - 102, 99, 127, 716, 102, 265, 102, 125, 125, 125, - 125, 130, 125, 126, 126, 126, 126, 134, 134, 146, - 130, 130, 136, 136, 167, 168, 175, 194, 167, 175, - 198, 196, 194, 217, 198, 244, 146, 265, 217, 244, - 168, 225, 423, 321, 358, 194, 196, 359, 477, 134, - 225, 225, 321, 321, 136, 435, 358, 507, 502, 359, - 502, 516, 513, 435, 513, 518, 529, 534, 535, 534, - - 535, 540, 542, 540, 423, 541, 628, 541, 562, 569, - 477, 639, 562, 569, 574, 575, 574, 575, 578, 507, - 578, 717, 586, 516, 586, 706, 706, 518, 529, 587, - 590, 587, 590, 660, 542, 660, 719, 674, 628, 674, - 720, 721, 722, 639, 723, 724, 725, 726, 731, 732, - 733, 734, 735, 736, 737, 742, 743, 744, 721, 745, - 746, 747, 748, 749, 750, 751, 752, 753, 752, 753, - 754, 755, 754, 756, 757, 756, 757, 758, 759, 758, - 760, 761, 762, 763, 764, 765, 768, 769, 770, 771, - 772, 773, 774, 775, 776, 778, 779, 780, 781, 783, - - 784, 785, 785, 788, 789, 781, 790, 791, 795, 796, - 797, 798, 799, 800, 801, 802, 803, 805, 807, 809, - 810, 812, 814, 816, 817, 818, 819, 820, 779, 821, - 822, 823, 824, 825, 828, 829, 830, 831, 832, 833, - 834, 835, 834, 839, 840, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 859, 863, - 864, 840, 865, 866, 867, 868, 869, 870, 852, 871, - 872, 873, 852, 874, 875, 876, 877, 878, 879, 880, - 881, 882, 883, 884, 885, 886, 887, 888, 889, 883, - 890, 891, 892, 893, 894, 866, 895, 896, 897, 898, - - 899, 900, 903, 904, 905, 906, 907, 908, 909, 910, - 911, 912, 913, 914, 915, 916, 917, 918, 919, 923, - 924, 925, 926, 927, 928, 929, 932, 933, 934, 935, - 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, - 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, - 956, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 968, 935, 969, 970, 971, 972, 973, 974, 975, 976, - 977, 978, 966, 979, 980, 981, 984, 986, 967, 968, - 987, 988, 989, 992, 993, 995, 996, 997, 998, 999, - 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1005, 1006, 995, - - 1007, 1008, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, - 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1035, 1037, 1038, 1039, 1041, - 1042, 1043, 1045, 1046, 1048, 1049, 1050, 1051, 1052, 1053, - 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1065, - 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, - 1076, 1077, 1078, 1079, 1081, 1082, 1083, 1084, 1085, 1086, - 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, - 1097, 1098, 1101, 1102, 1103, 1098, 1104, 1105, 1106, 1107, - 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, - - 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, - 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1141, - 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, - 1152, 1153, 1154, 1155, 1157, 1158, 1159, 1160, 1163, 1164, - 1165, 1166, 1169, 1173, 1175, 1176, 1178, 1179, 1180, 1181, - 1182, 1183, 1184, 1186, 1187, 1188, 1190, 1191, 1194, 1195, - 1196, 1197, 1198, 1202, 710, 1202, 1202, 1202, 1203, 1203, - 1203, 1203, 1203, 1204, 1204, 1205, 1205, 1205, 1205, 1205, - 1206, 1206, 1206, 1206, 1206, 1207, 709, 1207, 1208, 1208, - 1208, 1208, 1208, 1209, 1209, 1209, 1209, 1209, 1210, 1210, - - 1210, 1210, 1210, 1211, 1211, 1211, 1211, 1211, 708, 705, - 704, 703, 702, 701, 700, 697, 696, 695, 694, 691, - 690, 689, 688, 687, 686, 685, 680, 679, 678, 677, - 676, 675, 673, 670, 668, 666, 665, 664, 663, 662, - 661, 659, 656, 654, 652, 651, 650, 649, 648, 647, - 646, 645, 644, 643, 640, 638, 637, 636, 635, 634, - 633, 632, 631, 629, 627, 624, 623, 622, 620, 618, - 617, 616, 615, 614, 612, 610, 609, 608, 607, 606, - 605, 603, 602, 601, 600, 599, 598, 596, 595, 594, - 593, 592, 591, 589, 585, 584, 583, 582, 581, 580, - - 579, 577, 573, 572, 571, 570, 568, 567, 564, 561, - 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, - 550, 548, 547, 546, 545, 544, 539, 538, 537, 536, - 533, 532, 531, 530, 528, 527, 526, 525, 524, 523, - 521, 519, 517, 515, 514, 512, 511, 510, 508, 506, - 505, 504, 503, 501, 500, 499, 498, 497, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 481, 479, 476, 475, 473, 472, 471, 470, 469, 468, - 467, 465, 464, 463, 462, 461, 460, 459, 458, 457, - 456, 455, 454, 453, 452, 451, 450, 449, 448, 446, - - 445, 444, 443, 442, 440, 439, 438, 437, 434, 433, - 432, 431, 430, 429, 428, 426, 425, 424, 422, 421, - 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, - 410, 409, 408, 407, 405, 404, 403, 402, 401, 400, - 399, 397, 396, 395, 394, 393, 392, 391, 390, 388, - 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, - 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, - 367, 366, 365, 364, 363, 362, 361, 357, 356, 355, - 354, 353, 352, 350, 349, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, - - 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, - 323, 322, 319, 317, 316, 315, 314, 313, 312, 311, - 310, 308, 307, 306, 305, 304, 303, 301, 300, 299, - 297, 296, 295, 294, 293, 292, 291, 289, 288, 287, - 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, - 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, - 266, 264, 263, 262, 260, 259, 258, 257, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 246, 245, 243, - 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, - 232, 231, 230, 229, 228, 226, 224, 222, 220, 219, - - 218, 216, 215, 214, 213, 212, 211, 210, 209, 207, - 206, 205, 203, 202, 201, 199, 197, 195, 193, 192, - 191, 189, 188, 187, 186, 185, 184, 183, 182, 181, - 180, 179, 178, 177, 176, 174, 173, 172, 171, 170, - 169, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 145, 144, 143, 142, 139, 138, 137, 135, 131, - 128, 123, 122, 121, 120, 119, 117, 112, 110, 109, - 100, 97, 90, 85, 82, 78, 75, 74, 71, 69, - 66, 64, 61, 58, 57, 56, 54, 53, 52, 46, - - 35, 34, 24, 8, 3, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up script3text */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -static int yy_more_flag = 0; -static int yy_more_len = 0; -#define yymore() (yy_more_flag = 1) -#define YY_MORE_ADJ yy_more_len -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char script3text[YYLMAX]; -char *script3text_ptr; -#line 1 "script_lexer.l" -#define INITIAL 0 -#line 2 "script_lexer.l" -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -//***************************************************************************** -// DESCRIPTION : Script Lexer -//***************************************************************************** - -#ifdef _WINDOWS -#pragma warning (disable : 4102) -#pragma warning (disable : 4273) -#pragma warning (disable : 4786) -#endif - -//***************************************************************************** -// EXTERNAL DECLARATIONS -//***************************************************************************** -#include -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "Iutility.h" // Utility component interface -#include "Iwarehouse.h" // Warehouse component interface -#include "Idicom.h" // Dicom component interface -#include "Inetwork.h" // Network component interface -#include "Imedia.h" // Media File component interface -#include "Isession.h" // Test Session component interface - -#include "script3_parser.cpp.h" - -extern void script3error(char*); - -extern FILE *script3in; -extern int script3lineno; -extern char script3CurrentFilename[_MAX_PATH]; -extern long script3CurrentFileOffset; -extern long script3CurrentLineNo; -extern SCRIPT_SESSION_CLASS *script3Session_ptr; -extern bool script3IsNativeVts; -extern bool script3ParseOnly; - -bool IsHex(char, int *); - -static char *pEnd; - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int script3wrap YY_PROTO(( void )); -#else -extern int script3wrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void script3unput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef script3text_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int script3input YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( script3text, script3leng, 1, script3out ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( script3in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( script3in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, script3in )) == 0) \ - && ferror( script3in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int script3lex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after script3text and script3leng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( script3leng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (script3text[script3leng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 57 "script_lexer.l" - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! script3in ) - script3in = stdin; - - if ( ! script3out ) - script3out = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - script3_create_buffer( script3in, YY_BUF_SIZE ); - - script3_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_more_len = 0; - if ( yy_more_flag ) - { - yy_more_len = script3leng; - yy_more_flag = 0; - } - yy_cp = yy_c_buf_p; - - /* Support of script3text. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1306 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < script3leng; ++yyl ) - if ( script3text[yyl] == '\n' ) - ++script3lineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 58 "script_lexer.l" -{ /* skip charcters from 80H - FFH */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 60 "script_lexer.l" -{ - // copy script3 comment lines - strip off leading ## - int length = script3leng; - - // check to see how line is terminated - // - and remove termination - if ((script3text[script3leng-1] == LINEFEED) - && (script3text[script3leng-2] == CARRIAGERETURN)) - length -= 2; - else - length--; - - script3lval.string_ptr = (char*) malloc(length+1); - - memcpy(script3lval.string_ptr, &script3text[0], length); - script3lval.string_ptr[length] = NULLCHAR; - if (script3Session_ptr) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_NONE, 1, "%s", script3lval.string_ptr); - } - } - - free(script3lval.string_ptr); - script3lval.string_ptr = NULL; - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 89 "script_lexer.l" -{ /* extract file and line info from cpp comment lines: # Number ["file"] */ - char* iS = NULL; - char* nS = NULL; - iS = strstr(script3text, "# "); - if (iS != NULL) - { - nS = strstr(iS, " \""); - if (nS != NULL) - { - *nS++ = '\0'; - strcpy(script3CurrentFilename, nS); - } - script3CurrentFileOffset = atoi(iS+2); - script3CurrentLineNo = script3lineno; - } - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 105 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 110 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 115 "script_lexer.l" -{ /* skip empty lines */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 116 "script_lexer.l" -{ /* skip white space */ } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 117 "script_lexer.l" -{ /* continuation line */ } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 118 "script_lexer.l" -{ /* skip equal sign */ } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 119 "script_lexer.l" -{ /* skip semi-colon */ } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 120 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 121 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 122 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 123 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 124 "script_lexer.l" -{ script3lval.vr = ATTR_VR_AE; return VR; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 125 "script_lexer.l" -{ script3lval.vr = ATTR_VR_AS; return VR; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 126 "script_lexer.l" -{ script3lval.vr = ATTR_VR_AT; return VR; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 127 "script_lexer.l" -{ script3lval.vr = ATTR_VR_CS; return VR; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 128 "script_lexer.l" -{ script3lval.vr = ATTR_VR_DA; return VR; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 129 "script_lexer.l" -{ script3lval.vr = ATTR_VR_DS; return VR; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 130 "script_lexer.l" -{ script3lval.vr = ATTR_VR_DT; return VR; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 131 "script_lexer.l" -{ script3lval.vr = ATTR_VR_FD; return VR; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 132 "script_lexer.l" -{ script3lval.vr = ATTR_VR_FL; return VR; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 133 "script_lexer.l" -{ script3lval.vr = ATTR_VR_IS; return VR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 134 "script_lexer.l" -{ script3lval.vr = ATTR_VR_LO; return VR; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 135 "script_lexer.l" -{ script3lval.vr = ATTR_VR_LT; return VR; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 136 "script_lexer.l" -{ script3lval.vr = ATTR_VR_OB; return VR; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 137 "script_lexer.l" -{ script3lval.vr = ATTR_VR_OF; return VR; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 138 "script_lexer.l" -{ script3lval.vr = ATTR_VR_OV; return VR; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 139 "script_lexer.l" -{ script3lval.vr = ATTR_VR_OW; return VR; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 140 "script_lexer.l" -{ script3lval.vr = ATTR_VR_PN; return VR; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 141 "script_lexer.l" -{ script3lval.vr = ATTR_VR_SH; return VR; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 142 "script_lexer.l" -{ script3lval.vr = ATTR_VR_SL; return VR; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 143 "script_lexer.l" -{ script3lval.vr = ATTR_VR_SQ; return T_SQ; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 144 "script_lexer.l" -{ script3lval.vr = ATTR_VR_SS; return VR; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 145 "script_lexer.l" -{ script3lval.vr = ATTR_VR_ST; return VR; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 146 "script_lexer.l" -{ script3lval.vr = ATTR_VR_TM; return VR; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 147 "script_lexer.l" -{ script3lval.vr = ATTR_VR_UI; return VR; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 148 "script_lexer.l" -{ script3lval.vr = ATTR_VR_UL; return VR; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 149 "script_lexer.l" -{ script3lval.vr = ATTR_VR_UN; return VR; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 150 "script_lexer.l" -{ script3lval.vr = ATTR_VR_UR; return VR; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 151 "script_lexer.l" -{ script3lval.vr = ATTR_VR_US; return VR; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 152 "script_lexer.l" -{ script3lval.vr = ATTR_VR_UT; return VR; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 154 "script_lexer.l" -{ return T_SEND; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 156 "script_lexer.l" -{ return T_RESET; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 157 "script_lexer.l" -{ return T_CREATE; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 158 "script_lexer.l" -{ return T_SET; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 159 "script_lexer.l" -{ return T_COMPARE; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 160 "script_lexer.l" -{ return T_COMPARE_NOT; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 161 "script_lexer.l" -{ return T_COPY; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 162 "script_lexer.l" -{ return T_DELETE; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 164 "script_lexer.l" -{ return T_READ; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 165 "script_lexer.l" -{ return T_WRITE; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 167 "script_lexer.l" -{ return T_SYSTEM; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 168 "script_lexer.l" -{ return T_TIME; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 169 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 170 "script_lexer.l" -{ return T_DISPLAY; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 171 "script_lexer.l" -{ return T_ECHO; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 172 "script_lexer.l" -{ return T_ROLE; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 173 "script_lexer.l" -{ return T_CONFIRM; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 174 "script_lexer.l" -{ return T_DELAY; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 176 "script_lexer.l" -{ return T_APPL_ENTITY; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 177 "script_lexer.l" -{ return T_ADD_GROUP_LENGTH; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 178 "script_lexer.l" -{ return T_DEF_SQ_LENGTH; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 179 "script_lexer.l" -{ return T_POPULATE; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 180 "script_lexer.l" -{ return T_STRICT; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 181 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 182 "script_lexer.l" -{ return T_VALIDATION; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 183 "script_lexer.l" -{ script3lval.validationFlag = ALL; return VALIDATIONFLAG; } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 184 "script_lexer.l" -{ script3lval.validationFlag = USE_DEFINITION; return VALIDATIONFLAG; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 185 "script_lexer.l" -{ script3lval.validationFlag = USE_VR; return VALIDATIONFLAG; } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 186 "script_lexer.l" -{ script3lval.validationFlag = USE_REFERENCE; return VALIDATIONFLAG; } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 187 "script_lexer.l" -{ script3lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_VR); return VALIDATIONFLAG; } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 188 "script_lexer.l" -{ script3lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 189 "script_lexer.l" -{ script3lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_VR | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 190 "script_lexer.l" -{ script3lval.validationFlag = NONE; return VALIDATIONFLAG; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 192 "script_lexer.l" -{ return T_LANGUAGE; } - YY_BREAK -/* - * The LANGUAGE token is introduced to enable backward compatibility with - * VTS and ADVT - * Currently the ADVT language is fully supported by the parser - * To avoid conflicts and to have a more consistent language for DVT - * this language section has been introduced. Here some mappings between VTS - * language tokens and DVT language tokens are provided. - */ -case 78: -YY_RULE_SETUP -#line 202 "script_lexer.l" -{ - /* - * The VTS VALIDATE command is mapped on the DVT RECEIVE Command - */ - if (script3IsNativeVts) - { - return T_RECEIVE; - } - else - { - return T_VALIDATE; - } - } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 215 "script_lexer.l" -{ - /* - * The VTS VALDIMSE command is mapped on the DVT VALIDATE Command - */ - if (script3IsNativeVts) - { - return T_VALIDATE; - } - else - { - /* VALDIMSE is not part of the DVT language anymore */ - script3error("\"VALDIMSE\" is not a DVT script3 command. Use \"VALIDATE\" "); - } - } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 230 "script_lexer.l" -{ - /* - * The VTS RECEIVE command is mapped on the DVT IMPORT Command - */ - if (script3IsNativeVts) - { - return T_IMPORT; - } - else - { - return T_RECEIVE; - } - } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 244 "script_lexer.l" -{ - /* - * The VTS EXECUTE command is mapped on the DVT EXPORT Command - */ - if (script3IsNativeVts) - { - return T_EXPORT; - } - else - { - /* EXECUTE is not part of the DVT language anymore */ - script3error("\"EXECUTE\" is not a DVT script3 command. Use \"EXPORT\" "); - } - } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 259 "script_lexer.l" -{ - return T_IMPORT; - } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 263 "script_lexer.l" -{ - return T_EXPORT; - } - YY_BREAK -case 84: -#line 268 "script_lexer.l" -case 85: -YY_RULE_SETUP -#line 268 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CECHO_RQ; return COMMANDFIELD; } - YY_BREAK -case 86: -#line 270 "script_lexer.l" -case 87: -YY_RULE_SETUP -#line 270 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CECHO_RSP; return COMMANDFIELD; } - YY_BREAK -case 88: -#line 272 "script_lexer.l" -case 89: -YY_RULE_SETUP -#line 272 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CFIND_RQ; return COMMANDFIELD; } - YY_BREAK -case 90: -#line 274 "script_lexer.l" -case 91: -YY_RULE_SETUP -#line 274 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CFIND_RSP; return COMMANDFIELD; } - YY_BREAK -case 92: -#line 276 "script_lexer.l" -case 93: -YY_RULE_SETUP -#line 276 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 94: -#line 278 "script_lexer.l" -case 95: -YY_RULE_SETUP -#line 278 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 96: -#line 280 "script_lexer.l" -case 97: -YY_RULE_SETUP -#line 280 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CMOVE_RQ; return COMMANDFIELD; } - YY_BREAK -case 98: -#line 282 "script_lexer.l" -case 99: -YY_RULE_SETUP -#line 282 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CMOVE_RSP; return COMMANDFIELD; } - YY_BREAK -case 100: -#line 284 "script_lexer.l" -case 101: -YY_RULE_SETUP -#line 284 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CSTORE_RQ; return COMMANDFIELD; } - YY_BREAK -case 102: -#line 286 "script_lexer.l" -case 103: -YY_RULE_SETUP -#line 286 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CSTORE_RSP; return COMMANDFIELD; } - YY_BREAK -case 104: -#line 288 "script_lexer.l" -case 105: -YY_RULE_SETUP -#line 288 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_CCANCEL_RQ; return COMMANDFIELD; } - YY_BREAK -case 106: -#line 290 "script_lexer.l" -case 107: -YY_RULE_SETUP -#line 290 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NACTION_RQ; return COMMANDFIELD; } - YY_BREAK -case 108: -#line 292 "script_lexer.l" -case 109: -YY_RULE_SETUP -#line 292 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NACTION_RSP; return COMMANDFIELD; } - YY_BREAK -case 110: -#line 294 "script_lexer.l" -case 111: -YY_RULE_SETUP -#line 294 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NCREATE_RQ; return COMMANDFIELD; } - YY_BREAK -case 112: -#line 296 "script_lexer.l" -case 113: -YY_RULE_SETUP -#line 296 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NCREATE_RSP; return COMMANDFIELD; } - YY_BREAK -case 114: -#line 298 "script_lexer.l" -case 115: -YY_RULE_SETUP -#line 298 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NDELETE_RQ; return COMMANDFIELD; } - YY_BREAK -case 116: -#line 300 "script_lexer.l" -case 117: -YY_RULE_SETUP -#line 300 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NDELETE_RSP; return COMMANDFIELD; } - YY_BREAK -case 118: -#line 302 "script_lexer.l" -case 119: -YY_RULE_SETUP -#line 302 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NEVENTREPORT_RQ; return COMMANDFIELD; } - YY_BREAK -case 120: -#line 304 "script_lexer.l" -case 121: -YY_RULE_SETUP -#line 304 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NEVENTREPORT_RSP; return COMMANDFIELD; } - YY_BREAK -case 122: -#line 306 "script_lexer.l" -case 123: -YY_RULE_SETUP -#line 306 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 124: -#line 308 "script_lexer.l" -case 125: -YY_RULE_SETUP -#line 308 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 126: -#line 310 "script_lexer.l" -case 127: -YY_RULE_SETUP -#line 310 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NSET_RQ; return COMMANDFIELD; } - YY_BREAK -case 128: -#line 312 "script_lexer.l" -case 129: -YY_RULE_SETUP -#line 312 "script_lexer.l" -{ script3lval.commandField = DIMSE_CMD_NSET_RSP; return COMMANDFIELD; } - YY_BREAK -case 130: -#line 315 "script_lexer.l" -case 131: -YY_RULE_SETUP -#line 315 "script_lexer.l" -{ return T_ASSOCIATE_RQ; } - YY_BREAK -case 132: -#line 317 "script_lexer.l" -case 133: -YY_RULE_SETUP -#line 317 "script_lexer.l" -{ return T_ASSOCIATE_AC; } - YY_BREAK -case 134: -#line 319 "script_lexer.l" -case 135: -YY_RULE_SETUP -#line 319 "script_lexer.l" -{ return T_ASSOCIATE_RJ; } - YY_BREAK -case 136: -#line 321 "script_lexer.l" -case 137: -YY_RULE_SETUP -#line 321 "script_lexer.l" -{ return T_RELEASE_RQ; } - YY_BREAK -case 138: -#line 323 "script_lexer.l" -case 139: -YY_RULE_SETUP -#line 323 "script_lexer.l" -{ return T_RELEASE_RP; } - YY_BREAK -case 140: -#line 325 "script_lexer.l" -case 141: -YY_RULE_SETUP -#line 325 "script_lexer.l" -{ return T_ABORT_RQ; } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 327 "script_lexer.l" -{ return T_ALL; } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 328 "script_lexer.l" -{ return T_WAREHOUSE; } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 329 "script_lexer.l" -{ return T_ASSOCIATION; } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 330 "script_lexer.l" -{ return T_RELATION; } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 331 "script_lexer.l" -{ return T_EXECUTION_CONTEXT; } - YY_BREAK -case 147: -#line 334 "script_lexer.l" -case 148: -YY_RULE_SETUP -#line 334 "script_lexer.l" -{ return T_PROT_VER; } - YY_BREAK -case 149: -#line 336 "script_lexer.l" -case 150: -YY_RULE_SETUP -#line 336 "script_lexer.l" -{ return T_CALLED_AE; } - YY_BREAK -case 151: -#line 338 "script_lexer.l" -case 152: -YY_RULE_SETUP -#line 338 "script_lexer.l" -{ return T_CALLING_AE; } - YY_BREAK -case 153: -#line 340 "script_lexer.l" -case 154: -YY_RULE_SETUP -#line 340 "script_lexer.l" -{ return T_APPL_CTX; } - YY_BREAK -case 155: -#line 342 "script_lexer.l" -case 156: -#line 343 "script_lexer.l" -case 157: -YY_RULE_SETUP -#line 343 "script_lexer.l" -{ return T_PRES_CTX; } - YY_BREAK -case 158: -#line 345 "script_lexer.l" -case 159: -YY_RULE_SETUP -#line 345 "script_lexer.l" -{ return T_MAX_LEN; } - YY_BREAK -case 160: -#line 347 "script_lexer.l" -case 161: -YY_RULE_SETUP -#line 347 "script_lexer.l" -{ return T_IMPL_CLASS; } - YY_BREAK -case 162: -#line 349 "script_lexer.l" -case 163: -YY_RULE_SETUP -#line 349 "script_lexer.l" -{ return T_IMPL_VER; } - YY_BREAK -case 164: -YY_RULE_SETUP -#line 350 "script_lexer.l" -{ return T_SOP_EXTEND_NEG; } - YY_BREAK -case 165: -YY_RULE_SETUP -#line 351 "script_lexer.l" -{ return T_SCPSCU_ROLE; } - YY_BREAK -case 166: -YY_RULE_SETUP -#line 352 "script_lexer.l" -{ return T_ASYNC_WINDOW; } - YY_BREAK -case 167: -YY_RULE_SETUP -#line 353 "script_lexer.l" -{ return T_USER_ID_NEG; } - YY_BREAK -case 168: -YY_RULE_SETUP -#line 354 "script_lexer.l" -{ return T_RESULT; } - YY_BREAK -case 169: -YY_RULE_SETUP -#line 355 "script_lexer.l" -{ return T_SOURCE; } - YY_BREAK -case 170: -#line 357 "script_lexer.l" -case 171: -YY_RULE_SETUP -#line 357 "script_lexer.l" -{ return T_REASON; } - YY_BREAK -case 172: -#line 360 "script_lexer.l" -case 173: -YY_RULE_SETUP -#line 360 "script_lexer.l" -{ return T_FILEHEAD; } - YY_BREAK -case 174: -#line 362 "script_lexer.l" -case 175: -YY_RULE_SETUP -#line 362 "script_lexer.l" -{ return T_FILETAIL; } - YY_BREAK -case 176: -YY_RULE_SETUP -#line 364 "script_lexer.l" -{ return T_FILE_PREAMBLE; } - YY_BREAK -case 177: -YY_RULE_SETUP -#line 365 "script_lexer.l" -{ return T_DICOM_PREFIX; } - YY_BREAK -case 178: -#line 367 "script_lexer.l" -case 179: -YY_RULE_SETUP -#line 367 "script_lexer.l" -{ return T_TRANSFER_SYNTAX; } - YY_BREAK -case 180: -#line 369 "script_lexer.l" -case 181: -YY_RULE_SETUP -#line 369 "script_lexer.l" -{ return T_SECTOR_SIZE; } - YY_BREAK -case 182: -#line 371 "script_lexer.l" -case 183: -YY_RULE_SETUP -#line 371 "script_lexer.l" -{ return T_DATASET_TRAILING_PADDING; } - YY_BREAK -case 184: -#line 373 "script_lexer.l" -case 185: -YY_RULE_SETUP -#line 373 "script_lexer.l" -{ return T_PADDING_VALUE; } - YY_BREAK -case 186: -YY_RULE_SETUP -#line 375 "script_lexer.l" -{ return T_AUTOSET; } - YY_BREAK -case 187: -#line 377 "script_lexer.l" -case 188: -YY_RULE_SETUP -#line 377 "script_lexer.l" -{ return T_DEFINED_LENGTH; } - YY_BREAK -case 189: -YY_RULE_SETUP -#line 379 "script_lexer.l" -{ return T_NO; } - YY_BREAK -case 190: -YY_RULE_SETUP -#line 380 "script_lexer.l" -{ return T_YES; } - YY_BREAK -case 191: -YY_RULE_SETUP -#line 382 "script_lexer.l" -{ return T_OFF; } - YY_BREAK -case 192: -YY_RULE_SETUP -#line 383 "script_lexer.l" -{ return T_ON; } - YY_BREAK -case 193: -YY_RULE_SETUP -#line 385 "script_lexer.l" -{ return T_AND; } - YY_BREAK -case 194: -YY_RULE_SETUP -#line 386 "script_lexer.l" -{ return T_OR; } - YY_BREAK -case 195: -YY_RULE_SETUP -#line 388 "script_lexer.l" -{ script3lval.iomLevel = IOM_PATIENT; return IOMLEVEL; } - YY_BREAK -case 196: -YY_RULE_SETUP -#line 389 "script_lexer.l" -{ script3lval.iomLevel = IOM_STUDY; return IOMLEVEL; } - YY_BREAK -case 197: -YY_RULE_SETUP -#line 390 "script_lexer.l" -{ script3lval.iomLevel = IOM_SERIES; return IOMLEVEL; } - YY_BREAK -case 198: -YY_RULE_SETUP -#line 391 "script_lexer.l" -{ script3lval.iomLevel = IOM_IMAGE; return IOMLEVEL; } - YY_BREAK -case 199: -#line 394 "script_lexer.l" -case 200: -YY_RULE_SETUP -#line 394 "script_lexer.l" -{ script3lval.userProvider = UP_ACCEPTOR; return USERPROVIDER; } - YY_BREAK -case 201: -#line 396 "script_lexer.l" -case 202: -YY_RULE_SETUP -#line 396 "script_lexer.l" -{ script3lval.userProvider = UP_REQUESTOR; return USERPROVIDER; } - YY_BREAK -case 203: -#line 399 "script_lexer.l" -case 204: -YY_RULE_SETUP -#line 399 "script_lexer.l" -{ script3lval.hex = strtoul(script3text, &pEnd, 16); return HEXADECIMAL; } - YY_BREAK -case 205: -#line 402 "script_lexer.l" -case 206: -YY_RULE_SETUP -#line 402 "script_lexer.l" -{ script3lval.integer = atoi(script3text); return INTEGER; } - YY_BREAK -case 207: -YY_RULE_SETUP -#line 404 "script_lexer.l" -{ strncpy(script3lval.identifier, script3text, sizeof(script3lval.identifier)); return IDENTIFIER; } - YY_BREAK -case 208: -YY_RULE_SETUP -#line 406 "script_lexer.l" -{ for (script3leng = script3leng-2; script3leng >= 0; script3leng--) - /* concatenate line */ - unput(script3text[script3leng]); - } - YY_BREAK -case 209: -YY_RULE_SETUP -#line 411 "script_lexer.l" -{ int i = 1, j = 0; - - script3lval.string_ptr = (char*) malloc(script3leng+1); - if (script3lval.string_ptr == NULL) - { - char message[128]; - sprintf(message, "STRING of %d chars too long for parser - string truncated!", - script3leng-2); - script3error(message); - - script3lval.string_ptr = (char*) malloc(MAX_STRING_LEN); - - script3leng = MAX_STRING_LEN - 1; - } - - while (i < (script3leng-1)) - { - script3lval.string_ptr[j++] = script3text[i++]; - } - - script3lval.string_ptr[j] = NULLCHAR; - return STRING; - } - YY_BREAK -case 210: -YY_RULE_SETUP -#line 435 "script_lexer.l" -{ return script3text[0]; } - YY_BREAK -case 211: -YY_RULE_SETUP -#line 436 "script_lexer.l" -ECHO; - YY_BREAK - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - script3text_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed script3in at a new source and called - * script3lex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = script3in; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = script3text_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = script3text_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( script3wrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * script3text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = script3text_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - script3text_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = script3text_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = script3text_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of script3lex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = script3text_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - script3text_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - script3text_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - script3restart( script3in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - script3text_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = script3text_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - yy_is_jam = (yy_current_state == 1201); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void script3unput( int c, register char *yy_bp ) -#else -static void script3unput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up script3text */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --script3lineno; - - script3text_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int script3input() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - script3text_ptr = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - if ( script3wrap() ) - { - yy_c_buf_p = - script3text_ptr + YY_MORE_ADJ; - return EOF; - } - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return script3input(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = script3text_ptr + YY_MORE_ADJ; - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in script3input()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve script3text */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++script3lineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void script3restart( FILE *input_file ) -#else -void script3restart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = script3_create_buffer( script3in, YY_BUF_SIZE ); - - script3_init_buffer( yy_current_buffer, input_file ); - script3_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void script3_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void script3_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - script3_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (script3wrap()) processing, but the only time this flag - * is looked at is after script3wrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void script3_load_buffer_state( void ) -#else -void script3_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - script3text_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - script3in = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script3_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE script3_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script3_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in script3_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - script3_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void script3_delete_buffer( YY_BUFFER_STATE b ) -#else -void script3_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void script3_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void script3_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - script3_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void script3_flush_buffer( YY_BUFFER_STATE b ) -#else -void script3_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - script3_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script3_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE script3_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script3_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - script3_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script3_scan_string( yyconst char *str ) -#else -YY_BUFFER_STATE script3_scan_string( str ) -yyconst char *str; -#endif - { - int len; - for ( len = 0; str[len]; ++len ) - ; - - return script3_scan_bytes( str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script3_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE script3_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in script3_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = script3_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in script3_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up script3text. */ \ - script3text[script3leng] = yy_hold_char; \ - yy_c_buf_p = script3text + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - script3leng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef script3text_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - script3lex(); - return 0; - } -#endif -#line 436 "script_lexer.l" - - -//>>=========================================================================== - -void script3error(char *errmsg) - -// DESCRIPTION : YACC/LEX error function called when parsing of the -// DICOMScript fails. -// PRECONDITIONS : -// POSTCONDITIONS : -// EXCEPTIONS : -// NOTES : -//<<=========================================================================== -{ - LOG_CLASS* logger_ptr = script3Session_ptr->getLogger(); - - logger_ptr->text(LOG_ERROR, 1, - "%s - parsing Test Script; line %ld of %s", VAL_PREFIX_FAILED, - script3CurrentFileOffset + (script3lineno - script3CurrentLineNo), - script3CurrentFilename); - logger_ptr->text( LOG_ERROR, 1, "%s - around token : \"%s\"", errmsg, script3text); - -} - - diff --git a/DVTk_Library/Libraries/Scripting/script3_parser.cpp b/DVTk_Library/Libraries/Scripting/script3_parser.cpp deleted file mode 100644 index c4e5b66..0000000 --- a/DVTk_Library/Libraries/Scripting/script3_parser.cpp +++ /dev/null @@ -1,5647 +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 script3error(char*); -extern int script3lex(void); -extern int script3lineno; - -extern SCRIPT_SESSION_CLASS *script3Session_ptr; - -typedef enum -{ - OPERAND_OR, - OPERAND_AND -} OPERAND_ENUM; - - -bool script3IsNativeVts = false; -char script3CurrentFilename[_MAX_PATH] = {" (not defined) "}; -long script3CurrentFileOffset = 0; -long script3CurrentLineNo = 0; -bool script3ParseOnly = 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 script3s!!! -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 script3r1[] = { 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 script3r2[] = { 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 script3defact[] = { 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 script3defgoto[] = { 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 script3pact[] = { 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 script3pgoto[] = {-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 script3errok (yyerrstatus = 0) -#define script3clearin (script3char = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto script3errlab1 -/* Like YYERROR except do call script3error. - 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 script3errlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (script3char == YYEMPTY && yylen == 1) \ - { script3char = (token), script3lval = (value); \ - script3char1 = YYTRANSLATE (script3char); \ - YYPOPSTACK; \ - goto script3backup; \ - } \ - else \ - { script3error ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX script3lex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX script3lex(&script3lval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX script3lex(&script3lval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX script3lex(&script3lval, YYLEX_PARAM) -#else -#define YYLEX script3lex(&script3lval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int script3char; /* the lookahead symbol */ -YYSTYPE script3lval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int script3nerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int script3debug; /* 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 script3parse (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 script3parse. 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 -script3parse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL -{ - register int script3state; - register int yyn; - register short *script3ssp; - register YYSTYPE *script3vsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int script3char1 = 0; /* lookahead token as an internal (translated) token number */ - - short script3ssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE script3vsa[YYINITDEPTH]; /* the semantic value stack */ - - short *script3ss = script3ssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *script3vs = script3vsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *script3lsp; - -#define YYPOPSTACK (script3vsp--, script3ssp--, script3lsp--) -#else -#define YYPOPSTACK (script3vsp--, script3ssp--) -#endif - - int script3stacksize = YYINITDEPTH; - -#ifdef YYPURE - int script3char; - YYSTYPE script3lval; - int script3nerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE script3val; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (script3debug) - fprintf(stderr, "Starting parse\n"); -#endif - - script3state = 0; - yyerrstatus = 0; - script3nerrs = 0; - script3char = 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. */ - - script3ssp = script3ss - 1; - script3vsp = script3vs; -#ifdef YYLSP_NEEDED - script3lsp = yyls; -#endif - -/* Push a new state, which is found in script3state . */ -/* 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: - - *++script3ssp = script3state; - - if (script3ssp >= script3ss + script3stacksize - 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 *script3vs1 = script3vs; - short *script3ss1 = script3ss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = script3ssp - script3ss + 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", - &script3ss1, size * sizeof (*script3ssp), - &script3vs1, size * sizeof (*script3vsp), - &yyls1, size * sizeof (*script3lsp), - &script3stacksize); -#else - yyoverflow("parser stack overflow", - &script3ss1, size * sizeof (*script3ssp), - &script3vs1, size * sizeof (*script3vsp), - &script3stacksize); -#endif - - script3ss = script3ss1; script3vs = script3vs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (script3stacksize >= YYMAXDEPTH) - { - script3error("parser stack overflow"); - return 2; - } - script3stacksize *= 2; - if (script3stacksize > YYMAXDEPTH) - script3stacksize = YYMAXDEPTH; - script3ss = (short *) alloca (script3stacksize * sizeof (*script3ssp)); - __yy_memcpy ((char *)script3ss1, (char *)script3ss, size * sizeof (*script3ssp)); - script3vs = (YYSTYPE *) alloca (script3stacksize * sizeof (*script3vsp)); - __yy_memcpy ((char *)script3vs1, (char *)script3vs, size * sizeof (*script3vsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (script3stacksize * sizeof (*script3lsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*script3lsp)); -#endif -#endif /* no yyoverflow */ - - script3ssp = script3ss + size - 1; - script3vsp = script3vs + size - 1; -#ifdef YYLSP_NEEDED - script3lsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (script3debug) - fprintf(stderr, "Stack size increased to %d\n", script3stacksize); -#endif - - if (script3ssp >= script3ss + script3stacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (script3debug) - fprintf(stderr, "Entering state %d\n", script3state); -#endif - - goto script3backup; - script3backup: - -/* 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 = script3pact[script3state]; - if (yyn == YYFLAG) - goto script3default; - - /* Not known => get a lookahead token if don't already have one. */ - - /* script3char is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (script3char == YYEMPTY) - { -#if YYDEBUG != 0 - if (script3debug) - fprintf(stderr, "Reading a token: "); -#endif - script3char = YYLEX; - } - - /* Convert token to internal form (in script3char1) for indexing tables with */ - - if (script3char <= 0) /* This means end of input. */ - { - script3char1 = 0; - script3char = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (script3debug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - script3char1 = YYTRANSLATE(script3char); - -#if YYDEBUG != 0 - if (script3debug) - { - fprintf (stderr, "Next token is %d (%s", script3char, yytname[script3char1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, script3char, script3lval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += script3char1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != script3char1) - goto script3default; - - 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 script3errlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto script3errlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (script3debug) - fprintf(stderr, "Shifting token %d (%s), ", script3char, yytname[script3char1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (script3char != YYEOF) - script3char = YYEMPTY; - - *++script3vsp = script3lval; -#ifdef YYLSP_NEEDED - *++script3lsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - script3state = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -script3default: - - yyn = script3defact[script3state]; - if (yyn == 0) - goto script3errlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = script3r2[yyn]; - if (yylen > 0) - script3val = script3vsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (script3debug) - { - 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[script3r1[yyn]]); - } -#endif - - - switch (yyn) { - -case 2: -#line 204 "script_parser.y" -{ - //cleanup - clearVTSUidMappings(); - ; - break;} -case 3: -#line 211 "script_parser.y" -{ - if (script3Session_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 4: -#line 218 "script_parser.y" -{ - if (script3Session_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 33: -#line 257 "script_parser.y" -{ - if (strcmp(script3vsp[0].string_ptr, "NATIVE_VTS") == 0) - { - script3IsNativeVts = true; - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[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 = script3Session_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(); - script3Session_ptr->resetAssociation(); - - // cleanup any outstanding relationships - // - from previous emulations / script3 executions - RELATIONSHIP->cleanup(); - - // reset the script3 execution context - script3Session_ptr->resetScriptExecutionContext(); - ; - break;} -case 35: -#line 295 "script_parser.y" -{ - // data warehouse should be emptied - LOG_CLASS *logger_ptr = script3Session_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 = script3Session_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."); - } - script3Session_ptr->resetAssociation(); - ; - break;} -case 37: -#line 322 "script_parser.y" -{ - // relation reset - // - backwards compatibility with VTS - LOG_CLASS *logger_ptr = script3Session_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 / script3 executions - RELATIONSHIP->cleanup(); - ; - break;} -case 38: -#line 339 "script_parser.y" -{ - // script3 execution context reset - LOG_CLASS *logger_ptr = script3Session_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 script3 execution context - script3Session_ptr->resetScriptExecutionContext(); - ; - break;} -case 39: -#line 356 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_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 (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_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 (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - BASE_CONFIRMER *confirmer_ptr = script3Session_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 434 "script_parser.y" -{ - if (!script3ParseOnly) - { - if ((wid1_ptr) && - (wid2_ptr)) - { - // copy the attribute in object 1 to that in object 2 - // - don't stop on returned error - copyAttribute(script3Session_ptr->getLogger(), wid1_ptr, group1, element1, wid2_ptr, group2, element2); - } - } - ; - break;} -case 44: -#line 452 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - // delay for given number of seconds - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DELAY %d seconds", script3vsp[0].integer); - } - - for (int sec = 0; sec < script3vsp[0].integer; sec++) - { - if (script3Session_ptr->isSessionStopped()) - { - YYACCEPT; - } -#ifdef _WINDOWS - Sleep(1000); -#else - sleep(1); -#endif - } - } - ; - break;} -case 47: -#line 484 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (wid1_ptr) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY object"); - } - - // display the referenced warehouse object - wid1_ptr->setLogger(script3Session_ptr->getLogger()); - - BASE_SERIALIZER *serializer_ptr = script3Session_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 (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY WAREHOUSE"); - } - WAREHOUSE->serialize(script3Session_ptr->getLogger()); - } - ; - break;} -case 49: -#line 575 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - // display string to user - logger_ptr->text(LOG_SCRIPT, 1, script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - - ; - break;} -case 53: -#line 602 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!sendAcse(script3Session_ptr, associateRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 54: -#line 609 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!sendAcse(script3Session_ptr, associateAc_ptr, identifier)) YYABORT; - } - ; - break;} -case 55: -#line 616 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!sendAcse(script3Session_ptr, associateRj_ptr, identifier)) YYABORT; - } - ; - break;} -case 56: -#line 623 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!sendAcse(script3Session_ptr, releaseRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 57: -#line 630 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!sendAcse(script3Session_ptr, releaseRp_ptr, identifier)) YYABORT; - } - ; - break;} -case 58: -#line 637 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!sendAcse(script3Session_ptr, abortRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 59: -#line 646 "script_parser.y" -{ - if (!script3ParseOnly) - { - /* Try to find the command object in the warehouse and send it */ - LOG_CLASS* logger_ptr = script3Session_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 (script3IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - resolveVTSUidMappings(cmd_ptr); - } - - if (!sendSop(script3Session_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 (!script3ParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = script3Session_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 (script3IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(script3Session_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 61: -#line 729 "script_parser.y" -{ - if (!script3ParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = script3Session_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 (script3IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(script3Session_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 63: -#line 786 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!importCommand(script3Session_ptr, commandField, identifier)) - { - YYABORT; - } - } - ; - break;} -case 64: -#line 796 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!importCommandDataset(script3Session_ptr, commandField, identifier, iodName, datasetidentifier)) - { - YYABORT; - } - } - ; - break;} -case 65: -#line 808 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setPopulateWithAttributes(true); - } - } - ; - break;} -case 66: -#line 825 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setPopulateWithAttributes(false); - } - } - ; - break;} -case 69: -#line 850 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - // set product role based on new setting for tool - if (script3vsp[0].userProvider == UP_REQUESTOR) - { - // tool role is now Requestor - // - product is therefore Acceptor - script3Session_ptr->setProductRoleIsRequestor(false); - script3Session_ptr->setProductRoleIsAcceptor(true); - } - else - { - // tool role is now Acceptor - // - product is therefore Requestor - script3Session_ptr->setProductRoleIsRequestor(true); - script3Session_ptr->setProductRoleIsAcceptor(false); - } - - if (logger_ptr) - { - if (script3vsp[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 (!script3ParseOnly) - { - // make system call within session - if (!systemCall(script3Session_ptr, script3vsp[0].string_ptr)) - { - YYABORT; - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 73: -#line 909 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_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 (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE ON"); - } - - // ignore command in debug mode - if (script3Session_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE ON"); - } - } - else - { - // enable the logger -// script3Session_ptr->enableLogger(); - - // resume the serializer -// BASE_SERIALIZER *serializer_ptr = script3Session_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Resume(); -// } - } - } - ; - break;} -case 76: -#line 973 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE OFF"); - } - - // ignore command in debug mode - if (script3Session_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE OFF"); - } - } - else - { - // disable the logger -// script3Session_ptr->disableLogger(); - - // pause the serializer -// BASE_SERIALIZER *serializer_ptr = script3Session_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Pause(); -// } - } - } - ; - break;} -case 78: -#line 1010 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "APPLICATION-ENTITY %s %s", script3vsp[-1].string_ptr, script3vsp[0].string_ptr); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setApplicationEntityName(script3vsp[-1].string_ptr); - script3ExecutionContext_ptr->setApplicationEntityVersion(script3vsp[0].string_ptr); - } - } - // free malloced string buffers - free(script3vsp[-1].string_ptr); - script3vsp[-1].string_ptr = NULL; - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - - ; - break;} -case 79: -#line 1036 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - switch(script3vsp[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 (script3vsp[0].validationFlag == (USE_DEFINITION | USE_VR)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-VR"); - else if (script3vsp[0].validationFlag == (USE_DEFINITION | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-REF"); - else if (script3vsp[0].validationFlag == (USE_VR | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-VR-AND-REF"); - break; - } - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setValidationFlag(script3vsp[0].validationFlag); - } - } - ; - break;} -case 80: -#line 1067 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setDefineSqLength(true); - } - } - ; - break;} -case 81: -#line 1084 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setDefineSqLength(false); - } - } - ; - break;} -case 82: -#line 1103 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setAddGroupLength(true); - } - } - ; - break;} -case 83: -#line 1120 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setAddGroupLength(false); - } - } - ; - break;} -case 84: -#line 1139 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setStrictValidation(true); - } - } - ; - break;} -case 85: -#line 1156 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script3ExecutionContext_ptr = script3Session_ptr->getScriptExecutionContext(); - if (script3ExecutionContext_ptr) - { - script3ExecutionContext_ptr->setStrictValidation(false); - } - } - ; - break;} -case 86: -#line 1175 "script_parser.y" -{ - if (!script3ParseOnly) - { - 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(script3Session_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 87: -#line 1214 "script_parser.y" -{ - if (!script3ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script3Session_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(script3Session_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) YYABORT; - } - - if (dataset_ptr) - { - if (!command_ptr) - { - compareDatasetValueWithWarehouse(script3Session_ptr->getLogger(), (char*)(iodName).c_str(), dataset_ptr); - } - - if (!storeObjectInWarehouse(script3Session_ptr->getLogger(), dataset_ptr->getIdentifier(), dataset_ptr)) - { - YYABORT; - } - else - { - LOG_CLASS *logger_ptr = script3Session_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 (!script3ParseOnly) - { - 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 = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // clean up - side effect of parser - delete dataset_ptr; - dataset_ptr = NULL; - - if (!storeObjectInWarehouse(script3Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 89: -#line 1290 "script_parser.y" -{ - if (!script3ParseOnly) - { - 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(script3Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 90: -#line 1311 "script_parser.y" -{ - if (!script3ParseOnly) - { - 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(script3Session_ptr->getLogger()); - - // use the item handle - if (item_handle_ptr->resolveReference() != NULL) - { - if (!storeObjectInWarehouse(script3Session_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 (!script3ParseOnly) - { - if (fileHead_ptr) - { - if (!storeObjectInWarehouse(script3Session_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 92: -#line 1358 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (fileTail_ptr) - { - if (!storeObjectInWarehouse(script3Session_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 93: -#line 1370 "script_parser.y" -{ - if (!script3ParseOnly) - { - 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(script3Session_ptr->getLogger(), identifier.c_str(), wid)) YYABORT; - } - ; - break;} -case 94: -#line 1419 "script_parser.y" -{ - if (!script3ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script3Session_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command delete - serializer_ptr->SerializeDSDeleteCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!removeObjectFromWarehouse(script3Session_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 (!script3ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script3Session_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(script3Session_ptr->getLogger(), datasetidentifier.c_str(), WID_DATASET)) - { - // then try deleting as an item - leave explicit WID_ITEM in call - if (!removeObjectFromWarehouse(script3Session_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 (!script3ParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(script3Session_ptr->getLogger(), identifier.c_str(), WID_FILEHEAD)) YYABORT; - } - ; - break;} -case 97: -#line 1471 "script_parser.y" -{ - if (!script3ParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(script3Session_ptr->getLogger(), identifier.c_str(), WID_FILETAIL)) YYABORT; - } - ; - break;} -case 98: -#line 1482 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(script3Session_ptr->getLogger(), script3Session_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 99: -#line 1493 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(script3Session_ptr->getLogger(), script3Session_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 100: -#line 1506 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!readFileDataset(script3Session_ptr, script3vsp[-1].string_ptr, dataset_ptr)) YYABORT; - } - // free malloced string buffer - free(script3vsp[-1].string_ptr); - script3vsp[-1].string_ptr = NULL; - - ; - break;} -case 101: -#line 1517 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!readFileDataset(script3Session_ptr, script3vsp[-1].string_ptr, script3vsp[0].hex)) YYABORT; - } - // free malloced string buffer - free(script3vsp[-1].string_ptr); - script3vsp[-1].string_ptr = NULL; - ; - break;} -case 102: -#line 1529 "script_parser.y" -{ - if (!script3ParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!receiveAcse(script3Session_ptr, associateRq_ptr, identifier)) - { - clearValidationObjects(script3Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!receiveAcse(script3Session_ptr, associateAc_ptr, identifier)) - { - clearValidationObjects(script3Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!receiveAcse(script3Session_ptr, associateRj_ptr, identifier)) - { - clearValidationObjects(script3Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!receiveAcse(script3Session_ptr, releaseRq_ptr, identifier)) - { - clearValidationObjects(script3Session_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!receiveAcse(script3Session_ptr, releaseRp_ptr, identifier)) - { - clearValidationObjects(script3Session_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!receiveAcse(script3Session_ptr, abortRq_ptr, identifier)) - { - clearValidationObjects(script3Session_ptr); - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!receiveAcse(script3Session_ptr, unknownPdu_ptr, identifier)) - { - clearValidationObjects(script3Session_ptr); - YYABORT; - } - - // parser cleanup - delete unknownPdu_ptr; - unknownPdu_ptr = NULL; - break; - default: break; - } - } - ; - break;} -case 103: -#line 1616 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!receiveSop(script3Session_ptr, command_ptr, dataset_ptr)) - { - clearValidationObjects(script3Session_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 (!script3ParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!sendAcse(script3Session_ptr, associateRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!sendAcse(script3Session_ptr, associateAc_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!sendAcse(script3Session_ptr, associateRj_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!sendAcse(script3Session_ptr, releaseRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!sendAcse(script3Session_ptr, releaseRp_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!sendAcse(script3Session_ptr, abortRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!sendAcse(script3Session_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 (!script3ParseOnly) - { - if (!sendSop(script3Session_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 (!script3ParseOnly) - { - // 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(script3Session_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 (!script3ParseOnly) - { - presContextId = (BYTE) script3vsp[-1].hex; - } - ; - break;} -case 108: -#line 1769 "script_parser.y" -{ - if (!script3ParseOnly) - { - presContextId = (BYTE) script3vsp[-1].integer; - } - ; - break;} -case 109: -#line 1778 "script_parser.y" -{ - if (!script3ParseOnly) - { - 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(script3Session_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 110: -#line 1817 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (command_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script3Session_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command set - serializer_ptr->SerializeDSSetCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!updateObjectInWarehouse(script3Session_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) - { - LOG_CLASS *logger_ptr = script3Session_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 (!script3ParseOnly) - { - if (dataset_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script3Session_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(script3Session_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 = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // then try updating as an item - if (!updateObjectInWarehouse(script3Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) - { - LOG_CLASS *logger_ptr = script3Session_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 (!script3ParseOnly) - { - if (fileHead_ptr) - { - if (!updateObjectInWarehouse(script3Session_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 113: -#line 1898 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (fileTail_ptr) - { - if (!updateObjectInWarehouse(script3Session_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 114: -#line 1910 "script_parser.y" -{ - if (!script3ParseOnly) - { - // try to validate the Sop Class - if (!validateSopAgainstList(script3Session_ptr, command_ptr, dataset_ptr)) - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(script3Session_ptr); - YYABORT; - } - else - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(script3Session_ptr); - } - } - ; - break;} -case 115: -#line 1934 "script_parser.y" -{ - if (!script3ParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = script3Session_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 (!script3ParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = script3Session_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 (!script3ParseOnly) - { - addReferenceObjects(script3Session_ptr,ref_command_ptr, ref_dataset_ptr, script3Session_ptr->getLogger()); - } - ; - break;} -case 119: -#line 1994 "script_parser.y" -{ - if (!script3ParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(script3Session_ptr,ref_command_ptr, ref_dataset_ptr, script3Session_ptr->getLogger()); - } - ; - break;} -case 120: -#line 2004 "script_parser.y" -{ - if (!script3ParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = script3Session_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 (!script3ParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = script3Session_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 (!script3ParseOnly) - { - // 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 (!script3ParseOnly) - { - addReferenceObjects(script3Session_ptr, command_ptr, dataset_ptr, script3Session_ptr->getLogger()); - } - ; - break;} -case 124: -#line 2082 "script_parser.y" -{ - if (!script3ParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(script3Session_ptr, command_ptr, dataset_ptr, script3Session_ptr->getLogger()); - } - ; - break;} -case 125: -#line 2090 "script_parser.y" -{ - if (!script3ParseOnly) - { - setLogicalOperand(OPERAND_AND); - addReferenceObjects(script3Session_ptr, command_ptr, dataset_ptr, script3Session_ptr->getLogger()); - } - ; - break;} -case 126: -#line 2100 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!writeFileHead(script3Session_ptr->getLogger(), script3vsp[-1].string_ptr, script3Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script3vsp[-1].string_ptr); - script3vsp[-1].string_ptr = NULL; - ; - break;} -case 127: -#line 2110 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!writeFileTail(script3Session_ptr->getLogger(), script3vsp[-1].string_ptr, script3Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script3vsp[-1].string_ptr); - script3vsp[-1].string_ptr = NULL; - ; - break;} -case 128: -#line 2120 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (!writeFileDataset(script3Session_ptr->getLogger(), script3vsp[-1].string_ptr, dataset_ptr,script3Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script3vsp[-1].string_ptr); - script3vsp[-1].string_ptr = NULL; - ; - break;} -case 142: -#line 2149 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store the user information - associateRq_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 145: -#line 2164 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set associate request protocol version parameter - associateRq_ptr->setProtocolVersion((UINT16) script3vsp[0].integer); - } - ; - break;} -case 146: -#line 2172 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - if (strlen(script3vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", script3vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request called Ae title parameter - associateRq_ptr->setCalledAeTitle((char*) script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 147: -#line 2196 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - if (strlen(script3vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", script3vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request calling Ae title parameter - associateRq_ptr->setCallingAeTitle((char*) script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 148: -#line 2220 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // set associate request application context parameter - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[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*) script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 150: -#line 2245 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) script3vsp[0].integer); - } - ; - break;} -case 151: -#line 2253 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 152: -#line 2277 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) script3vsp[0].string_ptr); - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 155: -#line 2291 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) script3vsp[-1].integer, (UINT16) script3vsp[0].integer); - } - ; - break;} -case 162: -#line 2311 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[-3].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script3vsp[-3].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script3vsp[-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 (!script3ParseOnly) - { - convertHex(script3vsp[-7].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[-7].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script3vsp[-7].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script3vsp[-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) script3vsp[-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 = script3vsp[-5].integer; - int scpRole = script3vsp[-3].integer; - - // check if roles explicitly defined by script3s - 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(script3vsp[-7].string_ptr); - script3vsp[-7].string_ptr = NULL; - ; - break;} -case 164: -#line 2427 "script_parser.y" -{ - if (!script3ParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 165: -#line 2435 "script_parser.y" -{ - if (!script3ParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 166: -#line 2445 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - transferSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - transferSyntaxName.setUid((char*) script3vsp[0].string_ptr); - - // check that we now have a valid transfer syntax - if (!transferSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script3vsp[0].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 169: -#line 2487 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[-3].string_ptr); - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassExtended.setUid((char*) uid.c_str()); - } - else - { - // store given uid - sopClassExtended.setUid((char*) script3vsp[-3].string_ptr); - - // check that we now have a valid transfer syntax - if (!sopClassExtended.isUidValid()) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script3vsp[-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(script3vsp[-3].string_ptr); - script3vsp[-3].string_ptr = NULL; - ; - break;} -case 172: -#line 2533 "script_parser.y" -{ - if (!script3ParseOnly) - { - // handle application info bytes - sopClassExtended.addApplicationInformation((BYTE) script3vsp[0].integer); - } - ; - break;} -case 175: -#line 2547 "script_parser.y" -{ - if (!script3ParseOnly) - { - UID_CLASS sopClassUid; - - convertHex(script3vsp[-5].string_ptr); - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[-5].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassUid.set((char*) uid.c_str()); - } - else - { - // store given uid - sopClassUid.set((char*) script3vsp[-5].string_ptr); - - // check that we now have a valid abstract syntax - if (!sopClassUid.isValid()) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script3vsp[-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) script3vsp[-3].integer); - scpScuRoleSelect.setScuRole((BYTE) script3vsp[-1].integer); - - // store scp scu role select - userInformation.addScpScuRoleSelect(scpScuRoleSelect); - } - // free malloced string buffer - free(script3vsp[-5].string_ptr); - script3vsp[-5].string_ptr = NULL; - ; - break;} -case 176: -#line 2595 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) script3vsp[-2].integer, (BYTE) script3vsp[-1].integer, script3vsp[0].string_ptr); - } - - // free malloced string buffer - free(script3vsp[0].string_ptr); - ; - break;} -case 177: -#line 2606 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) script3vsp[-3].integer, (BYTE) script3vsp[-2].integer, script3vsp[-1].string_ptr, script3vsp[0].string_ptr); - } - - // free malloced string buffer - free(script3vsp[-1].string_ptr); - free(script3vsp[0].string_ptr); - ; - break;} -case 178: -#line 2618 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation(script3vsp[0].string_ptr); - } - - // free malloced string buffer - free(script3vsp[0].string_ptr); - ; - break;} -case 180: -#line 2632 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store the user information - associateAc_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 183: -#line 2647 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set associate accept protocol version parameter - associateAc_ptr->setProtocolVersion((UINT16) script3vsp[0].integer); - } - ; - break;} -case 184: -#line 2655 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - if (strlen(script3vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", script3vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept called Ae title parameter - associateAc_ptr->setCalledAeTitle((char*) script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 185: -#line 2679 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - if (strlen(script3vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", script3vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept calling Ae title parameter - associateAc_ptr->setCallingAeTitle((char*) script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 186: -#line 2703 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // set associate accept application context parameter - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[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*) script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 188: -#line 2728 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) script3vsp[0].integer); - } - ; - break;} -case 189: -#line 2736 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 190: -#line 2760 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) script3vsp[0].string_ptr); - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 193: -#line 2774 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) script3vsp[-1].integer, (UINT16) script3vsp[0].integer); - } - ; - break;} -case 199: -#line 2793 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[-4].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[-4].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script3vsp[-4].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script3vsp[-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) script3vsp[-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(script3vsp[-4].string_ptr); - script3vsp[-4].string_ptr = NULL; - ; - break;} -case 200: -#line 2848 "script_parser.y" -{ - if (!script3ParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 202: -#line 2859 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[-2].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script3Session_ptr->getSopUid((char*) script3vsp[-2].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script3vsp[-2].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script3vsp[-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) script3vsp[-6].integer); - - // store the result - presAcContext.setResultReason((BYTE) script3vsp[-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) script3vsp[-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(script3vsp[-2].string_ptr); - script3vsp[-2].string_ptr = NULL; - ; - break;} -case 203: -#line 2929 "script_parser.y" -{ - if (!script3ParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 204: -#line 2937 "script_parser.y" -{ - if (!script3ParseOnly) - { - assocAcScuScpRolesDefined = false; - int scuRole = script3vsp[-4].integer; - int scpRole = script3vsp[-2].integer; - - // check if roles explicitly defined by script3s - 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 (!script3ParseOnly) - { - // set associate reject result parameter - associateRj_ptr->setResult((BYTE) script3vsp[0].integer); - } - ; - break;} -case 210: -#line 2974 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set associate reject source parameter - associateRj_ptr->setSource((BYTE) script3vsp[0].integer); - } - ; - break;} -case 211: -#line 2982 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set associate reject reason parameter - associateRj_ptr->setReason((BYTE) script3vsp[0].integer); - } - ; - break;} -case 218: -#line 3006 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set abort request source parameter - abortRq_ptr->setSource((BYTE) script3vsp[0].integer); - } - ; - break;} -case 219: -#line 3014 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set abort request reason parameter - abortRq_ptr->setReason((BYTE) script3vsp[0].integer); - } - ; - break;} -case 220: -#line 3024 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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(script3Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script3Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 221: -#line 3049 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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(script3Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_AC; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script3Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 222: -#line 3074 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set up default associate reject details - associateRj_ptr = new ASSOCIATE_RJ_CLASS(); - - // cascade the logger - associateRj_ptr->setLogger(script3Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RJ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script3Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 223: -#line 3094 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set up default release request details - releaseRq_ptr = new RELEASE_RQ_CLASS(); - - // cascade the logger - releaseRq_ptr->setLogger(script3Session_ptr->getLogger()); - - acseType = PDU_RELEASE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script3Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 224: -#line 3114 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set up default release response details - releaseRp_ptr = new RELEASE_RP_CLASS(); - - // cascade the logger - releaseRp_ptr->setLogger(script3Session_ptr->getLogger()); - - acseType = PDU_RELEASE_RP; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script3Session_ptr->getInstanceId()); - identifier = buffer; - - } - ; - break;} -case 225: -#line 3135 "script_parser.y" -{ - if (!script3ParseOnly) - { - // set up default abort request details - abortRq_ptr = new ABORT_RQ_CLASS(); - - // cascade the logger - abortRq_ptr->setLogger(script3Session_ptr->getLogger()); - - acseType = PDU_ABORT_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script3Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 233: -#line 3168 "script_parser.y" -{ - if (!script3ParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField); - - // cascade the logger - command_ptr->setLogger(script3Session_ptr->getLogger()); - dataset_ptr = NULL; - identifier = ""; - } - ; - break;} -case 234: -#line 3181 "script_parser.y" -{ - if (!script3ParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField, identifier); - - // cascade the logger - command_ptr->setLogger(script3Session_ptr->getLogger()); - dataset_ptr = NULL; - } - ; - break;} -case 235: -#line 3195 "script_parser.y" -{ - if (!script3ParseOnly) - { - // save command field locally - commandField = script3lval.commandField; - } - ; - break;} -case 236: -#line 3205 "script_parser.y" -{ - if (!script3ParseOnly) - { - // save identifier locally - identifier = script3lval.identifier; - } - ; - break;} -case 242: -#line 3226 "script_parser.y" -{ - if (!script3ParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName); - - // cascade the logger - dataset_ptr->setLogger(script3Session_ptr->getLogger()); - - bool addGroupLength = script3Session_ptr->getAddGroupLength(); - bool populateWithAttributes = script3Session_ptr->getAutoType2Attributes(); - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - addGroupLength = script3Session_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = script3Session_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = script3Session_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 (!script3ParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName, datasetidentifier); - - bool addGroupLength = script3Session_ptr->getAddGroupLength(); - bool populateWithAttributes = script3Session_ptr->getAutoType2Attributes(); - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - addGroupLength = script3Session_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = script3Session_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = script3Session_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 (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // save iod name locally - // - check first for iod name mapping - iodName = script3Session_ptr->getIodName((char*) script3vsp[0].string_ptr); - if (!iodName.length()) - { - // no name mapping - take iod name directly - iodName = (char*) script3vsp[0].string_ptr; - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 248: -#line 3311 "script_parser.y" -{ - if (!script3ParseOnly) - { - // save identifier locally - datasetidentifier = script3vsp[0].identifier; - } - ; - break;} -case 249: -#line 3319 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // save the identifier locally - datasetidentifier = script3vsp[0].string_ptr; - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 250: -#line 3333 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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 (!script3ParseOnly) - { - // 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 (!script3ParseOnly) - { - // 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(script3Session_ptr->getLogger()); - } - ; - break;} -case 254: -#line 3396 "script_parser.y" -{ - if (!script3ParseOnly) - { - // instantiate a new attribute - attribute_ptr[nd] = new DCM_ATTRIBUTE_CLASS(group, element); - - // cascade the logger - attribute_ptr[nd]->setLogger(script3Session_ptr->getLogger()); - - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - attribute_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 255: -#line 3416 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store tag locally - group = (UINT16) (script3lval.hex >> 16); - element = (UINT16) (script3lval.hex & 0x0000FFFF); - } - ; - break;} -case 258: -#line 3431 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (nd == 0) - { - LOG_CLASS *logger_ptr = script3Session_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 (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_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 = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 260: -#line 3491 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_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 = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 263: -#line 3533 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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(script3Session_ptr->getLogger()); - - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_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(script3Session_ptr->getLogger()); - - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 264: -#line 3576 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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(script3Session_ptr->getLogger()); - - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_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(script3Session_ptr->getLogger()); - - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 265: -#line 3620 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - // store item - identifier - item_ptr[nd]->setIdentifier(script3vsp[0].string_ptr); - item_ptr[nd]->setValueByReference(true); - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 266: -#line 3635 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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(script3Session_ptr->getLogger()); - - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_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(script3Session_ptr->getLogger()); - - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 267: -#line 3673 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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(script3Session_ptr->getLogger()); - - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_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(script3Session_ptr->getLogger()); - - bool definedLength = script3Session_ptr->getDefineSqLength(); - if (script3Session_ptr->getScriptExecutionContext()) - { - definedLength = script3Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 272: -#line 3721 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store item - attribute value - item_ptr[nd]->AddAttribute(attribute_ptr[nd]); - } - ; - break;} -case 274: -#line 3734 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_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", script3lineno); - } - 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", script3lineno); - } - YYABORT; - } - - // store attribute vr - attribute_ptr[nd]->SetVR(vr); - attribute_ptr[nd]->setDefinedLength(false); - } - ; - break;} -case 275: -#line 3767 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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 (!script3ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script3lval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = false; - } - ; - break;} -case 277: -#line 3789 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script3lval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = true; - } - ; - break;} -case 278: -#line 3799 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script3lval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = false; - } - ; - break;} -case 279: -#line 3809 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script3lval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = true; - } - ; - break;} -case 280: -#line 3819 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script3lval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = false; - } - ; - break;} -case 281: -#line 3829 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script3lval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = true; - } - ; - break;} -case 284: -#line 3845 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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 (!script3ParseOnly) - { - // 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 (!script3ParseOnly) - { - // special check for the Image Display Format ID / Pixel Data / FMI version attribute - // - these need to be handled differently for the ADVT script3s - if (((group == 0x2010) && - (element == 0x0010)) || - ((group == 0x7FE0) && - (element == 0x0010)) || - ((group == 0x0002) && - (element == 0x0001))) - { - convertDoubleBackslash(script3vsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(script3Session_ptr, script3vsp[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(script3vsp[0].string_ptr); - } - else - { - convertHex(script3vsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(script3Session_ptr, script3vsp[0].string_ptr, vr, group, element); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 287: -#line 3939 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store hex attribute value locally - value_ptr = hexValue(script3Session_ptr, script3vsp[0].hex, vr, group, element); - } - ; - break;} -case 288: -#line 3947 "script_parser.y" -{ - if (!script3ParseOnly) - { - // store integer attribute value locally - value_ptr = integerValue(script3Session_ptr, script3vsp[0].integer, vr, group, element); - } - ; - break;} -case 289: -#line 3955 "script_parser.y" -{ - if (!script3ParseOnly) - { - // autoset attribute value - value_ptr = autoSetValue(script3Session_ptr, vr, group, element); - } - ; - break;} -case 290: -#line 3964 "script_parser.y" -{ - if (!script3ParseOnly) - { - // copy tag to reference one - group1 = group; - element1 = element; - } - ; - break;} -case 291: -#line 3975 "script_parser.y" -{ - if (!script3ParseOnly) - { - // 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 (!script3ParseOnly) - { - // look up tag by name and get group & element returned - group = 0; - element = 0; - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 294: -#line 4003 "script_parser.y" -{ - if (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid1_ptr = retrieveFromWarehouse(script3Session_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 (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid1_ptr = retrieveFromWarehouse(script3Session_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(script3Session_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(script3Session_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 (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid2_ptr = retrieveFromWarehouse(script3Session_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 (!script3ParseOnly) - { - LOG_CLASS *logger_ptr = script3Session_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid2_ptr = retrieveFromWarehouse(script3Session_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(script3Session_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(script3Session_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 (!script3ParseOnly) - { - // 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 (!script3ParseOnly) - { - // 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 (!script3ParseOnly) - { - // default Item Number is 1 - index is then zero - itemNumber = 0; - } - ; - break;} -case 301: -#line 4175 "script_parser.y" -{ - if (!script3ParseOnly) - { - // take given Item Number - index is one less - itemNumber = script3vsp[-1].integer - 1; - } - ; - break;} -case 304: -#line 4189 "script_parser.y" -{ - if (!script3ParseOnly) - { - fileHead_ptr = new FILEHEAD_CLASS(); - - // cascade the logger - fileHead_ptr->setLogger(script3Session_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 310: -#line 4212 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPreambleValue(script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 311: -#line 4228 "script_parser.y" -{ - if (!script3ParseOnly) - { - convertHex(script3vsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPrefix(script3vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script3vsp[0].string_ptr); - script3vsp[0].string_ptr = NULL; - ; - break;} -case 312: -#line 4244 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (fileHead_ptr) - { - fileHead_ptr->setTransferSyntaxUid(transferSyntaxName.getUid()); - } - } - ; - break;} -case 315: -#line 4260 "script_parser.y" -{ - if (!script3ParseOnly) - { - fileTail_ptr = new FILETAIL_CLASS(); - - // cascade the logger - fileTail_ptr->setLogger(script3Session_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 321: -#line 4283 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(true); - } - } - ; - break;} -case 322: -#line 4293 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(false); - } - } - ; - break;} -case 323: -#line 4305 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setSectorSize(script3vsp[0].integer); - } - } - ; - break;} -case 324: -#line 4317 "script_parser.y" -{ - if (!script3ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setPaddingValue((BYTE)script3vsp[0].integer); - } - } - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "bison.simple" - - script3vsp -= yylen; - script3ssp -= yylen; -#ifdef YYLSP_NEEDED - script3lsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (script3debug) - { - short *ssp1 = script3ss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != script3ssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++script3vsp = script3val; - -#ifdef YYLSP_NEEDED - script3lsp++; - if (yylen == 0) - { - script3lsp->first_line = yylloc.first_line; - script3lsp->first_column = yylloc.first_column; - script3lsp->last_line = (script3lsp-1)->last_line; - script3lsp->last_column = (script3lsp-1)->last_column; - script3lsp->text = 0; - } - else - { - script3lsp->last_line = (script3lsp+yylen-1)->last_line; - script3lsp->last_column = (script3lsp+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 = script3r1[yyn]; - - script3state = script3pgoto[yyn - YYNTBASE] + *script3ssp; - if (script3state >= 0 && script3state <= YYLAST && yycheck[script3state] == *script3ssp) - script3state = yytable[script3state]; - else - script3state = script3defgoto[yyn - YYNTBASE]; - - goto yynewstate; - -script3errlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++script3nerrs; - -#ifdef YYERROR_VERBOSE - yyn = script3pact[script3state]; - - 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++; - } - } - script3error(msg); - free(msg); - } - else - script3error ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - script3error("parse error"); - } - - goto script3errlab1; -script3errlab1: /* 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 (script3char == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (script3debug) - fprintf(stderr, "Discarding token %d (%s).\n", script3char, yytname[script3char1]); -#endif - - script3char = 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 = script3defact[script3state]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto script3default; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (script3ssp == script3ss) YYABORT; - script3vsp--; - script3state = *--script3ssp; -#ifdef YYLSP_NEEDED - script3lsp--; -#endif - -#if YYDEBUG != 0 - if (script3debug) - { - short *ssp1 = script3ss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != script3ssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = script3pact[script3state]; - 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 (script3debug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++script3vsp = script3lval; -#ifdef YYLSP_NEEDED - *++script3lsp = yylloc; -#endif - - script3state = yyn; - goto yynewstate; -} -#line 4327 "script_parser.y" - - diff --git a/DVTk_Library/Libraries/Scripting/script3_parser.cpp.h b/DVTk_Library/Libraries/Scripting/script3_parser.cpp.h deleted file mode 100644 index fa81bf0..0000000 --- a/DVTk_Library/Libraries/Scripting/script3_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 script3lval; diff --git a/DVTk_Library/Libraries/Scripting/script4_lexer.cpp b/DVTk_Library/Libraries/Scripting/script4_lexer.cpp deleted file mode 100644 index 2cb651a..0000000 --- a/DVTk_Library/Libraries/Scripting/script4_lexer.cpp +++ /dev/null @@ -1,3409 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE script4restart( script4in ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int script4leng; -extern FILE *script4in, *script4out; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up script4text. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up script4text again */ \ - } \ - while ( 0 ) - -#define unput(c) script4unput( c, script4text_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via script4restart()), so that the user can continue scanning by - * just pointing script4in at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when script4text is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int script4leng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow script4wrap()'s to do buffer switches - * instead of setting up a fresh script4in. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void script4restart YY_PROTO(( FILE *input_file )); - -void script4_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void script4_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE script4_create_buffer YY_PROTO(( FILE *file, int size )); -void script4_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void script4_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void script4_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER script4_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE script4_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE script4_scan_string YY_PROTO(( yyconst char *str )); -YY_BUFFER_STATE script4_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer script4_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script4_create_buffer( script4in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script4_create_buffer( script4in, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define script4wrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *script4in = (FILE *) 0, *script4out = (FILE *) 0; -typedef int yy_state_type; -#define YY_FLEX_LEX_COMPAT -extern int script4lineno; -int script4lineno = 1; -extern char script4text[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up script4text. - */ -#define YY_DO_BEFORE_ACTION \ - script4text_ptr = yy_bp; \ - script4text_ptr -= yy_more_len; \ - script4leng = (int) (yy_cp - script4text_ptr); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( script4leng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( script4text, script4text_ptr, script4leng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 211 -#define YY_END_OF_BUFFER 212 -static yyconst short int yy_acclist[969] = - { 0, - 212, 210, 211, 7, 210, 211, 7, 211, 210, 211, - 210, 211, 12, 210, 211, 14, 210, 211, 210, 211, - 206, 210, 211, 206, 210, 211, 10, 210, 211, 9, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 11, 210, 211, 13, 210, 211, 1, 210, - 211, 7, 210, 211, 6, 7, 211, 210, 211, 7, - 209, 5, 205, 206, 207, 207, 207, 207, 15, 207, - - 207, 207, 207, 16, 207, 17, 207, 207, 207, 207, - 207, 207, 18, 207, 207, 19, 207, 207, 207, 20, - 207, 21, 207, 207, 207, 207, 22, 207, 207, 23, - 207, 207, 24, 207, 207, 25, 207, 26, 207, 207, - 189, 207, 207, 27, 207, 28, 207, 192, 207, 194, - 207, 29, 207, 30, 207, 207, 31, 207, 207, 207, - 207, 207, 207, 207, 32, 207, 33, 207, 207, 34, - 207, 35, 207, 36, 207, 207, 207, 37, 207, 207, - 38, 207, 39, 207, 40, 207, 41, 207, 42, 207, - 43, 207, 207, 207, 207, 207, 207, 8, 7, 6, - - 7, 4, 5, 208, 203, 204, 204, 203, 207, 207, - 207, 142, 207, 193, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 191, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 199, 207, 207, 201, 207, 207, - 207, 207, 47, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 190, 207, 4, 2, - 4, 5, 207, 207, 207, 207, 207, 207, 207, 207, - - 207, 207, 207, 207, 50, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 58, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 52, 207, 207, 207, 207, 207, 207, - 207, 207, 59, 207, 207, 207, 207, 44, 207, 207, - 207, 207, 207, 207, 55, 207, 207, 207, 207, 207, - 207, 207, 207, 2, 4, 3, 4, 5, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - - 61, 207, 207, 207, 207, 207, 207, 207, 207, 198, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 45, 207, 207, 207, 207, 207, 207, - 207, 207, 196, 207, 207, 207, 207, 207, 207, 207, - 53, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 46, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 51, 207, 207, 207, 207, 207, - 83, 207, 207, 207, 207, 82, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 177, - - 207, 207, 207, 171, 207, 207, 207, 207, 207, 168, - 207, 207, 207, 207, 197, 207, 169, 207, 207, 54, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 186, 207, 140, 207, 207, 207, 207, 207, 48, 207, - 60, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 57, 207, 69, 207, 81, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 195, - 207, 207, 207, 207, 207, 207, 80, 207, 207, 207, - 207, 207, 207, 207, 207, 56, 67, 207, 207, 141, - 200, 207, 207, 207, 207, 207, 207, 93, 207, 207, - - 207, 207, 207, 207, 92, 207, 207, 207, 207, 207, - 207, 76, 207, 207, 207, 207, 77, 207, 207, 123, - 127, 207, 207, 207, 207, 122, 207, 207, 126, 207, - 207, 207, 65, 207, 176, 207, 207, 207, 207, 145, - 207, 207, 207, 207, 79, 207, 78, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 85, 89, 95, 97, - 207, 207, 207, 207, 84, 207, 207, 88, 207, 207, - 94, 207, 96, 207, 207, 207, 207, 207, 173, 175, - 172, 207, 174, 207, 207, 207, 125, 129, 207, 207, - 207, 207, 124, 207, 128, 207, 207, 207, 207, 207, - - 202, 207, 207, 207, 207, 143, 207, 207, 207, 207, - 207, 207, 87, 91, 99, 101, 207, 207, 207, 207, - 86, 207, 90, 207, 98, 207, 100, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 139, 137, 207, 207, 68, 207, 207, 144, 207, - 207, 207, 207, 105, 103, 207, 207, 49, 207, 104, - 207, 102, 207, 207, 207, 207, 207, 107, 111, 115, - 106, 207, 207, 110, 207, 207, 114, 207, 207, 207, - 207, 207, 207, 207, 181, 180, 207, 207, 207, 133, - 135, 131, 207, 207, 138, 207, 136, 207, 207, 207, - - 207, 207, 207, 207, 109, 113, 117, 108, 207, 112, - 207, 116, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 185, - 184, 207, 207, 207, 207, 207, 207, 132, 207, 134, - 207, 130, 207, 207, 207, 207, 188, 187, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 150, 149, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 179, 178, - 207, 63, 207, 152, 151, 207, 207, 64, 207, 207, - 207, 207, 207, 148, 147, 207, 207, 207, 207, 207, - 207, 207, 119, 118, 207, 207, 207, 170, 207, 66, - - 62, 207, 207, 207, 207, 207, 121, 120, 207, 207, - 207, 207, 71, 207, 207, 207, 207, 207, 207, 70, - 72, 207, 207, 207, 156, 155, 207, 207, 207, 207, - 207, 207, 165, 207, 207, 73, 75, 207, 207, 207, - 207, 207, 74, 207, 207, 159, 158, 207, 154, 153, - 207, 183, 182, 207, 161, 160, 207, 207, 146, 207, - 167, 207, 157, 163, 162, 207, 166, 164 - } ; - -static yyconst short int yy_accept[1203] = - { 0, - 1, 1, 1, 2, 4, 7, 9, 11, 13, 16, - 19, 21, 24, 27, 30, 33, 35, 37, 39, 41, - 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, - 63, 65, 67, 69, 71, 73, 76, 79, 82, 85, - 88, 90, 91, 91, 92, 92, 92, 93, 94, 95, - 95, 96, 97, 98, 99, 101, 102, 103, 104, 106, - 108, 109, 110, 110, 111, 112, 113, 115, 116, 118, - 119, 120, 122, 124, 125, 126, 127, 129, 130, 132, - 133, 135, 136, 138, 140, 141, 141, 143, 144, 146, - 148, 150, 152, 154, 156, 157, 159, 160, 161, 162, - - 163, 164, 165, 167, 169, 170, 172, 174, 176, 177, - 178, 180, 181, 183, 185, 187, 189, 191, 193, 194, - 195, 196, 197, 198, 199, 200, 202, 202, 202, 204, - 204, 204, 204, 205, 207, 208, 209, 210, 211, 212, - 214, 216, 217, 218, 219, 220, 221, 222, 222, 222, - 222, 222, 222, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 246, 246, - 246, 246, 246, 246, 247, 248, 249, 250, 251, 252, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - - 264, 265, 267, 268, 270, 271, 272, 273, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 289, 289, 290, 290, 290, 290, 293, 294, 295, - 295, 296, 297, 298, 299, 300, 301, 302, 302, 302, - 302, 302, 302, 302, 303, 304, 305, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 331, 331, 331, 331, 331, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, - - 357, 358, 360, 361, 361, 362, 363, 364, 365, 367, - 368, 369, 370, 371, 372, 373, 374, 374, 376, 376, - 379, 379, 380, 381, 381, 382, 383, 384, 385, 386, - 387, 388, 388, 388, 388, 388, 388, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 403, 404, 405, 406, 407, 408, 409, 409, 410, - 412, 413, 414, 415, 416, 416, 416, 416, 416, 416, - 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 436, - 437, 438, 439, 440, 441, 441, 442, 443, 445, 446, - - 447, 447, 448, 449, 450, 451, 453, 453, 454, 454, - 455, 456, 457, 458, 459, 460, 461, 461, 461, 461, - 461, 461, 461, 462, 463, 464, 465, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 477, 478, 479, 480, - 481, 483, 483, 483, 484, 485, 486, 488, 489, 490, - 490, 490, 490, 490, 490, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 502, 503, 504, 506, - 507, 508, 509, 510, 512, 513, 514, 515, 517, 517, - 519, 520, 522, 523, 523, 524, 525, 526, 527, 527, - 528, 528, 529, 530, 531, 533, 535, 536, 537, 537, - - 537, 537, 537, 537, 537, 537, 538, 539, 541, 543, - 544, 545, 546, 547, 548, 549, 550, 550, 551, 552, - 554, 556, 558, 558, 558, 559, 560, 561, 562, 563, - 563, 563, 563, 563, 563, 563, 564, 565, 566, 567, - 568, 569, 570, 572, 573, 574, 575, 576, 577, 579, - 580, 581, 582, 582, 582, 582, 583, 583, 583, 584, - 584, 585, 586, 589, 590, 591, 593, 593, 594, 595, - 596, 597, 598, 598, 598, 598, 599, 599, 599, 599, - 599, 600, 600, 601, 602, 603, 604, 605, 607, 608, - 609, 610, 610, 611, 611, 611, 612, 614, 614, 614, - - 614, 615, 616, 617, 619, 619, 620, 620, 620, 620, - 620, 621, 621, 622, 622, 623, 624, 625, 626, 628, - 629, 631, 632, 632, 633, 635, 637, 638, 639, 640, - 642, 642, 643, 643, 643, 643, 644, 644, 644, 645, - 645, 647, 649, 650, 651, 651, 652, 653, 654, 655, - 656, 657, 657, 658, 658, 659, 659, 660, 661, 661, - 661, 661, 662, 662, 663, 664, 665, 667, 668, 670, - 671, 673, 675, 676, 677, 677, 678, 678, 678, 679, - 679, 680, 681, 683, 685, 686, 686, 687, 687, 687, - 687, 687, 688, 689, 690, 691, 692, 693, 695, 697, - - 697, 698, 699, 699, 700, 701, 701, 703, 703, 703, - 703, 704, 704, 704, 704, 705, 705, 706, 708, 708, - 709, 709, 710, 711, 712, 713, 713, 714, 715, 716, - 717, 717, 717, 718, 718, 719, 720, 721, 723, 725, - 727, 729, 730, 730, 731, 731, 731, 732, 732, 733, - 733, 734, 734, 734, 734, 734, 735, 736, 737, 738, - 738, 739, 740, 740, 741, 742, 743, 744, 744, 744, - 744, 745, 745, 745, 745, 746, 746, 748, 748, 749, - 749, 749, 751, 752, 753, 754, 755, 756, 756, 757, - 757, 758, 760, 762, 764, 764, 765, 765, 765, 766, - - 766, 767, 767, 768, 769, 769, 770, 770, 771, 771, - 771, 773, 774, 776, 777, 779, 780, 781, 781, 782, - 783, 783, 784, 785, 785, 785, 786, 788, 788, 788, - 788, 789, 789, 789, 789, 790, 791, 792, 793, 794, - 795, 797, 799, 799, 800, 800, 801, 801, 802, 802, - 802, 803, 803, 804, 804, 805, 806, 807, 808, 808, - 810, 812, 814, 815, 815, 816, 817, 817, 818, 819, - 819, 819, 819, 819, 819, 820, 820, 820, 820, 820, - 821, 821, 822, 823, 823, 824, 824, 825, 825, 826, - 826, 826, 827, 827, 827, 827, 828, 828, 829, 829, - - 830, 831, 833, 833, 834, 834, 835, 836, 836, 836, - 836, 836, 836, 837, 837, 837, 837, 837, 838, 838, - 840, 842, 844, 844, 845, 845, 846, 846, 847, 847, - 848, 850, 850, 850, 850, 851, 851, 852, 852, 853, - 853, 854, 854, 855, 856, 856, 856, 856, 856, 856, - 857, 857, 857, 857, 857, 858, 858, 859, 861, 861, - 862, 862, 863, 863, 863, 863, 863, 863, 864, 864, - 865, 865, 866, 866, 867, 867, 868, 869, 869, 869, - 869, 869, 870, 872, 872, 873, 873, 873, 874, 874, - 875, 877, 877, 878, 879, 879, 879, 879, 879, 879, - - 879, 880, 881, 881, 882, 882, 883, 883, 884, 885, - 887, 888, 888, 888, 888, 888, 888, 888, 888, 889, - 889, 889, 890, 890, 890, 890, 890, 890, 890, 890, - 891, 892, 892, 893, 894, 894, 896, 897, 897, 898, - 900, 900, 900, 900, 901, 901, 901, 902, 903, 903, - 903, 904, 904, 904, 904, 904, 904, 904, 904, 905, - 906, 906, 907, 908, 910, 910, 911, 911, 911, 911, - 911, 911, 912, 912, 912, 913, 913, 913, 913, 913, - 914, 914, 914, 915, 916, 916, 917, 917, 918, 918, - 918, 918, 918, 918, 919, 919, 919, 920, 920, 921, - - 922, 922, 922, 922, 923, 924, 924, 925, 926, 928, - 928, 928, 928, 928, 928, 929, 929, 929, 930, 930, - 930, 930, 930, 930, 931, 932, 932, 933, 933, 934, - 934, 934, 934, 934, 935, 935, 935, 936, 936, 937, - 938, 938, 938, 939, 940, 940, 941, 941, 941, 941, - 941, 941, 942, 942, 942, 943, 944, 944, 944, 945, - 946, 947, 949, 949, 949, 949, 949, 950, 952, 952, - 953, 955, 956, 956, 958, 959, 959, 960, 960, 960, - 960, 960, 961, 961, 961, 962, 962, 962, 963, 964, - 964, 964, 965, 967, 967, 967, 967, 967, 967, 968, - - 969, 969 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 7, 1, 1, 1, 1, 8, - 9, 1, 10, 1, 11, 1, 1, 12, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 1, 14, 1, - 15, 1, 1, 1, 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, - 1, 42, 1, 1, 43, 1, 44, 44, 44, 44, - - 44, 44, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, - 1, 1, 46, 1, 47, 1, 1, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48 - } ; - -static yyconst int yy_meta[49] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 1, 1, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 1, 4, 5, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[1212] = - { 0, - 0, 47, 1305, 1306, 53, 57, 45, 1301, 1306, 1306, - 51, 53, 55, 1306, 1306, 82, 0, 60, 54, 57, - 53, 45, 75, 1287, 84, 91, 103, 77, 119, 98, - 123, 65, 88, 1282, 1298, 1306, 1306, 1306, 158, 164, - 138, 168, 132, 1306, 172, 1297, 1306, 70, 122, 164, - 0, 1269, 1280, 1278, 0, 1269, 1276, 1263, 145, 0, - 1258, 90, 162, 1265, 158, 1271, 0, 173, 1255, 171, - 1255, 0, 0, 1265, 1271, 124, 0, 1259, 0, 53, - 0, 1256, 0, 0, 1245, 184, 0, 193, 0, 1262, - 0, 0, 0, 0, 129, 0, 1251, 110, 198, 1254, - - 186, 202, 0, 0, 174, 0, 0, 188, 1246, 1251, - 0, 1262, 0, 0, 0, 0, 1257, 0, 1249, 1242, - 1241, 1249, 1238, 1306, 236, 242, 226, 1268, 1306, 239, - 1267, 220, 1306, 236, 1225, 241, 1235, 1247, 1255, 0, - 0, 1238, 1234, 1234, 1232, 233, 1241, 1244, 1241, 1234, - 1237, 1226, 1220, 1227, 1222, 1231, 1211, 1234, 1233, 1230, - 1223, 1226, 1215, 1209, 1227, 1218, 239, 240, 1211, 1223, - 1221, 1208, 1217, 1214, 230, 1213, 1210, 1215, 1199, 1211, - 1193, 1209, 1208, 1209, 1193, 1205, 1187, 1203, 1202, 0, - 1202, 1196, 1183, 242, 1183, 243, 1197, 245, 1180, 161, - - 1195, 1180, 1189, 0, 1177, 1192, 1186, 0, 1198, 1175, - 1183, 1187, 1170, 1184, 1174, 1169, 245, 1184, 1180, 1164, - 0, 1195, 1306, 1194, 269, 1193, 1306, 1160, 1163, 1171, - 1168, 1173, 1172, 1155, 1158, 1153, 1159, 1156, 1161, 1154, - 1147, 1144, 1150, 246, 1163, 1154, 0, 1142, 1147, 1152, - 1145, 1138, 1135, 1141, 1136, 1140, 1128, 1132, 1149, 1138, - 0, 1137, 1127, 1129, 225, 1141, 1140, 1126, 1122, 1129, - 1121, 1135, 1127, 1133, 1117, 1116, 1115, 1129, 1121, 1127, - 1111, 1110, 1120, 1123, 1115, 1113, 1116, 1119, 1108, 0, - 1107, 1112, 1100, 1118, 1113, 1097, 1104, 0, 1112, 1098, - - 1098, 0, 1107, 1108, 1107, 1106, 1083, 1102, 0, 1087, - 1109, 1095, 1099, 1087, 1093, 1095, 1111, 1306, 1110, 1306, - 271, 1101, 1076, 1077, 1091, 1084, 1084, 1086, 1072, 1074, - 1083, 1084, 1071, 1081, 1088, 1078, 1064, 1077, 1066, 1061, - 1060, 1072, 1073, 1060, 1070, 1045, 1067, 1053, 1065, 1064, - 0, 1063, 1055, 1065, 1060, 1044, 1043, 252, 255, 0, - 1049, 1041, 1059, 1038, 1049, 1056, 1051, 1041, 1058, 1057, - 1043, 1050, 1045, 1035, 1020, 1019, 1032, 1031, 1043, 1041, - 1018, 1027, 1037, 1025, 1016, 1028, 1017, 1016, 0, 1014, - 1012, 1012, 1013, 1011, 1017, 1023, 1007, 0, 1013, 1019, - - 1015, 1010, 1021, 1002, 1005, 0, 1001, 1003, 1002, 1015, - 1014, 996, 993, 992, 1008, 1009, 1004, 1012, 1011, 988, - 1009, 999, 262, 996, 997, 988, 0, 995, 971, 970, - 979, 968, 990, 974, 275, 0, 988, 967, 987, 985, - 0, 984, 987, 982, 985, 980, 0, 977, 970, 967, - 961, 960, 959, 960, 959, 961, 955, 954, 953, 954, - 953, 963, 949, 948, 955, 0, 946, 950, 936, 958, - 947, 956, 940, 0, 963, 962, 268, 0, 956, 0, - 960, 0, 950, 950, 934, 932, 946, 929, 932, 930, - 926, 926, 925, 929, 0, 0, 934, 923, 929, 922, - - 921, 257, 920, 941, 935, 934, 277, 906, 0, 921, - 914, 913, 261, 912, 901, 281, 909, 285, 923, 0, - 930, 0, 924, 915, 922, 913, 907, 915, 286, 905, - 913, 912, 920, 266, 267, 901, 909, 908, 884, 270, - 274, 292, 0, 906, 905, 908, 896, 903, 0, 892, - 909, 889, 885, 897, 882, 881, 880, 876, 879, 891, - 890, 289, 0, 875, 1306, 0, 877, 883, 290, 877, - 889, 884, 892, 283, 284, 1306, 871, 287, 868, 880, - 879, 882, 881, 867, 852, 291, 298, 0, 863, 299, - 860, 857, 856, 858, 862, 861, 0, 851, 867, 858, - - 865, 856, 847, 0, 854, 853, 868, 867, 866, 843, - 1306, 844, 1306, 843, 830, 829, 828, 837, 0, 838, - 0, 837, 830, 829, 0, 0, 830, 296, 840, 0, - 830, 829, 831, 821, 835, 834, 823, 840, 301, 826, - 0, 0, 824, 833, 841, 821, 839, 819, 818, 812, - 803, 812, 1306, 813, 1306, 812, 1306, 1306, 811, 302, - 830, 797, 819, 818, 807, 803, 0, 804, 0, 803, - 0, 0, 802, 306, 799, 798, 819, 809, 808, 793, - 1306, 1306, 0, 0, 810, 805, 804, 790, 789, 788, - 800, 1306, 1306, 786, 785, 784, 796, 0, 0, 799, - - 798, 789, 775, 774, 794, 295, 0, 782, 767, 724, - 12, 104, 161, 165, 194, 199, 293, 0, 310, 312, - 326, 314, 309, 326, 314, 316, 1306, 1306, 1306, 1306, - 318, 315, 316, 341, 310, 319, 323, 0, 0, 0, - 0, 325, 341, 342, 333, 332, 333, 343, 329, 336, - 337, 335, 336, 339, 341, 342, 343, 346, 348, 354, - 355, 353, 364, 365, 364, 1306, 1306, 367, 370, 369, - 370, 371, 368, 353, 354, 371, 0, 376, 386, 380, - 374, 0, 366, 358, 371, 1306, 1306, 380, 381, 372, - 373, 0, 0, 0, 385, 386, 391, 390, 391, 403, - - 391, 394, 395, 1306, 387, 1306, 388, 1306, 389, 391, - 0, 391, 0, 392, 0, 393, 395, 390, 391, 399, - 397, 398, 403, 422, 398, 1306, 0, 396, 417, 408, - 409, 404, 411, 423, 424, 1306, 1306, 1306, 433, 429, - 0, 0, 411, 412, 424, 425, 423, 424, 423, 418, - 419, 436, 426, 422, 423, 1306, 1306, 1306, 426, 0, - 0, 0, 427, 441, 443, 453, 431, 432, 437, 434, - 435, 436, 456, 439, 440, 436, 455, 448, 450, 450, - 451, 464, 458, 457, 458, 451, 452, 464, 465, 469, - 469, 470, 474, 475, 464, 469, 476, 477, 466, 467, - - 1306, 0, 485, 486, 481, 482, 473, 488, 485, 490, - 476, 496, 497, 503, 480, 487, 482, 489, 488, 0, - 0, 0, 500, 501, 495, 496, 495, 496, 491, 1306, - 0, 506, 507, 518, 519, 520, 489, 522, 491, 505, - 506, 507, 508, 504, 513, 511, 513, 519, 505, 506, - 517, 524, 513, 525, 515, 531, 1306, 0, 532, 533, - 532, 533, 533, 546, 547, 543, 542, 543, 530, 531, - 532, 533, 538, 539, 540, 541, 547, 552, 545, 556, - 546, 1306, 0, 557, 1306, 558, 546, 562, 550, 1306, - 0, 573, 542, 1306, 570, 557, 559, 560, 563, 571, - - 565, 573, 574, 575, 564, 565, 566, 567, 1306, 0, - 585, 586, 594, 586, 578, 586, 570, 570, 572, 596, - 582, 583, 586, 587, 588, 599, 592, 604, 588, 606, - 590, 606, 607, 1306, 595, 0, 596, 608, 609, 0, - 595, 613, 613, 1306, 603, 599, 1306, 600, 601, 621, - 622, 620, 613, 614, 631, 603, 610, 611, 612, 613, - 628, 629, 1306, 0, 611, 612, 628, 623, 643, 620, - 645, 614, 634, 640, 641, 650, 622, 623, 631, 1306, - 631, 642, 633, 644, 645, 646, 636, 637, 643, 645, - 646, 652, 648, 649, 649, 661, 662, 649, 1306, 1306, - - 663, 673, 655, 644, 658, 652, 653, 680, 0, 663, - 658, 674, 679, 680, 681, 669, 675, 676, 681, 669, - 682, 668, 676, 670, 678, 688, 689, 686, 1306, 691, - 690, 678, 686, 687, 682, 688, 689, 698, 1306, 1306, - 696, 710, 698, 680, 705, 706, 691, 688, 698, 705, - 710, 711, 721, 711, 712, 1306, 716, 707, 718, 709, - 1306, 0, 719, 705, 706, 712, 1306, 0, 705, 1306, - 0, 1306, 728, 0, 729, 718, 1306, 723, 719, 725, - 722, 723, 718, 737, 1306, 725, 735, 736, 1306, 722, - 739, 1306, 0, 735, 730, 731, 724, 734, 1306, 1306, - - 1306, 763, 768, 771, 775, 780, 783, 788, 793, 798, - 803 - } ; - -static yyconst short int yy_def[1212] = - { 0, - 1201, 1, 1201, 1201, 1201, 1201, 1202, 1203, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1205, 1201, 1202, 1201, 1206, 1203, 1201, 1201, 1201, 1207, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1201, 1201, 1201, 1208, 1205, 1201, 1205, - 1209, 1206, 1201, 1207, 1207, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1208, 1201, 1210, 1211, 1209, 1201, 1204, 1204, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1210, 1201, 1211, 1201, - 1211, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - - 1201, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, - - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, - - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - 1201, 1201, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - - 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1201, - 1204, 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1201, 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, - - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1204, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 0, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201 - } ; - -static yyconst short int yy_nxt[1355] = - { 0, - 4, 5, 6, 5, 5, 7, 8, 9, 10, 11, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 17, 17, 22, 17, 17, 23, 24, 25, 26, - 27, 17, 28, 29, 30, 31, 32, 33, 17, 34, - 17, 35, 17, 4, 4, 36, 37, 38, 39, 40, - 44, 39, 771, 41, 42, 42, 42, 42, 42, 42, - 42, 42, 48, 48, 49, 49, 49, 49, 174, 69, - 63, 77, 80, 70, 74, 64, 78, 71, 81, 79, - 119, 48, 48, 175, 120, 75, 45, 72, 73, 65, - 82, 50, 66, 67, 86, 76, 99, 50, 52, 53, - - 54, 55, 68, 121, 83, 146, 100, 89, 56, 84, - 57, 90, 58, 87, 772, 59, 60, 61, 95, 91, - 122, 110, 147, 92, 62, 111, 88, 93, 94, 194, - 112, 96, 97, 49, 49, 98, 101, 44, 102, 195, - 129, 103, 130, 171, 131, 104, 113, 191, 105, 114, - 106, 115, 107, 108, 172, 116, 117, 118, 109, 125, - 126, 42, 125, 192, 127, 42, 42, 42, 42, 42, - 42, 42, 42, 45, 133, 134, 134, 44, 143, 148, - 296, 149, 150, 151, 144, 155, 156, 773, 157, 152, - 159, 166, 160, 161, 162, 153, 297, 167, 774, 178, - - 163, 179, 180, 181, 209, 182, 164, 136, 184, 210, - 185, 186, 187, 196, 188, 197, 202, 183, 203, 205, - 211, 204, 1201, 212, 198, 44, 189, 775, 223, 199, - 206, 200, 224, 776, 207, 358, 208, 125, 126, 42, - 125, 129, 127, 42, 42, 42, 42, 134, 134, 235, - 225, 225, 136, 136, 257, 259, 267, 286, 258, 268, - 293, 290, 287, 312, 294, 338, 236, 359, 313, 339, - 260, 320, 505, 320, 442, 288, 291, 444, 555, 136, - 321, 321, 321, 321, 136, 517, 443, 582, 576, 445, - 577, 592, 588, 518, 589, 595, 605, 611, 613, 612, - - 614, 619, 623, 620, 506, 621, 703, 622, 642, 647, - 556, 714, 643, 648, 653, 655, 654, 656, 658, 583, - 659, 777, 667, 593, 668, 766, 767, 596, 606, 669, - 672, 670, 673, 730, 624, 731, 778, 741, 704, 742, - 779, 780, 782, 715, 783, 784, 785, 786, 787, 788, - 789, 790, 791, 792, 793, 794, 795, 796, 781, 797, - 798, 799, 800, 801, 802, 803, 804, 806, 805, 807, - 808, 810, 809, 811, 813, 812, 814, 815, 817, 816, - 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, - 828, 829, 830, 831, 832, 833, 834, 836, 837, 839, - - 840, 841, 842, 843, 844, 838, 845, 846, 847, 848, - 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 835, 867, - 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, - 878, 880, 879, 881, 882, 884, 885, 886, 887, 888, - 889, 890, 891, 892, 893, 896, 897, 898, 899, 900, - 901, 883, 902, 903, 905, 906, 907, 908, 894, 909, - 910, 911, 895, 912, 913, 914, 915, 916, 917, 918, - 919, 920, 921, 923, 924, 925, 926, 927, 928, 922, - 929, 930, 931, 932, 933, 904, 934, 935, 936, 937, - - 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, - 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, - 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, - 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, - 989, 990, 991, 992, 993, 994, 995, 996, 997, 999, - 1001, 968, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, - 1011, 1012, 998, 1013, 1014, 1015, 1016, 1017, 1000, 1002, - 1018, 1019, 1020, 1021, 1022, 1023, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1034, 1036, 1035, 1037, 1024, - - 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, - 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, - 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, - 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, - 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, - 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, - 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, - 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, - 1118, 1119, 1121, 1122, 1123, 1120, 1124, 1125, 1126, 1127, - 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, - - 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, - 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, - 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, - 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, - 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, - 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, - 1198, 1199, 1200, 43, 770, 43, 43, 43, 46, 46, - 46, 46, 46, 51, 51, 128, 128, 128, 128, 128, - 132, 132, 132, 132, 132, 135, 769, 135, 222, 222, - 222, 222, 222, 226, 226, 226, 226, 226, 317, 317, - - 317, 317, 317, 319, 319, 319, 319, 319, 768, 765, - 764, 763, 762, 761, 760, 759, 758, 757, 756, 755, - 754, 753, 752, 751, 750, 749, 748, 747, 746, 745, - 744, 743, 740, 739, 738, 737, 736, 735, 734, 733, - 732, 729, 728, 727, 726, 725, 724, 723, 722, 721, - 720, 719, 718, 717, 716, 713, 712, 711, 710, 709, - 708, 707, 706, 705, 702, 701, 700, 699, 698, 697, - 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, - 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, - 676, 675, 674, 671, 666, 665, 664, 663, 662, 661, - - 660, 657, 652, 651, 650, 649, 646, 645, 644, 641, - 640, 639, 638, 637, 636, 635, 634, 633, 632, 631, - 630, 629, 628, 627, 626, 625, 618, 617, 616, 615, - 610, 609, 608, 607, 604, 603, 602, 601, 600, 599, - 598, 597, 594, 591, 590, 587, 586, 585, 584, 581, - 580, 579, 578, 575, 574, 573, 572, 571, 570, 569, - 568, 567, 566, 565, 564, 563, 562, 561, 560, 559, - 558, 557, 554, 553, 552, 551, 550, 549, 548, 547, - 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, - 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, - - 526, 525, 524, 523, 522, 521, 520, 519, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 504, 503, - 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, - 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, - 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, - 452, 451, 450, 449, 448, 447, 446, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 320, 318, 406, 405, 404, 403, 402, 401, - 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, - 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, - 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 360, 357, 356, 355, 354, 353, 352, 351, 350, 349, - 348, 347, 346, 345, 344, 343, 342, 341, 340, 337, - 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, - 326, 325, 324, 323, 322, 227, 318, 223, 316, 315, - - 314, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 295, 292, 289, 285, 284, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 272, 271, 270, 269, 266, 265, 264, 263, 262, - 261, 256, 255, 254, 253, 252, 251, 250, 249, 248, - 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, - 237, 234, 233, 232, 231, 230, 229, 228, 1201, 227, - 129, 221, 220, 219, 218, 217, 216, 215, 214, 213, - 201, 193, 190, 177, 176, 173, 170, 169, 168, 165, - 158, 154, 145, 142, 141, 140, 139, 138, 137, 47, - - 124, 123, 85, 47, 1201, 3, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yyconst short int yy_chk[1355] = - { 0, - 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, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 7, 2, 711, 2, 5, 5, 5, 5, 6, 6, - 6, 6, 11, 11, 12, 12, 13, 13, 80, 19, - 18, 21, 22, 19, 20, 18, 21, 19, 22, 21, - 32, 48, 48, 80, 32, 20, 7, 19, 19, 18, - 23, 12, 18, 18, 25, 20, 28, 12, 16, 16, - - 16, 16, 18, 33, 23, 62, 28, 26, 16, 23, - 16, 26, 16, 25, 712, 16, 16, 16, 27, 26, - 33, 30, 62, 26, 16, 30, 25, 26, 26, 98, - 30, 27, 27, 49, 49, 27, 29, 43, 29, 98, - 41, 29, 41, 76, 41, 29, 31, 95, 29, 31, - 29, 31, 29, 29, 76, 31, 31, 31, 29, 39, - 39, 39, 39, 95, 39, 40, 40, 40, 40, 42, - 42, 42, 42, 43, 45, 50, 50, 45, 59, 63, - 200, 63, 63, 63, 59, 65, 65, 713, 65, 63, - 68, 70, 68, 68, 68, 63, 200, 70, 714, 86, - - 68, 86, 86, 86, 105, 86, 68, 50, 88, 105, - 88, 88, 88, 99, 88, 99, 101, 86, 101, 102, - 108, 101, 132, 108, 99, 132, 88, 715, 127, 99, - 102, 99, 127, 716, 102, 265, 102, 125, 125, 125, - 125, 130, 125, 126, 126, 126, 126, 134, 134, 146, - 130, 130, 136, 136, 167, 168, 175, 194, 167, 175, - 198, 196, 194, 217, 198, 244, 146, 265, 217, 244, - 168, 225, 423, 321, 358, 194, 196, 359, 477, 134, - 225, 225, 321, 321, 136, 435, 358, 507, 502, 359, - 502, 516, 513, 435, 513, 518, 529, 534, 535, 534, - - 535, 540, 542, 540, 423, 541, 628, 541, 562, 569, - 477, 639, 562, 569, 574, 575, 574, 575, 578, 507, - 578, 717, 586, 516, 586, 706, 706, 518, 529, 587, - 590, 587, 590, 660, 542, 660, 719, 674, 628, 674, - 720, 721, 722, 639, 723, 724, 725, 726, 731, 732, - 733, 734, 735, 736, 737, 742, 743, 744, 721, 745, - 746, 747, 748, 749, 750, 751, 752, 753, 752, 753, - 754, 755, 754, 756, 757, 756, 757, 758, 759, 758, - 760, 761, 762, 763, 764, 765, 768, 769, 770, 771, - 772, 773, 774, 775, 776, 778, 779, 780, 781, 783, - - 784, 785, 785, 788, 789, 781, 790, 791, 795, 796, - 797, 798, 799, 800, 801, 802, 803, 805, 807, 809, - 810, 812, 814, 816, 817, 818, 819, 820, 779, 821, - 822, 823, 824, 825, 828, 829, 830, 831, 832, 833, - 834, 835, 834, 839, 840, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 859, 863, - 864, 840, 865, 866, 867, 868, 869, 870, 852, 871, - 872, 873, 852, 874, 875, 876, 877, 878, 879, 880, - 881, 882, 883, 884, 885, 886, 887, 888, 889, 883, - 890, 891, 892, 893, 894, 866, 895, 896, 897, 898, - - 899, 900, 903, 904, 905, 906, 907, 908, 909, 910, - 911, 912, 913, 914, 915, 916, 917, 918, 919, 923, - 924, 925, 926, 927, 928, 929, 932, 933, 934, 935, - 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, - 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, - 956, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 968, 935, 969, 970, 971, 972, 973, 974, 975, 976, - 977, 978, 966, 979, 980, 981, 984, 986, 967, 968, - 987, 988, 989, 992, 993, 995, 996, 997, 998, 999, - 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1005, 1006, 995, - - 1007, 1008, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, - 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1035, 1037, 1038, 1039, 1041, - 1042, 1043, 1045, 1046, 1048, 1049, 1050, 1051, 1052, 1053, - 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1065, - 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, - 1076, 1077, 1078, 1079, 1081, 1082, 1083, 1084, 1085, 1086, - 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, - 1097, 1098, 1101, 1102, 1103, 1098, 1104, 1105, 1106, 1107, - 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, - - 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, - 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1141, - 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, - 1152, 1153, 1154, 1155, 1157, 1158, 1159, 1160, 1163, 1164, - 1165, 1166, 1169, 1173, 1175, 1176, 1178, 1179, 1180, 1181, - 1182, 1183, 1184, 1186, 1187, 1188, 1190, 1191, 1194, 1195, - 1196, 1197, 1198, 1202, 710, 1202, 1202, 1202, 1203, 1203, - 1203, 1203, 1203, 1204, 1204, 1205, 1205, 1205, 1205, 1205, - 1206, 1206, 1206, 1206, 1206, 1207, 709, 1207, 1208, 1208, - 1208, 1208, 1208, 1209, 1209, 1209, 1209, 1209, 1210, 1210, - - 1210, 1210, 1210, 1211, 1211, 1211, 1211, 1211, 708, 705, - 704, 703, 702, 701, 700, 697, 696, 695, 694, 691, - 690, 689, 688, 687, 686, 685, 680, 679, 678, 677, - 676, 675, 673, 670, 668, 666, 665, 664, 663, 662, - 661, 659, 656, 654, 652, 651, 650, 649, 648, 647, - 646, 645, 644, 643, 640, 638, 637, 636, 635, 634, - 633, 632, 631, 629, 627, 624, 623, 622, 620, 618, - 617, 616, 615, 614, 612, 610, 609, 608, 607, 606, - 605, 603, 602, 601, 600, 599, 598, 596, 595, 594, - 593, 592, 591, 589, 585, 584, 583, 582, 581, 580, - - 579, 577, 573, 572, 571, 570, 568, 567, 564, 561, - 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, - 550, 548, 547, 546, 545, 544, 539, 538, 537, 536, - 533, 532, 531, 530, 528, 527, 526, 525, 524, 523, - 521, 519, 517, 515, 514, 512, 511, 510, 508, 506, - 505, 504, 503, 501, 500, 499, 498, 497, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 481, 479, 476, 475, 473, 472, 471, 470, 469, 468, - 467, 465, 464, 463, 462, 461, 460, 459, 458, 457, - 456, 455, 454, 453, 452, 451, 450, 449, 448, 446, - - 445, 444, 443, 442, 440, 439, 438, 437, 434, 433, - 432, 431, 430, 429, 428, 426, 425, 424, 422, 421, - 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, - 410, 409, 408, 407, 405, 404, 403, 402, 401, 400, - 399, 397, 396, 395, 394, 393, 392, 391, 390, 388, - 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, - 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, - 367, 366, 365, 364, 363, 362, 361, 357, 356, 355, - 354, 353, 352, 350, 349, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, - - 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, - 323, 322, 319, 317, 316, 315, 314, 313, 312, 311, - 310, 308, 307, 306, 305, 304, 303, 301, 300, 299, - 297, 296, 295, 294, 293, 292, 291, 289, 288, 287, - 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, - 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, - 266, 264, 263, 262, 260, 259, 258, 257, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 246, 245, 243, - 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, - 232, 231, 230, 229, 228, 226, 224, 222, 220, 219, - - 218, 216, 215, 214, 213, 212, 211, 210, 209, 207, - 206, 205, 203, 202, 201, 199, 197, 195, 193, 192, - 191, 189, 188, 187, 186, 185, 184, 183, 182, 181, - 180, 179, 178, 177, 176, 174, 173, 172, 171, 170, - 169, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 145, 144, 143, 142, 139, 138, 137, 135, 131, - 128, 123, 122, 121, 120, 119, 117, 112, 110, 109, - 100, 97, 90, 85, 82, 78, 75, 74, 71, 69, - 66, 64, 61, 58, 57, 56, 54, 53, 52, 46, - - 35, 34, 24, 8, 3, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up script4text */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -static int yy_more_flag = 0; -static int yy_more_len = 0; -#define yymore() (yy_more_flag = 1) -#define YY_MORE_ADJ yy_more_len -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char script4text[YYLMAX]; -char *script4text_ptr; -#line 1 "script_lexer.l" -#define INITIAL 0 -#line 2 "script_lexer.l" -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -//***************************************************************************** -// DESCRIPTION : Script Lexer -//***************************************************************************** - -#ifdef _WINDOWS -#pragma warning (disable : 4102) -#pragma warning (disable : 4273) -#pragma warning (disable : 4786) -#endif - -//***************************************************************************** -// EXTERNAL DECLARATIONS -//***************************************************************************** -#include -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "Iutility.h" // Utility component interface -#include "Iwarehouse.h" // Warehouse component interface -#include "Idicom.h" // Dicom component interface -#include "Inetwork.h" // Network component interface -#include "Imedia.h" // Media File component interface -#include "Isession.h" // Test Session component interface - -#include "script4_parser.cpp.h" - -extern void script4error(char*); - -extern FILE *script4in; -extern int script4lineno; -extern char script4CurrentFilename[_MAX_PATH]; -extern long script4CurrentFileOffset; -extern long script4CurrentLineNo; -extern SCRIPT_SESSION_CLASS *script4Session_ptr; -extern bool script4IsNativeVts; -extern bool script4ParseOnly; - -bool IsHex(char, int *); - -static char *pEnd; - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int script4wrap YY_PROTO(( void )); -#else -extern int script4wrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void script4unput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef script4text_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int script4input YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( script4text, script4leng, 1, script4out ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( script4in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( script4in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, script4in )) == 0) \ - && ferror( script4in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int script4lex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after script4text and script4leng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( script4leng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (script4text[script4leng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 57 "script_lexer.l" - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! script4in ) - script4in = stdin; - - if ( ! script4out ) - script4out = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - script4_create_buffer( script4in, YY_BUF_SIZE ); - - script4_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_more_len = 0; - if ( yy_more_flag ) - { - yy_more_len = script4leng; - yy_more_flag = 0; - } - yy_cp = yy_c_buf_p; - - /* Support of script4text. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1306 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < script4leng; ++yyl ) - if ( script4text[yyl] == '\n' ) - ++script4lineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 58 "script_lexer.l" -{ /* skip charcters from 80H - FFH */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 60 "script_lexer.l" -{ - // copy script4 comment lines - strip off leading ## - int length = script4leng; - - // check to see how line is terminated - // - and remove termination - if ((script4text[script4leng-1] == LINEFEED) - && (script4text[script4leng-2] == CARRIAGERETURN)) - length -= 2; - else - length--; - - script4lval.string_ptr = (char*) malloc(length+1); - - memcpy(script4lval.string_ptr, &script4text[0], length); - script4lval.string_ptr[length] = NULLCHAR; - if (script4Session_ptr) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_NONE, 1, "%s", script4lval.string_ptr); - } - } - - free(script4lval.string_ptr); - script4lval.string_ptr = NULL; - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 89 "script_lexer.l" -{ /* extract file and line info from cpp comment lines: # Number ["file"] */ - char* iS = NULL; - char* nS = NULL; - iS = strstr(script4text, "# "); - if (iS != NULL) - { - nS = strstr(iS, " \""); - if (nS != NULL) - { - *nS++ = '\0'; - strcpy(script4CurrentFilename, nS); - } - script4CurrentFileOffset = atoi(iS+2); - script4CurrentLineNo = script4lineno; - } - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 105 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 110 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 115 "script_lexer.l" -{ /* skip empty lines */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 116 "script_lexer.l" -{ /* skip white space */ } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 117 "script_lexer.l" -{ /* continuation line */ } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 118 "script_lexer.l" -{ /* skip equal sign */ } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 119 "script_lexer.l" -{ /* skip semi-colon */ } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 120 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 121 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 122 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 123 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 124 "script_lexer.l" -{ script4lval.vr = ATTR_VR_AE; return VR; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 125 "script_lexer.l" -{ script4lval.vr = ATTR_VR_AS; return VR; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 126 "script_lexer.l" -{ script4lval.vr = ATTR_VR_AT; return VR; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 127 "script_lexer.l" -{ script4lval.vr = ATTR_VR_CS; return VR; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 128 "script_lexer.l" -{ script4lval.vr = ATTR_VR_DA; return VR; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 129 "script_lexer.l" -{ script4lval.vr = ATTR_VR_DS; return VR; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 130 "script_lexer.l" -{ script4lval.vr = ATTR_VR_DT; return VR; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 131 "script_lexer.l" -{ script4lval.vr = ATTR_VR_FD; return VR; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 132 "script_lexer.l" -{ script4lval.vr = ATTR_VR_FL; return VR; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 133 "script_lexer.l" -{ script4lval.vr = ATTR_VR_IS; return VR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 134 "script_lexer.l" -{ script4lval.vr = ATTR_VR_LO; return VR; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 135 "script_lexer.l" -{ script4lval.vr = ATTR_VR_LT; return VR; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 136 "script_lexer.l" -{ script4lval.vr = ATTR_VR_OB; return VR; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 137 "script_lexer.l" -{ script4lval.vr = ATTR_VR_OF; return VR; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 138 "script_lexer.l" -{ script4lval.vr = ATTR_VR_OV; return VR; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 139 "script_lexer.l" -{ script4lval.vr = ATTR_VR_OW; return VR; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 140 "script_lexer.l" -{ script4lval.vr = ATTR_VR_PN; return VR; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 141 "script_lexer.l" -{ script4lval.vr = ATTR_VR_SH; return VR; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 142 "script_lexer.l" -{ script4lval.vr = ATTR_VR_SL; return VR; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 143 "script_lexer.l" -{ script4lval.vr = ATTR_VR_SQ; return T_SQ; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 144 "script_lexer.l" -{ script4lval.vr = ATTR_VR_SS; return VR; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 145 "script_lexer.l" -{ script4lval.vr = ATTR_VR_ST; return VR; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 146 "script_lexer.l" -{ script4lval.vr = ATTR_VR_TM; return VR; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 147 "script_lexer.l" -{ script4lval.vr = ATTR_VR_UI; return VR; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 148 "script_lexer.l" -{ script4lval.vr = ATTR_VR_UL; return VR; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 149 "script_lexer.l" -{ script4lval.vr = ATTR_VR_UN; return VR; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 150 "script_lexer.l" -{ script4lval.vr = ATTR_VR_UR; return VR; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 151 "script_lexer.l" -{ script4lval.vr = ATTR_VR_US; return VR; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 152 "script_lexer.l" -{ script4lval.vr = ATTR_VR_UT; return VR; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 154 "script_lexer.l" -{ return T_SEND; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 156 "script_lexer.l" -{ return T_RESET; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 157 "script_lexer.l" -{ return T_CREATE; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 158 "script_lexer.l" -{ return T_SET; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 159 "script_lexer.l" -{ return T_COMPARE; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 160 "script_lexer.l" -{ return T_COMPARE_NOT; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 161 "script_lexer.l" -{ return T_COPY; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 162 "script_lexer.l" -{ return T_DELETE; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 164 "script_lexer.l" -{ return T_READ; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 165 "script_lexer.l" -{ return T_WRITE; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 167 "script_lexer.l" -{ return T_SYSTEM; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 168 "script_lexer.l" -{ return T_TIME; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 169 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 170 "script_lexer.l" -{ return T_DISPLAY; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 171 "script_lexer.l" -{ return T_ECHO; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 172 "script_lexer.l" -{ return T_ROLE; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 173 "script_lexer.l" -{ return T_CONFIRM; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 174 "script_lexer.l" -{ return T_DELAY; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 176 "script_lexer.l" -{ return T_APPL_ENTITY; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 177 "script_lexer.l" -{ return T_ADD_GROUP_LENGTH; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 178 "script_lexer.l" -{ return T_DEF_SQ_LENGTH; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 179 "script_lexer.l" -{ return T_POPULATE; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 180 "script_lexer.l" -{ return T_STRICT; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 181 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 182 "script_lexer.l" -{ return T_VALIDATION; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 183 "script_lexer.l" -{ script4lval.validationFlag = ALL; return VALIDATIONFLAG; } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 184 "script_lexer.l" -{ script4lval.validationFlag = USE_DEFINITION; return VALIDATIONFLAG; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 185 "script_lexer.l" -{ script4lval.validationFlag = USE_VR; return VALIDATIONFLAG; } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 186 "script_lexer.l" -{ script4lval.validationFlag = USE_REFERENCE; return VALIDATIONFLAG; } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 187 "script_lexer.l" -{ script4lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_VR); return VALIDATIONFLAG; } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 188 "script_lexer.l" -{ script4lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 189 "script_lexer.l" -{ script4lval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_VR | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 190 "script_lexer.l" -{ script4lval.validationFlag = NONE; return VALIDATIONFLAG; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 192 "script_lexer.l" -{ return T_LANGUAGE; } - YY_BREAK -/* - * The LANGUAGE token is introduced to enable backward compatibility with - * VTS and ADVT - * Currently the ADVT language is fully supported by the parser - * To avoid conflicts and to have a more consistent language for DVT - * this language section has been introduced. Here some mappings between VTS - * language tokens and DVT language tokens are provided. - */ -case 78: -YY_RULE_SETUP -#line 202 "script_lexer.l" -{ - /* - * The VTS VALIDATE command is mapped on the DVT RECEIVE Command - */ - if (script4IsNativeVts) - { - return T_RECEIVE; - } - else - { - return T_VALIDATE; - } - } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 215 "script_lexer.l" -{ - /* - * The VTS VALDIMSE command is mapped on the DVT VALIDATE Command - */ - if (script4IsNativeVts) - { - return T_VALIDATE; - } - else - { - /* VALDIMSE is not part of the DVT language anymore */ - script4error("\"VALDIMSE\" is not a DVT script4 command. Use \"VALIDATE\" "); - } - } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 230 "script_lexer.l" -{ - /* - * The VTS RECEIVE command is mapped on the DVT IMPORT Command - */ - if (script4IsNativeVts) - { - return T_IMPORT; - } - else - { - return T_RECEIVE; - } - } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 244 "script_lexer.l" -{ - /* - * The VTS EXECUTE command is mapped on the DVT EXPORT Command - */ - if (script4IsNativeVts) - { - return T_EXPORT; - } - else - { - /* EXECUTE is not part of the DVT language anymore */ - script4error("\"EXECUTE\" is not a DVT script4 command. Use \"EXPORT\" "); - } - } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 259 "script_lexer.l" -{ - return T_IMPORT; - } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 263 "script_lexer.l" -{ - return T_EXPORT; - } - YY_BREAK -case 84: -#line 268 "script_lexer.l" -case 85: -YY_RULE_SETUP -#line 268 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CECHO_RQ; return COMMANDFIELD; } - YY_BREAK -case 86: -#line 270 "script_lexer.l" -case 87: -YY_RULE_SETUP -#line 270 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CECHO_RSP; return COMMANDFIELD; } - YY_BREAK -case 88: -#line 272 "script_lexer.l" -case 89: -YY_RULE_SETUP -#line 272 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CFIND_RQ; return COMMANDFIELD; } - YY_BREAK -case 90: -#line 274 "script_lexer.l" -case 91: -YY_RULE_SETUP -#line 274 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CFIND_RSP; return COMMANDFIELD; } - YY_BREAK -case 92: -#line 276 "script_lexer.l" -case 93: -YY_RULE_SETUP -#line 276 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 94: -#line 278 "script_lexer.l" -case 95: -YY_RULE_SETUP -#line 278 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 96: -#line 280 "script_lexer.l" -case 97: -YY_RULE_SETUP -#line 280 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CMOVE_RQ; return COMMANDFIELD; } - YY_BREAK -case 98: -#line 282 "script_lexer.l" -case 99: -YY_RULE_SETUP -#line 282 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CMOVE_RSP; return COMMANDFIELD; } - YY_BREAK -case 100: -#line 284 "script_lexer.l" -case 101: -YY_RULE_SETUP -#line 284 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CSTORE_RQ; return COMMANDFIELD; } - YY_BREAK -case 102: -#line 286 "script_lexer.l" -case 103: -YY_RULE_SETUP -#line 286 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CSTORE_RSP; return COMMANDFIELD; } - YY_BREAK -case 104: -#line 288 "script_lexer.l" -case 105: -YY_RULE_SETUP -#line 288 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_CCANCEL_RQ; return COMMANDFIELD; } - YY_BREAK -case 106: -#line 290 "script_lexer.l" -case 107: -YY_RULE_SETUP -#line 290 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NACTION_RQ; return COMMANDFIELD; } - YY_BREAK -case 108: -#line 292 "script_lexer.l" -case 109: -YY_RULE_SETUP -#line 292 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NACTION_RSP; return COMMANDFIELD; } - YY_BREAK -case 110: -#line 294 "script_lexer.l" -case 111: -YY_RULE_SETUP -#line 294 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NCREATE_RQ; return COMMANDFIELD; } - YY_BREAK -case 112: -#line 296 "script_lexer.l" -case 113: -YY_RULE_SETUP -#line 296 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NCREATE_RSP; return COMMANDFIELD; } - YY_BREAK -case 114: -#line 298 "script_lexer.l" -case 115: -YY_RULE_SETUP -#line 298 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NDELETE_RQ; return COMMANDFIELD; } - YY_BREAK -case 116: -#line 300 "script_lexer.l" -case 117: -YY_RULE_SETUP -#line 300 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NDELETE_RSP; return COMMANDFIELD; } - YY_BREAK -case 118: -#line 302 "script_lexer.l" -case 119: -YY_RULE_SETUP -#line 302 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NEVENTREPORT_RQ; return COMMANDFIELD; } - YY_BREAK -case 120: -#line 304 "script_lexer.l" -case 121: -YY_RULE_SETUP -#line 304 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NEVENTREPORT_RSP; return COMMANDFIELD; } - YY_BREAK -case 122: -#line 306 "script_lexer.l" -case 123: -YY_RULE_SETUP -#line 306 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 124: -#line 308 "script_lexer.l" -case 125: -YY_RULE_SETUP -#line 308 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 126: -#line 310 "script_lexer.l" -case 127: -YY_RULE_SETUP -#line 310 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NSET_RQ; return COMMANDFIELD; } - YY_BREAK -case 128: -#line 312 "script_lexer.l" -case 129: -YY_RULE_SETUP -#line 312 "script_lexer.l" -{ script4lval.commandField = DIMSE_CMD_NSET_RSP; return COMMANDFIELD; } - YY_BREAK -case 130: -#line 315 "script_lexer.l" -case 131: -YY_RULE_SETUP -#line 315 "script_lexer.l" -{ return T_ASSOCIATE_RQ; } - YY_BREAK -case 132: -#line 317 "script_lexer.l" -case 133: -YY_RULE_SETUP -#line 317 "script_lexer.l" -{ return T_ASSOCIATE_AC; } - YY_BREAK -case 134: -#line 319 "script_lexer.l" -case 135: -YY_RULE_SETUP -#line 319 "script_lexer.l" -{ return T_ASSOCIATE_RJ; } - YY_BREAK -case 136: -#line 321 "script_lexer.l" -case 137: -YY_RULE_SETUP -#line 321 "script_lexer.l" -{ return T_RELEASE_RQ; } - YY_BREAK -case 138: -#line 323 "script_lexer.l" -case 139: -YY_RULE_SETUP -#line 323 "script_lexer.l" -{ return T_RELEASE_RP; } - YY_BREAK -case 140: -#line 325 "script_lexer.l" -case 141: -YY_RULE_SETUP -#line 325 "script_lexer.l" -{ return T_ABORT_RQ; } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 327 "script_lexer.l" -{ return T_ALL; } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 328 "script_lexer.l" -{ return T_WAREHOUSE; } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 329 "script_lexer.l" -{ return T_ASSOCIATION; } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 330 "script_lexer.l" -{ return T_RELATION; } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 331 "script_lexer.l" -{ return T_EXECUTION_CONTEXT; } - YY_BREAK -case 147: -#line 334 "script_lexer.l" -case 148: -YY_RULE_SETUP -#line 334 "script_lexer.l" -{ return T_PROT_VER; } - YY_BREAK -case 149: -#line 336 "script_lexer.l" -case 150: -YY_RULE_SETUP -#line 336 "script_lexer.l" -{ return T_CALLED_AE; } - YY_BREAK -case 151: -#line 338 "script_lexer.l" -case 152: -YY_RULE_SETUP -#line 338 "script_lexer.l" -{ return T_CALLING_AE; } - YY_BREAK -case 153: -#line 340 "script_lexer.l" -case 154: -YY_RULE_SETUP -#line 340 "script_lexer.l" -{ return T_APPL_CTX; } - YY_BREAK -case 155: -#line 342 "script_lexer.l" -case 156: -#line 343 "script_lexer.l" -case 157: -YY_RULE_SETUP -#line 343 "script_lexer.l" -{ return T_PRES_CTX; } - YY_BREAK -case 158: -#line 345 "script_lexer.l" -case 159: -YY_RULE_SETUP -#line 345 "script_lexer.l" -{ return T_MAX_LEN; } - YY_BREAK -case 160: -#line 347 "script_lexer.l" -case 161: -YY_RULE_SETUP -#line 347 "script_lexer.l" -{ return T_IMPL_CLASS; } - YY_BREAK -case 162: -#line 349 "script_lexer.l" -case 163: -YY_RULE_SETUP -#line 349 "script_lexer.l" -{ return T_IMPL_VER; } - YY_BREAK -case 164: -YY_RULE_SETUP -#line 350 "script_lexer.l" -{ return T_SOP_EXTEND_NEG; } - YY_BREAK -case 165: -YY_RULE_SETUP -#line 351 "script_lexer.l" -{ return T_SCPSCU_ROLE; } - YY_BREAK -case 166: -YY_RULE_SETUP -#line 352 "script_lexer.l" -{ return T_ASYNC_WINDOW; } - YY_BREAK -case 167: -YY_RULE_SETUP -#line 353 "script_lexer.l" -{ return T_USER_ID_NEG; } - YY_BREAK -case 168: -YY_RULE_SETUP -#line 354 "script_lexer.l" -{ return T_RESULT; } - YY_BREAK -case 169: -YY_RULE_SETUP -#line 355 "script_lexer.l" -{ return T_SOURCE; } - YY_BREAK -case 170: -#line 357 "script_lexer.l" -case 171: -YY_RULE_SETUP -#line 357 "script_lexer.l" -{ return T_REASON; } - YY_BREAK -case 172: -#line 360 "script_lexer.l" -case 173: -YY_RULE_SETUP -#line 360 "script_lexer.l" -{ return T_FILEHEAD; } - YY_BREAK -case 174: -#line 362 "script_lexer.l" -case 175: -YY_RULE_SETUP -#line 362 "script_lexer.l" -{ return T_FILETAIL; } - YY_BREAK -case 176: -YY_RULE_SETUP -#line 364 "script_lexer.l" -{ return T_FILE_PREAMBLE; } - YY_BREAK -case 177: -YY_RULE_SETUP -#line 365 "script_lexer.l" -{ return T_DICOM_PREFIX; } - YY_BREAK -case 178: -#line 367 "script_lexer.l" -case 179: -YY_RULE_SETUP -#line 367 "script_lexer.l" -{ return T_TRANSFER_SYNTAX; } - YY_BREAK -case 180: -#line 369 "script_lexer.l" -case 181: -YY_RULE_SETUP -#line 369 "script_lexer.l" -{ return T_SECTOR_SIZE; } - YY_BREAK -case 182: -#line 371 "script_lexer.l" -case 183: -YY_RULE_SETUP -#line 371 "script_lexer.l" -{ return T_DATASET_TRAILING_PADDING; } - YY_BREAK -case 184: -#line 373 "script_lexer.l" -case 185: -YY_RULE_SETUP -#line 373 "script_lexer.l" -{ return T_PADDING_VALUE; } - YY_BREAK -case 186: -YY_RULE_SETUP -#line 375 "script_lexer.l" -{ return T_AUTOSET; } - YY_BREAK -case 187: -#line 377 "script_lexer.l" -case 188: -YY_RULE_SETUP -#line 377 "script_lexer.l" -{ return T_DEFINED_LENGTH; } - YY_BREAK -case 189: -YY_RULE_SETUP -#line 379 "script_lexer.l" -{ return T_NO; } - YY_BREAK -case 190: -YY_RULE_SETUP -#line 380 "script_lexer.l" -{ return T_YES; } - YY_BREAK -case 191: -YY_RULE_SETUP -#line 382 "script_lexer.l" -{ return T_OFF; } - YY_BREAK -case 192: -YY_RULE_SETUP -#line 383 "script_lexer.l" -{ return T_ON; } - YY_BREAK -case 193: -YY_RULE_SETUP -#line 385 "script_lexer.l" -{ return T_AND; } - YY_BREAK -case 194: -YY_RULE_SETUP -#line 386 "script_lexer.l" -{ return T_OR; } - YY_BREAK -case 195: -YY_RULE_SETUP -#line 388 "script_lexer.l" -{ script4lval.iomLevel = IOM_PATIENT; return IOMLEVEL; } - YY_BREAK -case 196: -YY_RULE_SETUP -#line 389 "script_lexer.l" -{ script4lval.iomLevel = IOM_STUDY; return IOMLEVEL; } - YY_BREAK -case 197: -YY_RULE_SETUP -#line 390 "script_lexer.l" -{ script4lval.iomLevel = IOM_SERIES; return IOMLEVEL; } - YY_BREAK -case 198: -YY_RULE_SETUP -#line 391 "script_lexer.l" -{ script4lval.iomLevel = IOM_IMAGE; return IOMLEVEL; } - YY_BREAK -case 199: -#line 394 "script_lexer.l" -case 200: -YY_RULE_SETUP -#line 394 "script_lexer.l" -{ script4lval.userProvider = UP_ACCEPTOR; return USERPROVIDER; } - YY_BREAK -case 201: -#line 396 "script_lexer.l" -case 202: -YY_RULE_SETUP -#line 396 "script_lexer.l" -{ script4lval.userProvider = UP_REQUESTOR; return USERPROVIDER; } - YY_BREAK -case 203: -#line 399 "script_lexer.l" -case 204: -YY_RULE_SETUP -#line 399 "script_lexer.l" -{ script4lval.hex = strtoul(script4text, &pEnd, 16); return HEXADECIMAL; } - YY_BREAK -case 205: -#line 402 "script_lexer.l" -case 206: -YY_RULE_SETUP -#line 402 "script_lexer.l" -{ script4lval.integer = atoi(script4text); return INTEGER; } - YY_BREAK -case 207: -YY_RULE_SETUP -#line 404 "script_lexer.l" -{ strncpy(script4lval.identifier, script4text, sizeof(script4lval.identifier)); return IDENTIFIER; } - YY_BREAK -case 208: -YY_RULE_SETUP -#line 406 "script_lexer.l" -{ for (script4leng = script4leng-2; script4leng >= 0; script4leng--) - /* concatenate line */ - unput(script4text[script4leng]); - } - YY_BREAK -case 209: -YY_RULE_SETUP -#line 411 "script_lexer.l" -{ int i = 1, j = 0; - - script4lval.string_ptr = (char*) malloc(script4leng+1); - if (script4lval.string_ptr == NULL) - { - char message[128]; - sprintf(message, "STRING of %d chars too long for parser - string truncated!", - script4leng-2); - script4error(message); - - script4lval.string_ptr = (char*) malloc(MAX_STRING_LEN); - - script4leng = MAX_STRING_LEN - 1; - } - - while (i < (script4leng-1)) - { - script4lval.string_ptr[j++] = script4text[i++]; - } - - script4lval.string_ptr[j] = NULLCHAR; - return STRING; - } - YY_BREAK -case 210: -YY_RULE_SETUP -#line 435 "script_lexer.l" -{ return script4text[0]; } - YY_BREAK -case 211: -YY_RULE_SETUP -#line 436 "script_lexer.l" -ECHO; - YY_BREAK - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - script4text_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed script4in at a new source and called - * script4lex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = script4in; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = script4text_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = script4text_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( script4wrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * script4text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = script4text_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - script4text_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = script4text_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = script4text_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of script4lex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = script4text_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - script4text_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - script4text_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - script4restart( script4in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - script4text_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = script4text_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - yy_is_jam = (yy_current_state == 1201); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void script4unput( int c, register char *yy_bp ) -#else -static void script4unput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up script4text */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --script4lineno; - - script4text_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int script4input() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - script4text_ptr = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - if ( script4wrap() ) - { - yy_c_buf_p = - script4text_ptr + YY_MORE_ADJ; - return EOF; - } - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return script4input(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = script4text_ptr + YY_MORE_ADJ; - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in script4input()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve script4text */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++script4lineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void script4restart( FILE *input_file ) -#else -void script4restart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = script4_create_buffer( script4in, YY_BUF_SIZE ); - - script4_init_buffer( yy_current_buffer, input_file ); - script4_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void script4_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void script4_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - script4_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (script4wrap()) processing, but the only time this flag - * is looked at is after script4wrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void script4_load_buffer_state( void ) -#else -void script4_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - script4text_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - script4in = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script4_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE script4_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script4_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in script4_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - script4_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void script4_delete_buffer( YY_BUFFER_STATE b ) -#else -void script4_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void script4_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void script4_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - script4_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void script4_flush_buffer( YY_BUFFER_STATE b ) -#else -void script4_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - script4_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script4_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE script4_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script4_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - script4_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script4_scan_string( yyconst char *str ) -#else -YY_BUFFER_STATE script4_scan_string( str ) -yyconst char *str; -#endif - { - int len; - for ( len = 0; str[len]; ++len ) - ; - - return script4_scan_bytes( str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script4_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE script4_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in script4_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = script4_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in script4_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up script4text. */ \ - script4text[script4leng] = yy_hold_char; \ - yy_c_buf_p = script4text + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - script4leng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef script4text_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - script4lex(); - return 0; - } -#endif -#line 436 "script_lexer.l" - - -//>>=========================================================================== - -void script4error(char *errmsg) - -// DESCRIPTION : YACC/LEX error function called when parsing of the -// DICOMScript fails. -// PRECONDITIONS : -// POSTCONDITIONS : -// EXCEPTIONS : -// NOTES : -//<<=========================================================================== -{ - LOG_CLASS* logger_ptr = script4Session_ptr->getLogger(); - - logger_ptr->text(LOG_ERROR, 1, - "%s - parsing Test Script; line %ld of %s", VAL_PREFIX_FAILED, - script4CurrentFileOffset + (script4lineno - script4CurrentLineNo), - script4CurrentFilename); - logger_ptr->text( LOG_ERROR, 1, "%s - around token : \"%s\"", errmsg, script4text); - -} - - diff --git a/DVTk_Library/Libraries/Scripting/script4_parser.cpp b/DVTk_Library/Libraries/Scripting/script4_parser.cpp deleted file mode 100644 index ab84c0d..0000000 --- a/DVTk_Library/Libraries/Scripting/script4_parser.cpp +++ /dev/null @@ -1,5647 +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 script4error(char*); -extern int script4lex(void); -extern int script4lineno; - -extern SCRIPT_SESSION_CLASS *script4Session_ptr; - -typedef enum -{ - OPERAND_OR, - OPERAND_AND -} OPERAND_ENUM; - - -bool script4IsNativeVts = false; -char script4CurrentFilename[_MAX_PATH] = {" (not defined) "}; -long script4CurrentFileOffset = 0; -long script4CurrentLineNo = 0; -bool script4ParseOnly = 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 script4s!!! -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 script4r1[] = { 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 script4r2[] = { 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 script4defact[] = { 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 script4defgoto[] = { 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 script4pact[] = { 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 script4pgoto[] = {-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 script4errok (yyerrstatus = 0) -#define script4clearin (script4char = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto script4errlab1 -/* Like YYERROR except do call script4error. - 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 script4errlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (script4char == YYEMPTY && yylen == 1) \ - { script4char = (token), script4lval = (value); \ - script4char1 = YYTRANSLATE (script4char); \ - YYPOPSTACK; \ - goto script4backup; \ - } \ - else \ - { script4error ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX script4lex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX script4lex(&script4lval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX script4lex(&script4lval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX script4lex(&script4lval, YYLEX_PARAM) -#else -#define YYLEX script4lex(&script4lval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int script4char; /* the lookahead symbol */ -YYSTYPE script4lval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int script4nerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int script4debug; /* 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 script4parse (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 script4parse. 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 -script4parse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL -{ - register int script4state; - register int yyn; - register short *script4ssp; - register YYSTYPE *script4vsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int script4char1 = 0; /* lookahead token as an internal (translated) token number */ - - short script4ssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE script4vsa[YYINITDEPTH]; /* the semantic value stack */ - - short *script4ss = script4ssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *script4vs = script4vsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *script4lsp; - -#define YYPOPSTACK (script4vsp--, script4ssp--, script4lsp--) -#else -#define YYPOPSTACK (script4vsp--, script4ssp--) -#endif - - int script4stacksize = YYINITDEPTH; - -#ifdef YYPURE - int script4char; - YYSTYPE script4lval; - int script4nerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE script4val; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (script4debug) - fprintf(stderr, "Starting parse\n"); -#endif - - script4state = 0; - yyerrstatus = 0; - script4nerrs = 0; - script4char = 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. */ - - script4ssp = script4ss - 1; - script4vsp = script4vs; -#ifdef YYLSP_NEEDED - script4lsp = yyls; -#endif - -/* Push a new state, which is found in script4state . */ -/* 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: - - *++script4ssp = script4state; - - if (script4ssp >= script4ss + script4stacksize - 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 *script4vs1 = script4vs; - short *script4ss1 = script4ss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = script4ssp - script4ss + 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", - &script4ss1, size * sizeof (*script4ssp), - &script4vs1, size * sizeof (*script4vsp), - &yyls1, size * sizeof (*script4lsp), - &script4stacksize); -#else - yyoverflow("parser stack overflow", - &script4ss1, size * sizeof (*script4ssp), - &script4vs1, size * sizeof (*script4vsp), - &script4stacksize); -#endif - - script4ss = script4ss1; script4vs = script4vs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (script4stacksize >= YYMAXDEPTH) - { - script4error("parser stack overflow"); - return 2; - } - script4stacksize *= 2; - if (script4stacksize > YYMAXDEPTH) - script4stacksize = YYMAXDEPTH; - script4ss = (short *) alloca (script4stacksize * sizeof (*script4ssp)); - __yy_memcpy ((char *)script4ss1, (char *)script4ss, size * sizeof (*script4ssp)); - script4vs = (YYSTYPE *) alloca (script4stacksize * sizeof (*script4vsp)); - __yy_memcpy ((char *)script4vs1, (char *)script4vs, size * sizeof (*script4vsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (script4stacksize * sizeof (*script4lsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*script4lsp)); -#endif -#endif /* no yyoverflow */ - - script4ssp = script4ss + size - 1; - script4vsp = script4vs + size - 1; -#ifdef YYLSP_NEEDED - script4lsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (script4debug) - fprintf(stderr, "Stack size increased to %d\n", script4stacksize); -#endif - - if (script4ssp >= script4ss + script4stacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (script4debug) - fprintf(stderr, "Entering state %d\n", script4state); -#endif - - goto script4backup; - script4backup: - -/* 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 = script4pact[script4state]; - if (yyn == YYFLAG) - goto script4default; - - /* Not known => get a lookahead token if don't already have one. */ - - /* script4char is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (script4char == YYEMPTY) - { -#if YYDEBUG != 0 - if (script4debug) - fprintf(stderr, "Reading a token: "); -#endif - script4char = YYLEX; - } - - /* Convert token to internal form (in script4char1) for indexing tables with */ - - if (script4char <= 0) /* This means end of input. */ - { - script4char1 = 0; - script4char = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (script4debug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - script4char1 = YYTRANSLATE(script4char); - -#if YYDEBUG != 0 - if (script4debug) - { - fprintf (stderr, "Next token is %d (%s", script4char, yytname[script4char1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, script4char, script4lval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += script4char1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != script4char1) - goto script4default; - - 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 script4errlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto script4errlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (script4debug) - fprintf(stderr, "Shifting token %d (%s), ", script4char, yytname[script4char1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (script4char != YYEOF) - script4char = YYEMPTY; - - *++script4vsp = script4lval; -#ifdef YYLSP_NEEDED - *++script4lsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - script4state = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -script4default: - - yyn = script4defact[script4state]; - if (yyn == 0) - goto script4errlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = script4r2[yyn]; - if (yylen > 0) - script4val = script4vsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (script4debug) - { - 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[script4r1[yyn]]); - } -#endif - - - switch (yyn) { - -case 2: -#line 204 "script_parser.y" -{ - //cleanup - clearVTSUidMappings(); - ; - break;} -case 3: -#line 211 "script_parser.y" -{ - if (script4Session_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 4: -#line 218 "script_parser.y" -{ - if (script4Session_ptr->isSessionStopped()) - { - YYACCEPT; - } - ; - break;} -case 33: -#line 257 "script_parser.y" -{ - if (strcmp(script4vsp[0].string_ptr, "NATIVE_VTS") == 0) - { - script4IsNativeVts = true; - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[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 = script4Session_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(); - script4Session_ptr->resetAssociation(); - - // cleanup any outstanding relationships - // - from previous emulations / script4 executions - RELATIONSHIP->cleanup(); - - // reset the script4 execution context - script4Session_ptr->resetScriptExecutionContext(); - ; - break;} -case 35: -#line 295 "script_parser.y" -{ - // data warehouse should be emptied - LOG_CLASS *logger_ptr = script4Session_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 = script4Session_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."); - } - script4Session_ptr->resetAssociation(); - ; - break;} -case 37: -#line 322 "script_parser.y" -{ - // relation reset - // - backwards compatibility with VTS - LOG_CLASS *logger_ptr = script4Session_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 / script4 executions - RELATIONSHIP->cleanup(); - ; - break;} -case 38: -#line 339 "script_parser.y" -{ - // script4 execution context reset - LOG_CLASS *logger_ptr = script4Session_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 script4 execution context - script4Session_ptr->resetScriptExecutionContext(); - ; - break;} -case 39: -#line 356 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_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 (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_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 (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - BASE_CONFIRMER *confirmer_ptr = script4Session_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 434 "script_parser.y" -{ - if (!script4ParseOnly) - { - if ((wid1_ptr) && - (wid2_ptr)) - { - // copy the attribute in object 1 to that in object 2 - // - don't stop on returned error - copyAttribute(script4Session_ptr->getLogger(), wid1_ptr, group1, element1, wid2_ptr, group2, element2); - } - } - ; - break;} -case 44: -#line 452 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - // delay for given number of seconds - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DELAY %d seconds", script4vsp[0].integer); - } - - for (int sec = 0; sec < script4vsp[0].integer; sec++) - { - if (script4Session_ptr->isSessionStopped()) - { - YYACCEPT; - } -#ifdef _WINDOWS - Sleep(1000); -#else - sleep(1); -#endif - } - } - ; - break;} -case 47: -#line 484 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (wid1_ptr) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY object"); - } - - // display the referenced warehouse object - wid1_ptr->setLogger(script4Session_ptr->getLogger()); - - BASE_SERIALIZER *serializer_ptr = script4Session_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 (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DISPLAY WAREHOUSE"); - } - WAREHOUSE->serialize(script4Session_ptr->getLogger()); - } - ; - break;} -case 49: -#line 575 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - // display string to user - logger_ptr->text(LOG_SCRIPT, 1, script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - - ; - break;} -case 53: -#line 602 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!sendAcse(script4Session_ptr, associateRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 54: -#line 609 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!sendAcse(script4Session_ptr, associateAc_ptr, identifier)) YYABORT; - } - ; - break;} -case 55: -#line 616 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!sendAcse(script4Session_ptr, associateRj_ptr, identifier)) YYABORT; - } - ; - break;} -case 56: -#line 623 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!sendAcse(script4Session_ptr, releaseRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 57: -#line 630 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!sendAcse(script4Session_ptr, releaseRp_ptr, identifier)) YYABORT; - } - ; - break;} -case 58: -#line 637 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!sendAcse(script4Session_ptr, abortRq_ptr, identifier)) YYABORT; - } - ; - break;} -case 59: -#line 646 "script_parser.y" -{ - if (!script4ParseOnly) - { - /* Try to find the command object in the warehouse and send it */ - LOG_CLASS* logger_ptr = script4Session_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 (script4IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - resolveVTSUidMappings(cmd_ptr); - } - - if (!sendSop(script4Session_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 (!script4ParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = script4Session_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 (script4IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(script4Session_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 61: -#line 729 "script_parser.y" -{ - if (!script4ParseOnly) - { - /* Try to find the command and dataset objects in the warehouse and send them */ - LOG_CLASS* logger_ptr = script4Session_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 (script4IsNativeVts) - { - //Check for any VTS style uid mappings and try to resolve them - //before sending the object - resolveVTSUidMappings(cmd_ptr); - resolveVTSUidMappings(data_ptr); - } - - if (!sendSop(script4Session_ptr, cmd_ptr, data_ptr)) - { - YYABORT; - } - } - } - ; - break;} -case 63: -#line 786 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!importCommand(script4Session_ptr, commandField, identifier)) - { - YYABORT; - } - } - ; - break;} -case 64: -#line 796 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!importCommandDataset(script4Session_ptr, commandField, identifier, iodName, datasetidentifier)) - { - YYABORT; - } - } - ; - break;} -case 65: -#line 808 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setPopulateWithAttributes(true); - } - } - ; - break;} -case 66: -#line 825 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "POPULATE OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setPopulateWithAttributes(false); - } - } - ; - break;} -case 69: -#line 850 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - // set product role based on new setting for tool - if (script4vsp[0].userProvider == UP_REQUESTOR) - { - // tool role is now Requestor - // - product is therefore Acceptor - script4Session_ptr->setProductRoleIsRequestor(false); - script4Session_ptr->setProductRoleIsAcceptor(true); - } - else - { - // tool role is now Acceptor - // - product is therefore Requestor - script4Session_ptr->setProductRoleIsRequestor(true); - script4Session_ptr->setProductRoleIsAcceptor(false); - } - - if (logger_ptr) - { - if (script4vsp[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 (!script4ParseOnly) - { - // make system call within session - if (!systemCall(script4Session_ptr, script4vsp[0].string_ptr)) - { - YYABORT; - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 73: -#line 909 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_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 (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE ON"); - } - - // ignore command in debug mode - if (script4Session_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE ON"); - } - } - else - { - // enable the logger -// script4Session_ptr->enableLogger(); - - // resume the serializer -// BASE_SERIALIZER *serializer_ptr = script4Session_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Resume(); -// } - } - } - ; - break;} -case 76: -#line 973 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_INFO, 2, "VERBOSE OFF"); - } - - // ignore command in debug mode - if (script4Session_ptr->isLogLevel(LOG_DEBUG)) - { - if (logger_ptr) - { - logger_ptr->text(LOG_DEBUG, 1, "Ignoring VERBOSE OFF"); - } - } - else - { - // disable the logger -// script4Session_ptr->disableLogger(); - - // pause the serializer -// BASE_SERIALIZER *serializer_ptr = script4Session_ptr->getSerializer(); -// if (serializer_ptr) -// { -// serializer_ptr->Pause(); -// } - } - } - ; - break;} -case 78: -#line 1010 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "APPLICATION-ENTITY %s %s", script4vsp[-1].string_ptr, script4vsp[0].string_ptr); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setApplicationEntityName(script4vsp[-1].string_ptr); - script4ExecutionContext_ptr->setApplicationEntityVersion(script4vsp[0].string_ptr); - } - } - // free malloced string buffers - free(script4vsp[-1].string_ptr); - script4vsp[-1].string_ptr = NULL; - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - - ; - break;} -case 79: -#line 1036 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - switch(script4vsp[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 (script4vsp[0].validationFlag == (USE_DEFINITION | USE_VR)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-VR"); - else if (script4vsp[0].validationFlag == (USE_DEFINITION | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-DEF-AND-REF"); - else if (script4vsp[0].validationFlag == (USE_VR | USE_REFERENCE)) logger_ptr->text(LOG_SCRIPT, 2, "VALIDATION ENABLED-USE-VR-AND-REF"); - break; - } - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setValidationFlag(script4vsp[0].validationFlag); - } - } - ; - break;} -case 80: -#line 1067 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setDefineSqLength(true); - } - } - ; - break;} -case 81: -#line 1084 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "DEFINE-SQ-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setDefineSqLength(false); - } - } - ; - break;} -case 82: -#line 1103 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setAddGroupLength(true); - } - } - ; - break;} -case 83: -#line 1120 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "ADD-GROUP-LENGTH OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setAddGroupLength(false); - } - } - ; - break;} -case 84: -#line 1139 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION ON"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setStrictValidation(true); - } - } - ; - break;} -case 85: -#line 1156 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 2, "STRICT-VALIDATION OFF"); - } - - SCRIPT_EXECUTION_CONTEXT_CLASS *script4ExecutionContext_ptr = script4Session_ptr->getScriptExecutionContext(); - if (script4ExecutionContext_ptr) - { - script4ExecutionContext_ptr->setStrictValidation(false); - } - } - ; - break;} -case 86: -#line 1175 "script_parser.y" -{ - if (!script4ParseOnly) - { - 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(script4Session_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 87: -#line 1214 "script_parser.y" -{ - if (!script4ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script4Session_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(script4Session_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) YYABORT; - } - - if (dataset_ptr) - { - if (!command_ptr) - { - compareDatasetValueWithWarehouse(script4Session_ptr->getLogger(), (char*)(iodName).c_str(), dataset_ptr); - } - - if (!storeObjectInWarehouse(script4Session_ptr->getLogger(), dataset_ptr->getIdentifier(), dataset_ptr)) - { - YYABORT; - } - else - { - LOG_CLASS *logger_ptr = script4Session_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 (!script4ParseOnly) - { - 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 = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // clean up - side effect of parser - delete dataset_ptr; - dataset_ptr = NULL; - - if (!storeObjectInWarehouse(script4Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 89: -#line 1290 "script_parser.y" -{ - if (!script4ParseOnly) - { - 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(script4Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) YYABORT; - } - } - ; - break;} -case 90: -#line 1311 "script_parser.y" -{ - if (!script4ParseOnly) - { - 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(script4Session_ptr->getLogger()); - - // use the item handle - if (item_handle_ptr->resolveReference() != NULL) - { - if (!storeObjectInWarehouse(script4Session_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 (!script4ParseOnly) - { - if (fileHead_ptr) - { - if (!storeObjectInWarehouse(script4Session_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 92: -#line 1358 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (fileTail_ptr) - { - if (!storeObjectInWarehouse(script4Session_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 93: -#line 1370 "script_parser.y" -{ - if (!script4ParseOnly) - { - 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(script4Session_ptr->getLogger(), identifier.c_str(), wid)) YYABORT; - } - ; - break;} -case 94: -#line 1419 "script_parser.y" -{ - if (!script4ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script4Session_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command delete - serializer_ptr->SerializeDSDeleteCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!removeObjectFromWarehouse(script4Session_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 (!script4ParseOnly) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script4Session_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(script4Session_ptr->getLogger(), datasetidentifier.c_str(), WID_DATASET)) - { - // then try deleting as an item - leave explicit WID_ITEM in call - if (!removeObjectFromWarehouse(script4Session_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 (!script4ParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(script4Session_ptr->getLogger(), identifier.c_str(), WID_FILEHEAD)) YYABORT; - } - ; - break;} -case 97: -#line 1471 "script_parser.y" -{ - if (!script4ParseOnly) - { - identifier = ""; - - if (!removeObjectFromWarehouse(script4Session_ptr->getLogger(), identifier.c_str(), WID_FILETAIL)) YYABORT; - } - ; - break;} -case 98: -#line 1482 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(script4Session_ptr->getLogger(), script4Session_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 99: -#line 1493 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (wid1_ptr) - { - // display the referenced warehouse object - displayAttribute(script4Session_ptr->getLogger(), script4Session_ptr->getSerializer(), wid1_ptr, group, element); - } - } - ; - break;} -case 100: -#line 1506 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!readFileDataset(script4Session_ptr, script4vsp[-1].string_ptr, dataset_ptr)) YYABORT; - } - // free malloced string buffer - free(script4vsp[-1].string_ptr); - script4vsp[-1].string_ptr = NULL; - - ; - break;} -case 101: -#line 1517 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!readFileDataset(script4Session_ptr, script4vsp[-1].string_ptr, script4vsp[0].hex)) YYABORT; - } - // free malloced string buffer - free(script4vsp[-1].string_ptr); - script4vsp[-1].string_ptr = NULL; - ; - break;} -case 102: -#line 1529 "script_parser.y" -{ - if (!script4ParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!receiveAcse(script4Session_ptr, associateRq_ptr, identifier)) - { - clearValidationObjects(script4Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!receiveAcse(script4Session_ptr, associateAc_ptr, identifier)) - { - clearValidationObjects(script4Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!receiveAcse(script4Session_ptr, associateRj_ptr, identifier)) - { - clearValidationObjects(script4Session_ptr); - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!receiveAcse(script4Session_ptr, releaseRq_ptr, identifier)) - { - clearValidationObjects(script4Session_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!receiveAcse(script4Session_ptr, releaseRp_ptr, identifier)) - { - clearValidationObjects(script4Session_ptr); - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!receiveAcse(script4Session_ptr, abortRq_ptr, identifier)) - { - clearValidationObjects(script4Session_ptr); - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!receiveAcse(script4Session_ptr, unknownPdu_ptr, identifier)) - { - clearValidationObjects(script4Session_ptr); - YYABORT; - } - - // parser cleanup - delete unknownPdu_ptr; - unknownPdu_ptr = NULL; - break; - default: break; - } - } - ; - break;} -case 103: -#line 1616 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!receiveSop(script4Session_ptr, command_ptr, dataset_ptr)) - { - clearValidationObjects(script4Session_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 (!script4ParseOnly) - { - switch(acseType) - { - case PDU_ASSOCIATE_RQ: - if (!sendAcse(script4Session_ptr, associateRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRq_ptr; - associateRq_ptr = NULL; - break; - case PDU_ASSOCIATE_AC: - if (!sendAcse(script4Session_ptr, associateAc_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateAc_ptr; - associateAc_ptr = NULL; - break; - case PDU_ASSOCIATE_RJ: - if (!sendAcse(script4Session_ptr, associateRj_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete associateRj_ptr; - associateRj_ptr = NULL; - break; - case PDU_RELEASE_RQ: - if (!sendAcse(script4Session_ptr, releaseRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRq_ptr; - releaseRq_ptr = NULL; - break; - case PDU_RELEASE_RP: - if (!sendAcse(script4Session_ptr, releaseRp_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete releaseRp_ptr; - releaseRp_ptr = NULL; - break; - case PDU_ABORT_RQ: - if (!sendAcse(script4Session_ptr, abortRq_ptr, identifier)) - { - YYABORT; - } - - // parser cleanup - delete abortRq_ptr; - abortRq_ptr = NULL; - break; - case PDU_UNKNOWN: - if (!sendAcse(script4Session_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 (!script4ParseOnly) - { - if (!sendSop(script4Session_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 (!script4ParseOnly) - { - // 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(script4Session_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 (!script4ParseOnly) - { - presContextId = (BYTE) script4vsp[-1].hex; - } - ; - break;} -case 108: -#line 1769 "script_parser.y" -{ - if (!script4ParseOnly) - { - presContextId = (BYTE) script4vsp[-1].integer; - } - ; - break;} -case 109: -#line 1778 "script_parser.y" -{ - if (!script4ParseOnly) - { - 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(script4Session_ptr->getLogger(), identifier.c_str(), wid_ptr)) YYABORT; - } - } - ; - break;} -case 110: -#line 1817 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (command_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script4Session_ptr->getSerializer(); - if (serializer_ptr) - { - // serialize the command set - serializer_ptr->SerializeDSSetCommandSet(command_ptr->getIdentifier(), command_ptr); - } - - if (!updateObjectInWarehouse(script4Session_ptr->getLogger(), command_ptr->getIdentifier(), command_ptr)) - { - LOG_CLASS *logger_ptr = script4Session_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 (!script4ParseOnly) - { - if (dataset_ptr) - { - // serialize - BASE_SERIALIZER *serializer_ptr = script4Session_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(script4Session_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 = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr->setDefinedLength(definedLength); - - // then try updating as an item - if (!updateObjectInWarehouse(script4Session_ptr->getLogger(), item_ptr->getIdentifier(), item_ptr)) - { - LOG_CLASS *logger_ptr = script4Session_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 (!script4ParseOnly) - { - if (fileHead_ptr) - { - if (!updateObjectInWarehouse(script4Session_ptr->getLogger(), identifier.c_str(), fileHead_ptr)) YYABORT; - } - } - ; - break;} -case 113: -#line 1898 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (fileTail_ptr) - { - if (!updateObjectInWarehouse(script4Session_ptr->getLogger(), identifier.c_str(), fileTail_ptr)) YYABORT; - } - } - ; - break;} -case 114: -#line 1910 "script_parser.y" -{ - if (!script4ParseOnly) - { - // try to validate the Sop Class - if (!validateSopAgainstList(script4Session_ptr, command_ptr, dataset_ptr)) - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(script4Session_ptr); - YYABORT; - } - else - { - //cleanup, parser side effect - command_ptr = 0; - dataset_ptr = 0; - clearValidationObjects(script4Session_ptr); - } - } - ; - break;} -case 115: -#line 1934 "script_parser.y" -{ - if (!script4ParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = script4Session_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 (!script4ParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = script4Session_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 (!script4ParseOnly) - { - addReferenceObjects(script4Session_ptr,ref_command_ptr, ref_dataset_ptr, script4Session_ptr->getLogger()); - } - ; - break;} -case 119: -#line 1994 "script_parser.y" -{ - if (!script4ParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(script4Session_ptr,ref_command_ptr, ref_dataset_ptr, script4Session_ptr->getLogger()); - } - ; - break;} -case 120: -#line 2004 "script_parser.y" -{ - if (!script4ParseOnly) - { - /* Try to find the command object in the warehouse */ - LOG_CLASS* logger_ptr = script4Session_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 (!script4ParseOnly) - { - /* Try to find the objects in the warehouse */ - LOG_CLASS* logger_ptr = script4Session_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 (!script4ParseOnly) - { - // 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 (!script4ParseOnly) - { - addReferenceObjects(script4Session_ptr, command_ptr, dataset_ptr, script4Session_ptr->getLogger()); - } - ; - break;} -case 124: -#line 2082 "script_parser.y" -{ - if (!script4ParseOnly) - { - setLogicalOperand(OPERAND_OR); - addReferenceObjects(script4Session_ptr, command_ptr, dataset_ptr, script4Session_ptr->getLogger()); - } - ; - break;} -case 125: -#line 2090 "script_parser.y" -{ - if (!script4ParseOnly) - { - setLogicalOperand(OPERAND_AND); - addReferenceObjects(script4Session_ptr, command_ptr, dataset_ptr, script4Session_ptr->getLogger()); - } - ; - break;} -case 126: -#line 2100 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!writeFileHead(script4Session_ptr->getLogger(), script4vsp[-1].string_ptr, script4Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script4vsp[-1].string_ptr); - script4vsp[-1].string_ptr = NULL; - ; - break;} -case 127: -#line 2110 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!writeFileTail(script4Session_ptr->getLogger(), script4vsp[-1].string_ptr, script4Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script4vsp[-1].string_ptr); - script4vsp[-1].string_ptr = NULL; - ; - break;} -case 128: -#line 2120 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (!writeFileDataset(script4Session_ptr->getLogger(), script4vsp[-1].string_ptr, dataset_ptr,script4Session_ptr->getAutoCreateDirectory())) YYABORT; - } - // free malloced string buffer - free(script4vsp[-1].string_ptr); - script4vsp[-1].string_ptr = NULL; - ; - break;} -case 142: -#line 2149 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store the user information - associateRq_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 145: -#line 2164 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set associate request protocol version parameter - associateRq_ptr->setProtocolVersion((UINT16) script4vsp[0].integer); - } - ; - break;} -case 146: -#line 2172 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - if (strlen(script4vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", script4vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request called Ae title parameter - associateRq_ptr->setCalledAeTitle((char*) script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 147: -#line 2196 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - if (strlen(script4vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Request", script4vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate request calling Ae title parameter - associateRq_ptr->setCallingAeTitle((char*) script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 148: -#line 2220 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // set associate request application context parameter - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[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*) script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 150: -#line 2245 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) script4vsp[0].integer); - } - ; - break;} -case 151: -#line 2253 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 152: -#line 2277 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) script4vsp[0].string_ptr); - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 155: -#line 2291 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) script4vsp[-1].integer, (UINT16) script4vsp[0].integer); - } - ; - break;} -case 162: -#line 2311 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[-3].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script4vsp[-3].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script4vsp[-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 (!script4ParseOnly) - { - convertHex(script4vsp[-7].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[-7].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script4vsp[-7].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script4vsp[-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) script4vsp[-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 = script4vsp[-5].integer; - int scpRole = script4vsp[-3].integer; - - // check if roles explicitly defined by script4s - 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(script4vsp[-7].string_ptr); - script4vsp[-7].string_ptr = NULL; - ; - break;} -case 164: -#line 2427 "script_parser.y" -{ - if (!script4ParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 165: -#line 2435 "script_parser.y" -{ - if (!script4ParseOnly) - { - // save the latest transfer syntax - presRqContext.addTransferSyntaxName(transferSyntaxName); - } - ; - break;} -case 166: -#line 2445 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - transferSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - transferSyntaxName.setUid((char*) script4vsp[0].string_ptr); - - // check that we now have a valid transfer syntax - if (!transferSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script4vsp[0].string_ptr); - logger_ptr->text(LOG_NONE, 1, "Check that the correct Definition File (.def) is loaded"); - } - YYABORT; - } - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 169: -#line 2487 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[-3].string_ptr); - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[-3].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassExtended.setUid((char*) uid.c_str()); - } - else - { - // store given uid - sopClassExtended.setUid((char*) script4vsp[-3].string_ptr); - - // check that we now have a valid transfer syntax - if (!sopClassExtended.isUidValid()) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script4vsp[-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(script4vsp[-3].string_ptr); - script4vsp[-3].string_ptr = NULL; - ; - break;} -case 172: -#line 2533 "script_parser.y" -{ - if (!script4ParseOnly) - { - // handle application info bytes - sopClassExtended.addApplicationInformation((BYTE) script4vsp[0].integer); - } - ; - break;} -case 175: -#line 2547 "script_parser.y" -{ - if (!script4ParseOnly) - { - UID_CLASS sopClassUid; - - convertHex(script4vsp[-5].string_ptr); - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[-5].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - sopClassUid.set((char*) uid.c_str()); - } - else - { - // store given uid - sopClassUid.set((char*) script4vsp[-5].string_ptr); - - // check that we now have a valid abstract syntax - if (!sopClassUid.isValid()) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script4vsp[-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) script4vsp[-3].integer); - scpScuRoleSelect.setScuRole((BYTE) script4vsp[-1].integer); - - // store scp scu role select - userInformation.addScpScuRoleSelect(scpScuRoleSelect); - } - // free malloced string buffer - free(script4vsp[-5].string_ptr); - script4vsp[-5].string_ptr = NULL; - ; - break;} -case 176: -#line 2595 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) script4vsp[-2].integer, (BYTE) script4vsp[-1].integer, script4vsp[0].string_ptr); - } - - // free malloced string buffer - free(script4vsp[0].string_ptr); - ; - break;} -case 177: -#line 2606 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation((BYTE) script4vsp[-3].integer, (BYTE) script4vsp[-2].integer, script4vsp[-1].string_ptr, script4vsp[0].string_ptr); - } - - // free malloced string buffer - free(script4vsp[-1].string_ptr); - free(script4vsp[0].string_ptr); - ; - break;} -case 178: -#line 2618 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store the user identity information - userInformation.setUserIdentityNegotiation(script4vsp[0].string_ptr); - } - - // free malloced string buffer - free(script4vsp[0].string_ptr); - ; - break;} -case 180: -#line 2632 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store the user information - associateAc_ptr->setUserInformation(userInformation); - userInformation.cleanup(); - } - ; - break;} -case 183: -#line 2647 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set associate accept protocol version parameter - associateAc_ptr->setProtocolVersion((UINT16) script4vsp[0].integer); - } - ; - break;} -case 184: -#line 2655 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - if (strlen(script4vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Called AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", script4vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept called Ae title parameter - associateAc_ptr->setCalledAeTitle((char*) script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 185: -#line 2679 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - if (strlen(script4vsp[0].string_ptr) > AE_LENGTH) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Calling AE Title \"%s\" - length exceeds maximum of %d allowed in Associate Accept", script4vsp[0].string_ptr, AE_LENGTH); - } - YYABORT; - } - else - { - // set associate accept calling Ae title parameter - associateAc_ptr->setCallingAeTitle((char*) script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 186: -#line 2703 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // set associate accept application context parameter - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[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*) script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 188: -#line 2728 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set user information maximum length received parameter - userInformation.setMaximumLengthReceived((UINT32) script4vsp[0].integer); - } - ; - break;} -case 189: -#line 2736 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // set user information implementation class uid parameter - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[0].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - userInformation.setImplementationClassUid((char*) uid.c_str()); - } - else - { - // store given uid - userInformation.setImplementationClassUid((char*) script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 190: -#line 2760 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // set user information implementation version name parameter - userInformation.setImplementationVersionName((char*) script4vsp[0].string_ptr); - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 193: -#line 2774 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set user information asynchronous operations window parameter - userInformation.setAsynchronousOperationWindow((UINT16) script4vsp[-1].integer, (UINT16) script4vsp[0].integer); - } - ; - break;} -case 199: -#line 2793 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[-4].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[-4].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script4vsp[-4].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script4vsp[-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) script4vsp[-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(script4vsp[-4].string_ptr); - script4vsp[-4].string_ptr = NULL; - ; - break;} -case 200: -#line 2848 "script_parser.y" -{ - if (!script4ParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 202: -#line 2859 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[-2].string_ptr); - ABSTRACT_SYNTAX_NAME_CLASS abstractSyntaxName; - - // check whether name to uid mapping needed - string uid = script4Session_ptr->getSopUid((char*) script4vsp[-2].string_ptr); - - if (uid.length() > 0) - { - // stored mapped uid - abstractSyntaxName.setUid((char*) uid.c_str()); - } - else - { - // store given uid - abstractSyntaxName.setUid((char*) script4vsp[-2].string_ptr); - - // check that we now have a valid abstract syntax - if (!abstractSyntaxName.isUidValid()) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (logger_ptr) - { - logger_ptr->text(LOG_ERROR, 1, "Cannot map '%s' to a UID", script4vsp[-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) script4vsp[-6].integer); - - // store the result - presAcContext.setResultReason((BYTE) script4vsp[-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) script4vsp[-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(script4vsp[-2].string_ptr); - script4vsp[-2].string_ptr = NULL; - ; - break;} -case 203: -#line 2929 "script_parser.y" -{ - if (!script4ParseOnly) - { - // no transfer syntax name provided - transferSyntaxName.setUid(""); - } - ; - break;} -case 204: -#line 2937 "script_parser.y" -{ - if (!script4ParseOnly) - { - assocAcScuScpRolesDefined = false; - int scuRole = script4vsp[-4].integer; - int scpRole = script4vsp[-2].integer; - - // check if roles explicitly defined by script4s - 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 (!script4ParseOnly) - { - // set associate reject result parameter - associateRj_ptr->setResult((BYTE) script4vsp[0].integer); - } - ; - break;} -case 210: -#line 2974 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set associate reject source parameter - associateRj_ptr->setSource((BYTE) script4vsp[0].integer); - } - ; - break;} -case 211: -#line 2982 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set associate reject reason parameter - associateRj_ptr->setReason((BYTE) script4vsp[0].integer); - } - ; - break;} -case 218: -#line 3006 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set abort request source parameter - abortRq_ptr->setSource((BYTE) script4vsp[0].integer); - } - ; - break;} -case 219: -#line 3014 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set abort request reason parameter - abortRq_ptr->setReason((BYTE) script4vsp[0].integer); - } - ; - break;} -case 220: -#line 3024 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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(script4Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script4Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 221: -#line 3049 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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(script4Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_AC; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script4Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 222: -#line 3074 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set up default associate reject details - associateRj_ptr = new ASSOCIATE_RJ_CLASS(); - - // cascade the logger - associateRj_ptr->setLogger(script4Session_ptr->getLogger()); - - acseType = PDU_ASSOCIATE_RJ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script4Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 223: -#line 3094 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set up default release request details - releaseRq_ptr = new RELEASE_RQ_CLASS(); - - // cascade the logger - releaseRq_ptr->setLogger(script4Session_ptr->getLogger()); - - acseType = PDU_RELEASE_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script4Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 224: -#line 3114 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set up default release response details - releaseRp_ptr = new RELEASE_RP_CLASS(); - - // cascade the logger - releaseRp_ptr->setLogger(script4Session_ptr->getLogger()); - - acseType = PDU_RELEASE_RP; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script4Session_ptr->getInstanceId()); - identifier = buffer; - - } - ; - break;} -case 225: -#line 3135 "script_parser.y" -{ - if (!script4ParseOnly) - { - // set up default abort request details - abortRq_ptr = new ABORT_RQ_CLASS(); - - // cascade the logger - abortRq_ptr->setLogger(script4Session_ptr->getLogger()); - - acseType = PDU_ABORT_RQ; - - // set up identifier - char buffer[32]; - sprintf(buffer, "ID%d", script4Session_ptr->getInstanceId()); - identifier = buffer; - } - ; - break;} -case 233: -#line 3168 "script_parser.y" -{ - if (!script4ParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField); - - // cascade the logger - command_ptr->setLogger(script4Session_ptr->getLogger()); - dataset_ptr = NULL; - identifier = ""; - } - ; - break;} -case 234: -#line 3181 "script_parser.y" -{ - if (!script4ParseOnly) - { - // instantiate a new command - command_ptr = new DCM_COMMAND_CLASS(commandField, identifier); - - // cascade the logger - command_ptr->setLogger(script4Session_ptr->getLogger()); - dataset_ptr = NULL; - } - ; - break;} -case 235: -#line 3195 "script_parser.y" -{ - if (!script4ParseOnly) - { - // save command field locally - commandField = script4lval.commandField; - } - ; - break;} -case 236: -#line 3205 "script_parser.y" -{ - if (!script4ParseOnly) - { - // save identifier locally - identifier = script4lval.identifier; - } - ; - break;} -case 242: -#line 3226 "script_parser.y" -{ - if (!script4ParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName); - - // cascade the logger - dataset_ptr->setLogger(script4Session_ptr->getLogger()); - - bool addGroupLength = script4Session_ptr->getAddGroupLength(); - bool populateWithAttributes = script4Session_ptr->getAutoType2Attributes(); - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - addGroupLength = script4Session_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = script4Session_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = script4Session_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 (!script4ParseOnly) - { - // instantiate a new dataset - dataset_ptr = new DCM_DATASET_CLASS(commandField, iodName, datasetidentifier); - - bool addGroupLength = script4Session_ptr->getAddGroupLength(); - bool populateWithAttributes = script4Session_ptr->getAutoType2Attributes(); - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - addGroupLength = script4Session_ptr->getScriptExecutionContext()->getAddGroupLength(); - populateWithAttributes = script4Session_ptr->getScriptExecutionContext()->getPopulateWithAttributes(); - definedLength = script4Session_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 (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // save iod name locally - // - check first for iod name mapping - iodName = script4Session_ptr->getIodName((char*) script4vsp[0].string_ptr); - if (!iodName.length()) - { - // no name mapping - take iod name directly - iodName = (char*) script4vsp[0].string_ptr; - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 248: -#line 3311 "script_parser.y" -{ - if (!script4ParseOnly) - { - // save identifier locally - datasetidentifier = script4vsp[0].identifier; - } - ; - break;} -case 249: -#line 3319 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // save the identifier locally - datasetidentifier = script4vsp[0].string_ptr; - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 250: -#line 3333 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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 (!script4ParseOnly) - { - // 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 (!script4ParseOnly) - { - // 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(script4Session_ptr->getLogger()); - } - ; - break;} -case 254: -#line 3396 "script_parser.y" -{ - if (!script4ParseOnly) - { - // instantiate a new attribute - attribute_ptr[nd] = new DCM_ATTRIBUTE_CLASS(group, element); - - // cascade the logger - attribute_ptr[nd]->setLogger(script4Session_ptr->getLogger()); - - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - attribute_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 255: -#line 3416 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store tag locally - group = (UINT16) (script4lval.hex >> 16); - element = (UINT16) (script4lval.hex & 0x0000FFFF); - } - ; - break;} -case 258: -#line 3431 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (nd == 0) - { - LOG_CLASS *logger_ptr = script4Session_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 (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_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 = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 260: -#line 3491 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_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 = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 263: -#line 3533 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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(script4Session_ptr->getLogger()); - - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_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(script4Session_ptr->getLogger()); - - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 264: -#line 3576 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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(script4Session_ptr->getLogger()); - - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_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(script4Session_ptr->getLogger()); - - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - } - ; - break;} -case 265: -#line 3620 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - // store item - identifier - item_ptr[nd]->setIdentifier(script4vsp[0].string_ptr); - item_ptr[nd]->setValueByReference(true); - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 266: -#line 3635 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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(script4Session_ptr->getLogger()); - - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_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(script4Session_ptr->getLogger()); - - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 267: -#line 3673 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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(script4Session_ptr->getLogger()); - - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_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(script4Session_ptr->getLogger()); - - bool definedLength = script4Session_ptr->getDefineSqLength(); - if (script4Session_ptr->getScriptExecutionContext()) - { - definedLength = script4Session_ptr->getScriptExecutionContext()->getDefineSqLength(); - } - item_ptr[nd]->setDefinedLength(definedLength); - } - ; - break;} -case 272: -#line 3721 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store item - attribute value - item_ptr[nd]->AddAttribute(attribute_ptr[nd]); - } - ; - break;} -case 274: -#line 3734 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_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", script4lineno); - } - 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", script4lineno); - } - YYABORT; - } - - // store attribute vr - attribute_ptr[nd]->SetVR(vr); - attribute_ptr[nd]->setDefinedLength(false); - } - ; - break;} -case 275: -#line 3767 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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 (!script4ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script4lval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = false; - } - ; - break;} -case 277: -#line 3789 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script4lval.vr; - transferVr = TRANSFER_ATTR_VR_IMPLICIT; - definedLength = true; - } - ; - break;} -case 278: -#line 3799 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script4lval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = false; - } - ; - break;} -case 279: -#line 3809 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script4lval.vr; - transferVr = TRANSFER_ATTR_VR_UNKNOWN; - definedLength = true; - } - ; - break;} -case 280: -#line 3819 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script4lval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = false; - } - ; - break;} -case 281: -#line 3829 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store vr, transfer vr & defined length locally - vr = script4lval.vr; - transferVr = TRANSFER_ATTR_VR_QUESTION; - definedLength = true; - } - ; - break;} -case 284: -#line 3845 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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 (!script4ParseOnly) - { - // 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 (!script4ParseOnly) - { - // special check for the Image Display Format ID / Pixel Data / FMI version attribute - // - these need to be handled differently for the ADVT script4s - if (((group == 0x2010) && - (element == 0x0010)) || - ((group == 0x7FE0) && - (element == 0x0010)) || - ((group == 0x0002) && - (element == 0x0001))) - { - convertDoubleBackslash(script4vsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(script4Session_ptr, script4vsp[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(script4vsp[0].string_ptr); - } - else - { - convertHex(script4vsp[0].string_ptr); - - // store string attribute value locally - value_ptr = stringValue(script4Session_ptr, script4vsp[0].string_ptr, vr, group, element); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 287: -#line 3939 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store hex attribute value locally - value_ptr = hexValue(script4Session_ptr, script4vsp[0].hex, vr, group, element); - } - ; - break;} -case 288: -#line 3947 "script_parser.y" -{ - if (!script4ParseOnly) - { - // store integer attribute value locally - value_ptr = integerValue(script4Session_ptr, script4vsp[0].integer, vr, group, element); - } - ; - break;} -case 289: -#line 3955 "script_parser.y" -{ - if (!script4ParseOnly) - { - // autoset attribute value - value_ptr = autoSetValue(script4Session_ptr, vr, group, element); - } - ; - break;} -case 290: -#line 3964 "script_parser.y" -{ - if (!script4ParseOnly) - { - // copy tag to reference one - group1 = group; - element1 = element; - } - ; - break;} -case 291: -#line 3975 "script_parser.y" -{ - if (!script4ParseOnly) - { - // 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 (!script4ParseOnly) - { - // look up tag by name and get group & element returned - group = 0; - element = 0; - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 294: -#line 4003 "script_parser.y" -{ - if (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid1_ptr = retrieveFromWarehouse(script4Session_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 (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid1_ptr = retrieveFromWarehouse(script4Session_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(script4Session_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(script4Session_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 (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (command_ptr) - { - // get reference to this command - wid2_ptr = retrieveFromWarehouse(script4Session_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 (!script4ParseOnly) - { - LOG_CLASS *logger_ptr = script4Session_ptr->getLogger(); - - if (dataset_ptr) - { - // get reference to this dataset - wid2_ptr = retrieveFromWarehouse(script4Session_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(script4Session_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(script4Session_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 (!script4ParseOnly) - { - // 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 (!script4ParseOnly) - { - // 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 (!script4ParseOnly) - { - // default Item Number is 1 - index is then zero - itemNumber = 0; - } - ; - break;} -case 301: -#line 4175 "script_parser.y" -{ - if (!script4ParseOnly) - { - // take given Item Number - index is one less - itemNumber = script4vsp[-1].integer - 1; - } - ; - break;} -case 304: -#line 4189 "script_parser.y" -{ - if (!script4ParseOnly) - { - fileHead_ptr = new FILEHEAD_CLASS(); - - // cascade the logger - fileHead_ptr->setLogger(script4Session_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 310: -#line 4212 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPreambleValue(script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 311: -#line 4228 "script_parser.y" -{ - if (!script4ParseOnly) - { - convertHex(script4vsp[0].string_ptr); - if (fileHead_ptr) - { - fileHead_ptr->setPrefix(script4vsp[0].string_ptr); - } - } - // free malloced string buffer - free(script4vsp[0].string_ptr); - script4vsp[0].string_ptr = NULL; - ; - break;} -case 312: -#line 4244 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (fileHead_ptr) - { - fileHead_ptr->setTransferSyntaxUid(transferSyntaxName.getUid()); - } - } - ; - break;} -case 315: -#line 4260 "script_parser.y" -{ - if (!script4ParseOnly) - { - fileTail_ptr = new FILETAIL_CLASS(); - - // cascade the logger - fileTail_ptr->setLogger(script4Session_ptr->getLogger()); - - identifier = ""; - } - ; - break;} -case 321: -#line 4283 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(true); - } - } - ; - break;} -case 322: -#line 4293 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setTrailingPadding(false); - } - } - ; - break;} -case 323: -#line 4305 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setSectorSize(script4vsp[0].integer); - } - } - ; - break;} -case 324: -#line 4317 "script_parser.y" -{ - if (!script4ParseOnly) - { - if (fileTail_ptr) - { - fileTail_ptr->setPaddingValue((BYTE)script4vsp[0].integer); - } - } - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "bison.simple" - - script4vsp -= yylen; - script4ssp -= yylen; -#ifdef YYLSP_NEEDED - script4lsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (script4debug) - { - short *ssp1 = script4ss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != script4ssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++script4vsp = script4val; - -#ifdef YYLSP_NEEDED - script4lsp++; - if (yylen == 0) - { - script4lsp->first_line = yylloc.first_line; - script4lsp->first_column = yylloc.first_column; - script4lsp->last_line = (script4lsp-1)->last_line; - script4lsp->last_column = (script4lsp-1)->last_column; - script4lsp->text = 0; - } - else - { - script4lsp->last_line = (script4lsp+yylen-1)->last_line; - script4lsp->last_column = (script4lsp+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 = script4r1[yyn]; - - script4state = script4pgoto[yyn - YYNTBASE] + *script4ssp; - if (script4state >= 0 && script4state <= YYLAST && yycheck[script4state] == *script4ssp) - script4state = yytable[script4state]; - else - script4state = script4defgoto[yyn - YYNTBASE]; - - goto yynewstate; - -script4errlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++script4nerrs; - -#ifdef YYERROR_VERBOSE - yyn = script4pact[script4state]; - - 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++; - } - } - script4error(msg); - free(msg); - } - else - script4error ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - script4error("parse error"); - } - - goto script4errlab1; -script4errlab1: /* 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 (script4char == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (script4debug) - fprintf(stderr, "Discarding token %d (%s).\n", script4char, yytname[script4char1]); -#endif - - script4char = 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 = script4defact[script4state]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto script4default; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (script4ssp == script4ss) YYABORT; - script4vsp--; - script4state = *--script4ssp; -#ifdef YYLSP_NEEDED - script4lsp--; -#endif - -#if YYDEBUG != 0 - if (script4debug) - { - short *ssp1 = script4ss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != script4ssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = script4pact[script4state]; - 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 (script4debug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++script4vsp = script4lval; -#ifdef YYLSP_NEEDED - *++script4lsp = yylloc; -#endif - - script4state = yyn; - goto yynewstate; -} -#line 4327 "script_parser.y" - - diff --git a/DVTk_Library/Libraries/Scripting/script4_parser.cpp.h b/DVTk_Library/Libraries/Scripting/script4_parser.cpp.h deleted file mode 100644 index e81e183..0000000 --- a/DVTk_Library/Libraries/Scripting/script4_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 script4lval; diff --git a/DVTk_Library/Libraries/Scripting/script_lexer.cpp b/DVTk_Library/Libraries/Scripting/script_lexer.cpp deleted file mode 100644 index dc5856f..0000000 --- a/DVTk_Library/Libraries/Scripting/script_lexer.cpp +++ /dev/null @@ -1,3409 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE scriptrestart( scriptin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int scriptleng; -extern FILE *scriptin, *scriptout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up scripttext. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up scripttext again */ \ - } \ - while ( 0 ) - -#define unput(c) scriptunput( c, scripttext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via scriptrestart()), so that the user can continue scanning by - * just pointing scriptin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when scripttext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int scriptleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow scriptwrap()'s to do buffer switches - * instead of setting up a fresh scriptin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void scriptrestart YY_PROTO(( FILE *input_file )); - -void script_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void script_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE script_create_buffer YY_PROTO(( FILE *file, int size )); -void script_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void script_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void script_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER script_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE script_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE script_scan_string YY_PROTO(( yyconst char *str )); -YY_BUFFER_STATE script_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer script_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script_create_buffer( scriptin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = script_create_buffer( scriptin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define scriptwrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *scriptin = (FILE *) 0, *scriptout = (FILE *) 0; -typedef int yy_state_type; -#define YY_FLEX_LEX_COMPAT -extern int scriptlineno; -int scriptlineno = 1; -extern char scripttext[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up scripttext. - */ -#define YY_DO_BEFORE_ACTION \ - scripttext_ptr = yy_bp; \ - scripttext_ptr -= yy_more_len; \ - scriptleng = (int) (yy_cp - scripttext_ptr); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( scriptleng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( scripttext, scripttext_ptr, scriptleng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 211 -#define YY_END_OF_BUFFER 212 -static yyconst short int yy_acclist[969] = - { 0, - 212, 210, 211, 7, 210, 211, 7, 211, 210, 211, - 210, 211, 12, 210, 211, 14, 210, 211, 210, 211, - 206, 210, 211, 206, 210, 211, 10, 210, 211, 9, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 210, 211, 210, 211, 210, 211, 210, 211, - 210, 211, 11, 210, 211, 13, 210, 211, 1, 210, - 211, 7, 210, 211, 6, 7, 211, 210, 211, 7, - 209, 5, 205, 206, 207, 207, 207, 207, 15, 207, - - 207, 207, 207, 16, 207, 17, 207, 207, 207, 207, - 207, 207, 18, 207, 207, 19, 207, 207, 207, 20, - 207, 21, 207, 207, 207, 207, 22, 207, 207, 23, - 207, 207, 24, 207, 207, 25, 207, 26, 207, 207, - 189, 207, 207, 27, 207, 28, 207, 192, 207, 194, - 207, 29, 207, 30, 207, 207, 31, 207, 207, 207, - 207, 207, 207, 207, 32, 207, 33, 207, 207, 34, - 207, 35, 207, 36, 207, 207, 207, 37, 207, 207, - 38, 207, 39, 207, 40, 207, 41, 207, 42, 207, - 43, 207, 207, 207, 207, 207, 207, 8, 7, 6, - - 7, 4, 5, 208, 203, 204, 204, 203, 207, 207, - 207, 142, 207, 193, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 191, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 199, 207, 207, 201, 207, 207, - 207, 207, 47, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 190, 207, 4, 2, - 4, 5, 207, 207, 207, 207, 207, 207, 207, 207, - - 207, 207, 207, 207, 50, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 58, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 52, 207, 207, 207, 207, 207, 207, - 207, 207, 59, 207, 207, 207, 207, 44, 207, 207, - 207, 207, 207, 207, 55, 207, 207, 207, 207, 207, - 207, 207, 207, 2, 4, 3, 4, 5, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - - 61, 207, 207, 207, 207, 207, 207, 207, 207, 198, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 45, 207, 207, 207, 207, 207, 207, - 207, 207, 196, 207, 207, 207, 207, 207, 207, 207, - 53, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 46, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 51, 207, 207, 207, 207, 207, - 83, 207, 207, 207, 207, 82, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 177, - - 207, 207, 207, 171, 207, 207, 207, 207, 207, 168, - 207, 207, 207, 207, 197, 207, 169, 207, 207, 54, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 186, 207, 140, 207, 207, 207, 207, 207, 48, 207, - 60, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 57, 207, 69, 207, 81, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 195, - 207, 207, 207, 207, 207, 207, 80, 207, 207, 207, - 207, 207, 207, 207, 207, 56, 67, 207, 207, 141, - 200, 207, 207, 207, 207, 207, 207, 93, 207, 207, - - 207, 207, 207, 207, 92, 207, 207, 207, 207, 207, - 207, 76, 207, 207, 207, 207, 77, 207, 207, 123, - 127, 207, 207, 207, 207, 122, 207, 207, 126, 207, - 207, 207, 65, 207, 176, 207, 207, 207, 207, 145, - 207, 207, 207, 207, 79, 207, 78, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 85, 89, 95, 97, - 207, 207, 207, 207, 84, 207, 207, 88, 207, 207, - 94, 207, 96, 207, 207, 207, 207, 207, 173, 175, - 172, 207, 174, 207, 207, 207, 125, 129, 207, 207, - 207, 207, 124, 207, 128, 207, 207, 207, 207, 207, - - 202, 207, 207, 207, 207, 143, 207, 207, 207, 207, - 207, 207, 87, 91, 99, 101, 207, 207, 207, 207, - 86, 207, 90, 207, 98, 207, 100, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 139, 137, 207, 207, 68, 207, 207, 144, 207, - 207, 207, 207, 105, 103, 207, 207, 49, 207, 104, - 207, 102, 207, 207, 207, 207, 207, 107, 111, 115, - 106, 207, 207, 110, 207, 207, 114, 207, 207, 207, - 207, 207, 207, 207, 181, 180, 207, 207, 207, 133, - 135, 131, 207, 207, 138, 207, 136, 207, 207, 207, - - 207, 207, 207, 207, 109, 113, 117, 108, 207, 112, - 207, 116, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 185, - 184, 207, 207, 207, 207, 207, 207, 132, 207, 134, - 207, 130, 207, 207, 207, 207, 188, 187, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 150, 149, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 179, 178, - 207, 63, 207, 152, 151, 207, 207, 64, 207, 207, - 207, 207, 207, 148, 147, 207, 207, 207, 207, 207, - 207, 207, 119, 118, 207, 207, 207, 170, 207, 66, - - 62, 207, 207, 207, 207, 207, 121, 120, 207, 207, - 207, 207, 71, 207, 207, 207, 207, 207, 207, 70, - 72, 207, 207, 207, 156, 155, 207, 207, 207, 207, - 207, 207, 165, 207, 207, 73, 75, 207, 207, 207, - 207, 207, 74, 207, 207, 159, 158, 207, 154, 153, - 207, 183, 182, 207, 161, 160, 207, 207, 146, 207, - 167, 207, 157, 163, 162, 207, 166, 164 - } ; - -static yyconst short int yy_accept[1203] = - { 0, - 1, 1, 1, 2, 4, 7, 9, 11, 13, 16, - 19, 21, 24, 27, 30, 33, 35, 37, 39, 41, - 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, - 63, 65, 67, 69, 71, 73, 76, 79, 82, 85, - 88, 90, 91, 91, 92, 92, 92, 93, 94, 95, - 95, 96, 97, 98, 99, 101, 102, 103, 104, 106, - 108, 109, 110, 110, 111, 112, 113, 115, 116, 118, - 119, 120, 122, 124, 125, 126, 127, 129, 130, 132, - 133, 135, 136, 138, 140, 141, 141, 143, 144, 146, - 148, 150, 152, 154, 156, 157, 159, 160, 161, 162, - - 163, 164, 165, 167, 169, 170, 172, 174, 176, 177, - 178, 180, 181, 183, 185, 187, 189, 191, 193, 194, - 195, 196, 197, 198, 199, 200, 202, 202, 202, 204, - 204, 204, 204, 205, 207, 208, 209, 210, 211, 212, - 214, 216, 217, 218, 219, 220, 221, 222, 222, 222, - 222, 222, 222, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 246, 246, - 246, 246, 246, 246, 247, 248, 249, 250, 251, 252, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - - 264, 265, 267, 268, 270, 271, 272, 273, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 289, 289, 290, 290, 290, 290, 293, 294, 295, - 295, 296, 297, 298, 299, 300, 301, 302, 302, 302, - 302, 302, 302, 302, 303, 304, 305, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 331, 331, 331, 331, 331, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, - - 357, 358, 360, 361, 361, 362, 363, 364, 365, 367, - 368, 369, 370, 371, 372, 373, 374, 374, 376, 376, - 379, 379, 380, 381, 381, 382, 383, 384, 385, 386, - 387, 388, 388, 388, 388, 388, 388, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 403, 404, 405, 406, 407, 408, 409, 409, 410, - 412, 413, 414, 415, 416, 416, 416, 416, 416, 416, - 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 436, - 437, 438, 439, 440, 441, 441, 442, 443, 445, 446, - - 447, 447, 448, 449, 450, 451, 453, 453, 454, 454, - 455, 456, 457, 458, 459, 460, 461, 461, 461, 461, - 461, 461, 461, 462, 463, 464, 465, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 477, 478, 479, 480, - 481, 483, 483, 483, 484, 485, 486, 488, 489, 490, - 490, 490, 490, 490, 490, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 502, 503, 504, 506, - 507, 508, 509, 510, 512, 513, 514, 515, 517, 517, - 519, 520, 522, 523, 523, 524, 525, 526, 527, 527, - 528, 528, 529, 530, 531, 533, 535, 536, 537, 537, - - 537, 537, 537, 537, 537, 537, 538, 539, 541, 543, - 544, 545, 546, 547, 548, 549, 550, 550, 551, 552, - 554, 556, 558, 558, 558, 559, 560, 561, 562, 563, - 563, 563, 563, 563, 563, 563, 564, 565, 566, 567, - 568, 569, 570, 572, 573, 574, 575, 576, 577, 579, - 580, 581, 582, 582, 582, 582, 583, 583, 583, 584, - 584, 585, 586, 589, 590, 591, 593, 593, 594, 595, - 596, 597, 598, 598, 598, 598, 599, 599, 599, 599, - 599, 600, 600, 601, 602, 603, 604, 605, 607, 608, - 609, 610, 610, 611, 611, 611, 612, 614, 614, 614, - - 614, 615, 616, 617, 619, 619, 620, 620, 620, 620, - 620, 621, 621, 622, 622, 623, 624, 625, 626, 628, - 629, 631, 632, 632, 633, 635, 637, 638, 639, 640, - 642, 642, 643, 643, 643, 643, 644, 644, 644, 645, - 645, 647, 649, 650, 651, 651, 652, 653, 654, 655, - 656, 657, 657, 658, 658, 659, 659, 660, 661, 661, - 661, 661, 662, 662, 663, 664, 665, 667, 668, 670, - 671, 673, 675, 676, 677, 677, 678, 678, 678, 679, - 679, 680, 681, 683, 685, 686, 686, 687, 687, 687, - 687, 687, 688, 689, 690, 691, 692, 693, 695, 697, - - 697, 698, 699, 699, 700, 701, 701, 703, 703, 703, - 703, 704, 704, 704, 704, 705, 705, 706, 708, 708, - 709, 709, 710, 711, 712, 713, 713, 714, 715, 716, - 717, 717, 717, 718, 718, 719, 720, 721, 723, 725, - 727, 729, 730, 730, 731, 731, 731, 732, 732, 733, - 733, 734, 734, 734, 734, 734, 735, 736, 737, 738, - 738, 739, 740, 740, 741, 742, 743, 744, 744, 744, - 744, 745, 745, 745, 745, 746, 746, 748, 748, 749, - 749, 749, 751, 752, 753, 754, 755, 756, 756, 757, - 757, 758, 760, 762, 764, 764, 765, 765, 765, 766, - - 766, 767, 767, 768, 769, 769, 770, 770, 771, 771, - 771, 773, 774, 776, 777, 779, 780, 781, 781, 782, - 783, 783, 784, 785, 785, 785, 786, 788, 788, 788, - 788, 789, 789, 789, 789, 790, 791, 792, 793, 794, - 795, 797, 799, 799, 800, 800, 801, 801, 802, 802, - 802, 803, 803, 804, 804, 805, 806, 807, 808, 808, - 810, 812, 814, 815, 815, 816, 817, 817, 818, 819, - 819, 819, 819, 819, 819, 820, 820, 820, 820, 820, - 821, 821, 822, 823, 823, 824, 824, 825, 825, 826, - 826, 826, 827, 827, 827, 827, 828, 828, 829, 829, - - 830, 831, 833, 833, 834, 834, 835, 836, 836, 836, - 836, 836, 836, 837, 837, 837, 837, 837, 838, 838, - 840, 842, 844, 844, 845, 845, 846, 846, 847, 847, - 848, 850, 850, 850, 850, 851, 851, 852, 852, 853, - 853, 854, 854, 855, 856, 856, 856, 856, 856, 856, - 857, 857, 857, 857, 857, 858, 858, 859, 861, 861, - 862, 862, 863, 863, 863, 863, 863, 863, 864, 864, - 865, 865, 866, 866, 867, 867, 868, 869, 869, 869, - 869, 869, 870, 872, 872, 873, 873, 873, 874, 874, - 875, 877, 877, 878, 879, 879, 879, 879, 879, 879, - - 879, 880, 881, 881, 882, 882, 883, 883, 884, 885, - 887, 888, 888, 888, 888, 888, 888, 888, 888, 889, - 889, 889, 890, 890, 890, 890, 890, 890, 890, 890, - 891, 892, 892, 893, 894, 894, 896, 897, 897, 898, - 900, 900, 900, 900, 901, 901, 901, 902, 903, 903, - 903, 904, 904, 904, 904, 904, 904, 904, 904, 905, - 906, 906, 907, 908, 910, 910, 911, 911, 911, 911, - 911, 911, 912, 912, 912, 913, 913, 913, 913, 913, - 914, 914, 914, 915, 916, 916, 917, 917, 918, 918, - 918, 918, 918, 918, 919, 919, 919, 920, 920, 921, - - 922, 922, 922, 922, 923, 924, 924, 925, 926, 928, - 928, 928, 928, 928, 928, 929, 929, 929, 930, 930, - 930, 930, 930, 930, 931, 932, 932, 933, 933, 934, - 934, 934, 934, 934, 935, 935, 935, 936, 936, 937, - 938, 938, 938, 939, 940, 940, 941, 941, 941, 941, - 941, 941, 942, 942, 942, 943, 944, 944, 944, 945, - 946, 947, 949, 949, 949, 949, 949, 950, 952, 952, - 953, 955, 956, 956, 958, 959, 959, 960, 960, 960, - 960, 960, 961, 961, 961, 962, 962, 962, 963, 964, - 964, 964, 965, 967, 967, 967, 967, 967, 967, 968, - - 969, 969 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 7, 1, 1, 1, 1, 8, - 9, 1, 10, 1, 11, 1, 1, 12, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 1, 14, 1, - 15, 1, 1, 1, 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, - 1, 42, 1, 1, 43, 1, 44, 44, 44, 44, - - 44, 44, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, - 1, 1, 46, 1, 47, 1, 1, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48 - } ; - -static yyconst int yy_meta[49] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 1, 1, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 1, 4, 5, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[1212] = - { 0, - 0, 47, 1305, 1306, 53, 57, 45, 1301, 1306, 1306, - 51, 53, 55, 1306, 1306, 82, 0, 60, 54, 57, - 53, 45, 75, 1287, 84, 91, 103, 77, 119, 98, - 123, 65, 88, 1282, 1298, 1306, 1306, 1306, 158, 164, - 138, 168, 132, 1306, 172, 1297, 1306, 70, 122, 164, - 0, 1269, 1280, 1278, 0, 1269, 1276, 1263, 145, 0, - 1258, 90, 162, 1265, 158, 1271, 0, 173, 1255, 171, - 1255, 0, 0, 1265, 1271, 124, 0, 1259, 0, 53, - 0, 1256, 0, 0, 1245, 184, 0, 193, 0, 1262, - 0, 0, 0, 0, 129, 0, 1251, 110, 198, 1254, - - 186, 202, 0, 0, 174, 0, 0, 188, 1246, 1251, - 0, 1262, 0, 0, 0, 0, 1257, 0, 1249, 1242, - 1241, 1249, 1238, 1306, 236, 242, 226, 1268, 1306, 239, - 1267, 220, 1306, 236, 1225, 241, 1235, 1247, 1255, 0, - 0, 1238, 1234, 1234, 1232, 233, 1241, 1244, 1241, 1234, - 1237, 1226, 1220, 1227, 1222, 1231, 1211, 1234, 1233, 1230, - 1223, 1226, 1215, 1209, 1227, 1218, 239, 240, 1211, 1223, - 1221, 1208, 1217, 1214, 230, 1213, 1210, 1215, 1199, 1211, - 1193, 1209, 1208, 1209, 1193, 1205, 1187, 1203, 1202, 0, - 1202, 1196, 1183, 242, 1183, 243, 1197, 245, 1180, 161, - - 1195, 1180, 1189, 0, 1177, 1192, 1186, 0, 1198, 1175, - 1183, 1187, 1170, 1184, 1174, 1169, 245, 1184, 1180, 1164, - 0, 1195, 1306, 1194, 269, 1193, 1306, 1160, 1163, 1171, - 1168, 1173, 1172, 1155, 1158, 1153, 1159, 1156, 1161, 1154, - 1147, 1144, 1150, 246, 1163, 1154, 0, 1142, 1147, 1152, - 1145, 1138, 1135, 1141, 1136, 1140, 1128, 1132, 1149, 1138, - 0, 1137, 1127, 1129, 225, 1141, 1140, 1126, 1122, 1129, - 1121, 1135, 1127, 1133, 1117, 1116, 1115, 1129, 1121, 1127, - 1111, 1110, 1120, 1123, 1115, 1113, 1116, 1119, 1108, 0, - 1107, 1112, 1100, 1118, 1113, 1097, 1104, 0, 1112, 1098, - - 1098, 0, 1107, 1108, 1107, 1106, 1083, 1102, 0, 1087, - 1109, 1095, 1099, 1087, 1093, 1095, 1111, 1306, 1110, 1306, - 271, 1101, 1076, 1077, 1091, 1084, 1084, 1086, 1072, 1074, - 1083, 1084, 1071, 1081, 1088, 1078, 1064, 1077, 1066, 1061, - 1060, 1072, 1073, 1060, 1070, 1045, 1067, 1053, 1065, 1064, - 0, 1063, 1055, 1065, 1060, 1044, 1043, 252, 255, 0, - 1049, 1041, 1059, 1038, 1049, 1056, 1051, 1041, 1058, 1057, - 1043, 1050, 1045, 1035, 1020, 1019, 1032, 1031, 1043, 1041, - 1018, 1027, 1037, 1025, 1016, 1028, 1017, 1016, 0, 1014, - 1012, 1012, 1013, 1011, 1017, 1023, 1007, 0, 1013, 1019, - - 1015, 1010, 1021, 1002, 1005, 0, 1001, 1003, 1002, 1015, - 1014, 996, 993, 992, 1008, 1009, 1004, 1012, 1011, 988, - 1009, 999, 262, 996, 997, 988, 0, 995, 971, 970, - 979, 968, 990, 974, 275, 0, 988, 967, 987, 985, - 0, 984, 987, 982, 985, 980, 0, 977, 970, 967, - 961, 960, 959, 960, 959, 961, 955, 954, 953, 954, - 953, 963, 949, 948, 955, 0, 946, 950, 936, 958, - 947, 956, 940, 0, 963, 962, 268, 0, 956, 0, - 960, 0, 950, 950, 934, 932, 946, 929, 932, 930, - 926, 926, 925, 929, 0, 0, 934, 923, 929, 922, - - 921, 257, 920, 941, 935, 934, 277, 906, 0, 921, - 914, 913, 261, 912, 901, 281, 909, 285, 923, 0, - 930, 0, 924, 915, 922, 913, 907, 915, 286, 905, - 913, 912, 920, 266, 267, 901, 909, 908, 884, 270, - 274, 292, 0, 906, 905, 908, 896, 903, 0, 892, - 909, 889, 885, 897, 882, 881, 880, 876, 879, 891, - 890, 289, 0, 875, 1306, 0, 877, 883, 290, 877, - 889, 884, 892, 283, 284, 1306, 871, 287, 868, 880, - 879, 882, 881, 867, 852, 291, 298, 0, 863, 299, - 860, 857, 856, 858, 862, 861, 0, 851, 867, 858, - - 865, 856, 847, 0, 854, 853, 868, 867, 866, 843, - 1306, 844, 1306, 843, 830, 829, 828, 837, 0, 838, - 0, 837, 830, 829, 0, 0, 830, 296, 840, 0, - 830, 829, 831, 821, 835, 834, 823, 840, 301, 826, - 0, 0, 824, 833, 841, 821, 839, 819, 818, 812, - 803, 812, 1306, 813, 1306, 812, 1306, 1306, 811, 302, - 830, 797, 819, 818, 807, 803, 0, 804, 0, 803, - 0, 0, 802, 306, 799, 798, 819, 809, 808, 793, - 1306, 1306, 0, 0, 810, 805, 804, 790, 789, 788, - 800, 1306, 1306, 786, 785, 784, 796, 0, 0, 799, - - 798, 789, 775, 774, 794, 295, 0, 782, 767, 724, - 12, 104, 161, 165, 194, 199, 293, 0, 310, 312, - 326, 314, 309, 326, 314, 316, 1306, 1306, 1306, 1306, - 318, 315, 316, 341, 310, 319, 323, 0, 0, 0, - 0, 325, 341, 342, 333, 332, 333, 343, 329, 336, - 337, 335, 336, 339, 341, 342, 343, 346, 348, 354, - 355, 353, 364, 365, 364, 1306, 1306, 367, 370, 369, - 370, 371, 368, 353, 354, 371, 0, 376, 386, 380, - 374, 0, 366, 358, 371, 1306, 1306, 380, 381, 372, - 373, 0, 0, 0, 385, 386, 391, 390, 391, 403, - - 391, 394, 395, 1306, 387, 1306, 388, 1306, 389, 391, - 0, 391, 0, 392, 0, 393, 395, 390, 391, 399, - 397, 398, 403, 422, 398, 1306, 0, 396, 417, 408, - 409, 404, 411, 423, 424, 1306, 1306, 1306, 433, 429, - 0, 0, 411, 412, 424, 425, 423, 424, 423, 418, - 419, 436, 426, 422, 423, 1306, 1306, 1306, 426, 0, - 0, 0, 427, 441, 443, 453, 431, 432, 437, 434, - 435, 436, 456, 439, 440, 436, 455, 448, 450, 450, - 451, 464, 458, 457, 458, 451, 452, 464, 465, 469, - 469, 470, 474, 475, 464, 469, 476, 477, 466, 467, - - 1306, 0, 485, 486, 481, 482, 473, 488, 485, 490, - 476, 496, 497, 503, 480, 487, 482, 489, 488, 0, - 0, 0, 500, 501, 495, 496, 495, 496, 491, 1306, - 0, 506, 507, 518, 519, 520, 489, 522, 491, 505, - 506, 507, 508, 504, 513, 511, 513, 519, 505, 506, - 517, 524, 513, 525, 515, 531, 1306, 0, 532, 533, - 532, 533, 533, 546, 547, 543, 542, 543, 530, 531, - 532, 533, 538, 539, 540, 541, 547, 552, 545, 556, - 546, 1306, 0, 557, 1306, 558, 546, 562, 550, 1306, - 0, 573, 542, 1306, 570, 557, 559, 560, 563, 571, - - 565, 573, 574, 575, 564, 565, 566, 567, 1306, 0, - 585, 586, 594, 586, 578, 586, 570, 570, 572, 596, - 582, 583, 586, 587, 588, 599, 592, 604, 588, 606, - 590, 606, 607, 1306, 595, 0, 596, 608, 609, 0, - 595, 613, 613, 1306, 603, 599, 1306, 600, 601, 621, - 622, 620, 613, 614, 631, 603, 610, 611, 612, 613, - 628, 629, 1306, 0, 611, 612, 628, 623, 643, 620, - 645, 614, 634, 640, 641, 650, 622, 623, 631, 1306, - 631, 642, 633, 644, 645, 646, 636, 637, 643, 645, - 646, 652, 648, 649, 649, 661, 662, 649, 1306, 1306, - - 663, 673, 655, 644, 658, 652, 653, 680, 0, 663, - 658, 674, 679, 680, 681, 669, 675, 676, 681, 669, - 682, 668, 676, 670, 678, 688, 689, 686, 1306, 691, - 690, 678, 686, 687, 682, 688, 689, 698, 1306, 1306, - 696, 710, 698, 680, 705, 706, 691, 688, 698, 705, - 710, 711, 721, 711, 712, 1306, 716, 707, 718, 709, - 1306, 0, 719, 705, 706, 712, 1306, 0, 705, 1306, - 0, 1306, 728, 0, 729, 718, 1306, 723, 719, 725, - 722, 723, 718, 737, 1306, 725, 735, 736, 1306, 722, - 739, 1306, 0, 735, 730, 731, 724, 734, 1306, 1306, - - 1306, 763, 768, 771, 775, 780, 783, 788, 793, 798, - 803 - } ; - -static yyconst short int yy_def[1212] = - { 0, - 1201, 1, 1201, 1201, 1201, 1201, 1202, 1203, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1205, 1201, 1202, 1201, 1206, 1203, 1201, 1201, 1201, 1207, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1201, 1201, 1201, 1208, 1205, 1201, 1205, - 1209, 1206, 1201, 1207, 1207, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1208, 1201, 1210, 1211, 1209, 1201, 1204, 1204, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1210, 1201, 1211, 1201, - 1211, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - - 1201, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1201, - - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1204, 1204, 1204, - 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, - - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1204, 1204, 1204, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - 1201, 1201, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1204, 1204, 1201, - - 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1204, 1201, 1204, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1204, 1204, 1204, 1204, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1201, 1201, 1201, 1204, 1204, 1204, 1204, 1201, - 1204, 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1204, 1204, 1204, 1201, 1201, 1201, 1204, 1201, - 1204, 1204, 1204, 1204, 1201, 1204, 1201, 1201, 1204, 1201, - - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1204, 1204, 1204, 1204, 1204, 1204, 1204, 1201, 1204, 1204, - 1201, 1204, 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1204, 1204, 1204, 1201, 1204, 1204, 1201, 1204, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, - 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, - - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1204, 1201, 1204, 1201, 1204, 1201, - 1204, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, 1204, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1204, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, - 1204, 1201, 1204, 1201, 1201, 1204, 1204, 1201, 1204, 1204, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1204, 1201, - 1201, 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, - 1201, 1201, 1204, 1204, 1201, 1204, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1204, 1201, 1201, 1201, 1204, 1204, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1204, 1201, 1201, 1204, 1204, 1201, 1201, 1201, 1201, 1201, - 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1204, 1201, 1201, - 1201, 1201, 1204, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - - 0, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201 - } ; - -static yyconst short int yy_nxt[1355] = - { 0, - 4, 5, 6, 5, 5, 7, 8, 9, 10, 11, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 17, 17, 22, 17, 17, 23, 24, 25, 26, - 27, 17, 28, 29, 30, 31, 32, 33, 17, 34, - 17, 35, 17, 4, 4, 36, 37, 38, 39, 40, - 44, 39, 771, 41, 42, 42, 42, 42, 42, 42, - 42, 42, 48, 48, 49, 49, 49, 49, 174, 69, - 63, 77, 80, 70, 74, 64, 78, 71, 81, 79, - 119, 48, 48, 175, 120, 75, 45, 72, 73, 65, - 82, 50, 66, 67, 86, 76, 99, 50, 52, 53, - - 54, 55, 68, 121, 83, 146, 100, 89, 56, 84, - 57, 90, 58, 87, 772, 59, 60, 61, 95, 91, - 122, 110, 147, 92, 62, 111, 88, 93, 94, 194, - 112, 96, 97, 49, 49, 98, 101, 44, 102, 195, - 129, 103, 130, 171, 131, 104, 113, 191, 105, 114, - 106, 115, 107, 108, 172, 116, 117, 118, 109, 125, - 126, 42, 125, 192, 127, 42, 42, 42, 42, 42, - 42, 42, 42, 45, 133, 134, 134, 44, 143, 148, - 296, 149, 150, 151, 144, 155, 156, 773, 157, 152, - 159, 166, 160, 161, 162, 153, 297, 167, 774, 178, - - 163, 179, 180, 181, 209, 182, 164, 136, 184, 210, - 185, 186, 187, 196, 188, 197, 202, 183, 203, 205, - 211, 204, 1201, 212, 198, 44, 189, 775, 223, 199, - 206, 200, 224, 776, 207, 358, 208, 125, 126, 42, - 125, 129, 127, 42, 42, 42, 42, 134, 134, 235, - 225, 225, 136, 136, 257, 259, 267, 286, 258, 268, - 293, 290, 287, 312, 294, 338, 236, 359, 313, 339, - 260, 320, 505, 320, 442, 288, 291, 444, 555, 136, - 321, 321, 321, 321, 136, 517, 443, 582, 576, 445, - 577, 592, 588, 518, 589, 595, 605, 611, 613, 612, - - 614, 619, 623, 620, 506, 621, 703, 622, 642, 647, - 556, 714, 643, 648, 653, 655, 654, 656, 658, 583, - 659, 777, 667, 593, 668, 766, 767, 596, 606, 669, - 672, 670, 673, 730, 624, 731, 778, 741, 704, 742, - 779, 780, 782, 715, 783, 784, 785, 786, 787, 788, - 789, 790, 791, 792, 793, 794, 795, 796, 781, 797, - 798, 799, 800, 801, 802, 803, 804, 806, 805, 807, - 808, 810, 809, 811, 813, 812, 814, 815, 817, 816, - 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, - 828, 829, 830, 831, 832, 833, 834, 836, 837, 839, - - 840, 841, 842, 843, 844, 838, 845, 846, 847, 848, - 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 835, 867, - 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, - 878, 880, 879, 881, 882, 884, 885, 886, 887, 888, - 889, 890, 891, 892, 893, 896, 897, 898, 899, 900, - 901, 883, 902, 903, 905, 906, 907, 908, 894, 909, - 910, 911, 895, 912, 913, 914, 915, 916, 917, 918, - 919, 920, 921, 923, 924, 925, 926, 927, 928, 922, - 929, 930, 931, 932, 933, 904, 934, 935, 936, 937, - - 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, - 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, - 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, - 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, - 989, 990, 991, 992, 993, 994, 995, 996, 997, 999, - 1001, 968, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, - 1011, 1012, 998, 1013, 1014, 1015, 1016, 1017, 1000, 1002, - 1018, 1019, 1020, 1021, 1022, 1023, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1034, 1036, 1035, 1037, 1024, - - 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, - 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, - 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, - 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, - 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, - 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, - 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, - 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, - 1118, 1119, 1121, 1122, 1123, 1120, 1124, 1125, 1126, 1127, - 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, - - 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, - 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, - 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1167, - 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, - 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, - 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, - 1198, 1199, 1200, 43, 770, 43, 43, 43, 46, 46, - 46, 46, 46, 51, 51, 128, 128, 128, 128, 128, - 132, 132, 132, 132, 132, 135, 769, 135, 222, 222, - 222, 222, 222, 226, 226, 226, 226, 226, 317, 317, - - 317, 317, 317, 319, 319, 319, 319, 319, 768, 765, - 764, 763, 762, 761, 760, 759, 758, 757, 756, 755, - 754, 753, 752, 751, 750, 749, 748, 747, 746, 745, - 744, 743, 740, 739, 738, 737, 736, 735, 734, 733, - 732, 729, 728, 727, 726, 725, 724, 723, 722, 721, - 720, 719, 718, 717, 716, 713, 712, 711, 710, 709, - 708, 707, 706, 705, 702, 701, 700, 699, 698, 697, - 696, 695, 694, 693, 692, 691, 690, 689, 688, 687, - 686, 685, 684, 683, 682, 681, 680, 679, 678, 677, - 676, 675, 674, 671, 666, 665, 664, 663, 662, 661, - - 660, 657, 652, 651, 650, 649, 646, 645, 644, 641, - 640, 639, 638, 637, 636, 635, 634, 633, 632, 631, - 630, 629, 628, 627, 626, 625, 618, 617, 616, 615, - 610, 609, 608, 607, 604, 603, 602, 601, 600, 599, - 598, 597, 594, 591, 590, 587, 586, 585, 584, 581, - 580, 579, 578, 575, 574, 573, 572, 571, 570, 569, - 568, 567, 566, 565, 564, 563, 562, 561, 560, 559, - 558, 557, 554, 553, 552, 551, 550, 549, 548, 547, - 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, - 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, - - 526, 525, 524, 523, 522, 521, 520, 519, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 504, 503, - 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, - 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, - 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, - 452, 451, 450, 449, 448, 447, 446, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, - - 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 320, 318, 406, 405, 404, 403, 402, 401, - 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, - 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, - 380, 379, 378, 377, 376, 375, 374, 373, 372, 371, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 360, 357, 356, 355, 354, 353, 352, 351, 350, 349, - 348, 347, 346, 345, 344, 343, 342, 341, 340, 337, - 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, - 326, 325, 324, 323, 322, 227, 318, 223, 316, 315, - - 314, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 295, 292, 289, 285, 284, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 272, 271, 270, 269, 266, 265, 264, 263, 262, - 261, 256, 255, 254, 253, 252, 251, 250, 249, 248, - 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, - 237, 234, 233, 232, 231, 230, 229, 228, 1201, 227, - 129, 221, 220, 219, 218, 217, 216, 215, 214, 213, - 201, 193, 190, 177, 176, 173, 170, 169, 168, 165, - 158, 154, 145, 142, 141, 140, 139, 138, 137, 47, - - 124, 123, 85, 47, 1201, 3, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yyconst short int yy_chk[1355] = - { 0, - 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, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 7, 2, 711, 2, 5, 5, 5, 5, 6, 6, - 6, 6, 11, 11, 12, 12, 13, 13, 80, 19, - 18, 21, 22, 19, 20, 18, 21, 19, 22, 21, - 32, 48, 48, 80, 32, 20, 7, 19, 19, 18, - 23, 12, 18, 18, 25, 20, 28, 12, 16, 16, - - 16, 16, 18, 33, 23, 62, 28, 26, 16, 23, - 16, 26, 16, 25, 712, 16, 16, 16, 27, 26, - 33, 30, 62, 26, 16, 30, 25, 26, 26, 98, - 30, 27, 27, 49, 49, 27, 29, 43, 29, 98, - 41, 29, 41, 76, 41, 29, 31, 95, 29, 31, - 29, 31, 29, 29, 76, 31, 31, 31, 29, 39, - 39, 39, 39, 95, 39, 40, 40, 40, 40, 42, - 42, 42, 42, 43, 45, 50, 50, 45, 59, 63, - 200, 63, 63, 63, 59, 65, 65, 713, 65, 63, - 68, 70, 68, 68, 68, 63, 200, 70, 714, 86, - - 68, 86, 86, 86, 105, 86, 68, 50, 88, 105, - 88, 88, 88, 99, 88, 99, 101, 86, 101, 102, - 108, 101, 132, 108, 99, 132, 88, 715, 127, 99, - 102, 99, 127, 716, 102, 265, 102, 125, 125, 125, - 125, 130, 125, 126, 126, 126, 126, 134, 134, 146, - 130, 130, 136, 136, 167, 168, 175, 194, 167, 175, - 198, 196, 194, 217, 198, 244, 146, 265, 217, 244, - 168, 225, 423, 321, 358, 194, 196, 359, 477, 134, - 225, 225, 321, 321, 136, 435, 358, 507, 502, 359, - 502, 516, 513, 435, 513, 518, 529, 534, 535, 534, - - 535, 540, 542, 540, 423, 541, 628, 541, 562, 569, - 477, 639, 562, 569, 574, 575, 574, 575, 578, 507, - 578, 717, 586, 516, 586, 706, 706, 518, 529, 587, - 590, 587, 590, 660, 542, 660, 719, 674, 628, 674, - 720, 721, 722, 639, 723, 724, 725, 726, 731, 732, - 733, 734, 735, 736, 737, 742, 743, 744, 721, 745, - 746, 747, 748, 749, 750, 751, 752, 753, 752, 753, - 754, 755, 754, 756, 757, 756, 757, 758, 759, 758, - 760, 761, 762, 763, 764, 765, 768, 769, 770, 771, - 772, 773, 774, 775, 776, 778, 779, 780, 781, 783, - - 784, 785, 785, 788, 789, 781, 790, 791, 795, 796, - 797, 798, 799, 800, 801, 802, 803, 805, 807, 809, - 810, 812, 814, 816, 817, 818, 819, 820, 779, 821, - 822, 823, 824, 825, 828, 829, 830, 831, 832, 833, - 834, 835, 834, 839, 840, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 859, 863, - 864, 840, 865, 866, 867, 868, 869, 870, 852, 871, - 872, 873, 852, 874, 875, 876, 877, 878, 879, 880, - 881, 882, 883, 884, 885, 886, 887, 888, 889, 883, - 890, 891, 892, 893, 894, 866, 895, 896, 897, 898, - - 899, 900, 903, 904, 905, 906, 907, 908, 909, 910, - 911, 912, 913, 914, 915, 916, 917, 918, 919, 923, - 924, 925, 926, 927, 928, 929, 932, 933, 934, 935, - 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, - 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, - 956, 959, 960, 961, 962, 963, 964, 965, 966, 967, - 968, 935, 969, 970, 971, 972, 973, 974, 975, 976, - 977, 978, 966, 979, 980, 981, 984, 986, 967, 968, - 987, 988, 989, 992, 993, 995, 996, 997, 998, 999, - 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1005, 1006, 995, - - 1007, 1008, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, - 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, - 1029, 1030, 1031, 1032, 1033, 1035, 1037, 1038, 1039, 1041, - 1042, 1043, 1045, 1046, 1048, 1049, 1050, 1051, 1052, 1053, - 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1065, - 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, - 1076, 1077, 1078, 1079, 1081, 1082, 1083, 1084, 1085, 1086, - 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, - 1097, 1098, 1101, 1102, 1103, 1098, 1104, 1105, 1106, 1107, - 1108, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, - - 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, - 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1141, - 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, - 1152, 1153, 1154, 1155, 1157, 1158, 1159, 1160, 1163, 1164, - 1165, 1166, 1169, 1173, 1175, 1176, 1178, 1179, 1180, 1181, - 1182, 1183, 1184, 1186, 1187, 1188, 1190, 1191, 1194, 1195, - 1196, 1197, 1198, 1202, 710, 1202, 1202, 1202, 1203, 1203, - 1203, 1203, 1203, 1204, 1204, 1205, 1205, 1205, 1205, 1205, - 1206, 1206, 1206, 1206, 1206, 1207, 709, 1207, 1208, 1208, - 1208, 1208, 1208, 1209, 1209, 1209, 1209, 1209, 1210, 1210, - - 1210, 1210, 1210, 1211, 1211, 1211, 1211, 1211, 708, 705, - 704, 703, 702, 701, 700, 697, 696, 695, 694, 691, - 690, 689, 688, 687, 686, 685, 680, 679, 678, 677, - 676, 675, 673, 670, 668, 666, 665, 664, 663, 662, - 661, 659, 656, 654, 652, 651, 650, 649, 648, 647, - 646, 645, 644, 643, 640, 638, 637, 636, 635, 634, - 633, 632, 631, 629, 627, 624, 623, 622, 620, 618, - 617, 616, 615, 614, 612, 610, 609, 608, 607, 606, - 605, 603, 602, 601, 600, 599, 598, 596, 595, 594, - 593, 592, 591, 589, 585, 584, 583, 582, 581, 580, - - 579, 577, 573, 572, 571, 570, 568, 567, 564, 561, - 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, - 550, 548, 547, 546, 545, 544, 539, 538, 537, 536, - 533, 532, 531, 530, 528, 527, 526, 525, 524, 523, - 521, 519, 517, 515, 514, 512, 511, 510, 508, 506, - 505, 504, 503, 501, 500, 499, 498, 497, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 481, 479, 476, 475, 473, 472, 471, 470, 469, 468, - 467, 465, 464, 463, 462, 461, 460, 459, 458, 457, - 456, 455, 454, 453, 452, 451, 450, 449, 448, 446, - - 445, 444, 443, 442, 440, 439, 438, 437, 434, 433, - 432, 431, 430, 429, 428, 426, 425, 424, 422, 421, - 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, - 410, 409, 408, 407, 405, 404, 403, 402, 401, 400, - 399, 397, 396, 395, 394, 393, 392, 391, 390, 388, - 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, - 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, - 367, 366, 365, 364, 363, 362, 361, 357, 356, 355, - 354, 353, 352, 350, 349, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, - - 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, - 323, 322, 319, 317, 316, 315, 314, 313, 312, 311, - 310, 308, 307, 306, 305, 304, 303, 301, 300, 299, - 297, 296, 295, 294, 293, 292, 291, 289, 288, 287, - 286, 285, 284, 283, 282, 281, 280, 279, 278, 277, - 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, - 266, 264, 263, 262, 260, 259, 258, 257, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 246, 245, 243, - 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, - 232, 231, 230, 229, 228, 226, 224, 222, 220, 219, - - 218, 216, 215, 214, 213, 212, 211, 210, 209, 207, - 206, 205, 203, 202, 201, 199, 197, 195, 193, 192, - 191, 189, 188, 187, 186, 185, 184, 183, 182, 181, - 180, 179, 178, 177, 176, 174, 173, 172, 171, 170, - 169, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 145, 144, 143, 142, 139, 138, 137, 135, 131, - 128, 123, 122, 121, 120, 119, 117, 112, 110, 109, - 100, 97, 90, 85, 82, 78, 75, 74, 71, 69, - 66, 64, 61, 58, 57, 56, 54, 53, 52, 46, - - 35, 34, 24, 8, 3, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, 1201, - 1201, 1201, 1201, 1201 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up scripttext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -static int yy_more_flag = 0; -static int yy_more_len = 0; -#define yymore() (yy_more_flag = 1) -#define YY_MORE_ADJ yy_more_len -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char scripttext[YYLMAX]; -char *scripttext_ptr; -#line 1 "script_lexer.l" -#define INITIAL 0 -#line 2 "script_lexer.l" -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -//***************************************************************************** -// DESCRIPTION : Script Lexer -//***************************************************************************** - -#ifdef _WINDOWS -#pragma warning (disable : 4102) -#pragma warning (disable : 4273) -#pragma warning (disable : 4786) -#endif - -//***************************************************************************** -// EXTERNAL DECLARATIONS -//***************************************************************************** -#include -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "Iutility.h" // Utility component interface -#include "Iwarehouse.h" // Warehouse component interface -#include "Idicom.h" // Dicom component interface -#include "Inetwork.h" // Network component interface -#include "Imedia.h" // Media File component interface -#include "Isession.h" // Test Session component interface - -#include "script_parser.cpp.h" - -extern void scripterror(char*); - -extern FILE *scriptin; -extern int scriptlineno; -extern char scriptCurrentFilename[_MAX_PATH]; -extern long scriptCurrentFileOffset; -extern long scriptCurrentLineNo; -extern SCRIPT_SESSION_CLASS *scriptSession_ptr; -extern bool scriptIsNativeVts; -extern bool scriptParseOnly; - -bool IsHex(char, int *); - -static char *pEnd; - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int scriptwrap YY_PROTO(( void )); -#else -extern int scriptwrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void scriptunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef scripttext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int scriptinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( scripttext, scriptleng, 1, scriptout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( scriptin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( scriptin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, scriptin )) == 0) \ - && ferror( scriptin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int scriptlex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after scripttext and scriptleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( scriptleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (scripttext[scriptleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 57 "script_lexer.l" - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! scriptin ) - scriptin = stdin; - - if ( ! scriptout ) - scriptout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - script_create_buffer( scriptin, YY_BUF_SIZE ); - - script_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_more_len = 0; - if ( yy_more_flag ) - { - yy_more_len = scriptleng; - yy_more_flag = 0; - } - yy_cp = yy_c_buf_p; - - /* Support of scripttext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1306 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < scriptleng; ++yyl ) - if ( scripttext[yyl] == '\n' ) - ++scriptlineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 58 "script_lexer.l" -{ /* skip charcters from 80H - FFH */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 60 "script_lexer.l" -{ - // copy script comment lines - strip off leading ## - int length = scriptleng; - - // check to see how line is terminated - // - and remove termination - if ((scripttext[scriptleng-1] == LINEFEED) - && (scripttext[scriptleng-2] == CARRIAGERETURN)) - length -= 2; - else - length--; - - scriptlval.string_ptr = (char*) malloc(length+1); - - memcpy(scriptlval.string_ptr, &scripttext[0], length); - scriptlval.string_ptr[length] = NULLCHAR; - if (scriptSession_ptr) - { - LOG_CLASS *logger_ptr = scriptSession_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_NONE, 1, "%s", scriptlval.string_ptr); - } - } - - free(scriptlval.string_ptr); - scriptlval.string_ptr = NULL; - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 89 "script_lexer.l" -{ /* extract file and line info from cpp comment lines: # Number ["file"] */ - char* iS = NULL; - char* nS = NULL; - iS = strstr(scripttext, "# "); - if (iS != NULL) - { - nS = strstr(iS, " \""); - if (nS != NULL) - { - *nS++ = '\0'; - strcpy(scriptCurrentFilename, nS); - } - scriptCurrentFileOffset = atoi(iS+2); - scriptCurrentLineNo = scriptlineno; - } - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 105 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 110 "script_lexer.l" -{ - char* test; - test = 0; - /* skip other comments */ - } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 115 "script_lexer.l" -{ /* skip empty lines */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 116 "script_lexer.l" -{ /* skip white space */ } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 117 "script_lexer.l" -{ /* continuation line */ } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 118 "script_lexer.l" -{ /* skip equal sign */ } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 119 "script_lexer.l" -{ /* skip semi-colon */ } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 120 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 121 "script_lexer.l" -{ return T_OPEN_BRACKET; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 122 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 123 "script_lexer.l" -{ return T_CLOSE_BRACKET; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 124 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_AE; return VR; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 125 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_AS; return VR; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 126 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_AT; return VR; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 127 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_CS; return VR; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 128 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_DA; return VR; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 129 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_DS; return VR; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 130 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_DT; return VR; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 131 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_FD; return VR; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 132 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_FL; return VR; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 133 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_IS; return VR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 134 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_LO; return VR; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 135 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_LT; return VR; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 136 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_OB; return VR; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 137 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_OF; return VR; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 138 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_OV; return VR; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 139 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_OW; return VR; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 140 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_PN; return VR; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 141 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_SH; return VR; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 142 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_SL; return VR; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 143 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_SQ; return T_SQ; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 144 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_SS; return VR; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 145 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_ST; return VR; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 146 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_TM; return VR; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 147 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_UI; return VR; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 148 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_UL; return VR; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 149 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_UN; return VR; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 150 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_UR; return VR; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 151 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_US; return VR; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 152 "script_lexer.l" -{ scriptlval.vr = ATTR_VR_UT; return VR; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 154 "script_lexer.l" -{ return T_SEND; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 156 "script_lexer.l" -{ return T_RESET; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 157 "script_lexer.l" -{ return T_CREATE; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 158 "script_lexer.l" -{ return T_SET; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 159 "script_lexer.l" -{ return T_COMPARE; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 160 "script_lexer.l" -{ return T_COMPARE_NOT; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 161 "script_lexer.l" -{ return T_COPY; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 162 "script_lexer.l" -{ return T_DELETE; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 164 "script_lexer.l" -{ return T_READ; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 165 "script_lexer.l" -{ return T_WRITE; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 167 "script_lexer.l" -{ return T_SYSTEM; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 168 "script_lexer.l" -{ return T_TIME; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 169 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 170 "script_lexer.l" -{ return T_DISPLAY; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 171 "script_lexer.l" -{ return T_ECHO; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 172 "script_lexer.l" -{ return T_ROLE; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 173 "script_lexer.l" -{ return T_CONFIRM; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 174 "script_lexer.l" -{ return T_DELAY; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 176 "script_lexer.l" -{ return T_APPL_ENTITY; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 177 "script_lexer.l" -{ return T_ADD_GROUP_LENGTH; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 178 "script_lexer.l" -{ return T_DEF_SQ_LENGTH; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 179 "script_lexer.l" -{ return T_POPULATE; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 180 "script_lexer.l" -{ return T_STRICT; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 181 "script_lexer.l" -{ return T_VERBOSE; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 182 "script_lexer.l" -{ return T_VALIDATION; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 183 "script_lexer.l" -{ scriptlval.validationFlag = ALL; return VALIDATIONFLAG; } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 184 "script_lexer.l" -{ scriptlval.validationFlag = USE_DEFINITION; return VALIDATIONFLAG; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 185 "script_lexer.l" -{ scriptlval.validationFlag = USE_VR; return VALIDATIONFLAG; } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 186 "script_lexer.l" -{ scriptlval.validationFlag = USE_REFERENCE; return VALIDATIONFLAG; } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 187 "script_lexer.l" -{ scriptlval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_VR); return VALIDATIONFLAG; } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 188 "script_lexer.l" -{ scriptlval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_DEFINITION | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 189 "script_lexer.l" -{ scriptlval.validationFlag = (VALIDATION_CONTROL_FLAG_ENUM)(USE_VR | USE_REFERENCE); return VALIDATIONFLAG; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 190 "script_lexer.l" -{ scriptlval.validationFlag = NONE; return VALIDATIONFLAG; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 192 "script_lexer.l" -{ return T_LANGUAGE; } - YY_BREAK -/* - * The LANGUAGE token is introduced to enable backward compatibility with - * VTS and ADVT - * Currently the ADVT language is fully supported by the parser - * To avoid conflicts and to have a more consistent language for DVT - * this language section has been introduced. Here some mappings between VTS - * language tokens and DVT language tokens are provided. - */ -case 78: -YY_RULE_SETUP -#line 202 "script_lexer.l" -{ - /* - * The VTS VALIDATE command is mapped on the DVT RECEIVE Command - */ - if (scriptIsNativeVts) - { - return T_RECEIVE; - } - else - { - return T_VALIDATE; - } - } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 215 "script_lexer.l" -{ - /* - * The VTS VALDIMSE command is mapped on the DVT VALIDATE Command - */ - if (scriptIsNativeVts) - { - return T_VALIDATE; - } - else - { - /* VALDIMSE is not part of the DVT language anymore */ - scripterror("\"VALDIMSE\" is not a DVT script command. Use \"VALIDATE\" "); - } - } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 230 "script_lexer.l" -{ - /* - * The VTS RECEIVE command is mapped on the DVT IMPORT Command - */ - if (scriptIsNativeVts) - { - return T_IMPORT; - } - else - { - return T_RECEIVE; - } - } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 244 "script_lexer.l" -{ - /* - * The VTS EXECUTE command is mapped on the DVT EXPORT Command - */ - if (scriptIsNativeVts) - { - return T_EXPORT; - } - else - { - /* EXECUTE is not part of the DVT language anymore */ - scripterror("\"EXECUTE\" is not a DVT script command. Use \"EXPORT\" "); - } - } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 259 "script_lexer.l" -{ - return T_IMPORT; - } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 263 "script_lexer.l" -{ - return T_EXPORT; - } - YY_BREAK -case 84: -#line 268 "script_lexer.l" -case 85: -YY_RULE_SETUP -#line 268 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CECHO_RQ; return COMMANDFIELD; } - YY_BREAK -case 86: -#line 270 "script_lexer.l" -case 87: -YY_RULE_SETUP -#line 270 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CECHO_RSP; return COMMANDFIELD; } - YY_BREAK -case 88: -#line 272 "script_lexer.l" -case 89: -YY_RULE_SETUP -#line 272 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CFIND_RQ; return COMMANDFIELD; } - YY_BREAK -case 90: -#line 274 "script_lexer.l" -case 91: -YY_RULE_SETUP -#line 274 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CFIND_RSP; return COMMANDFIELD; } - YY_BREAK -case 92: -#line 276 "script_lexer.l" -case 93: -YY_RULE_SETUP -#line 276 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 94: -#line 278 "script_lexer.l" -case 95: -YY_RULE_SETUP -#line 278 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 96: -#line 280 "script_lexer.l" -case 97: -YY_RULE_SETUP -#line 280 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CMOVE_RQ; return COMMANDFIELD; } - YY_BREAK -case 98: -#line 282 "script_lexer.l" -case 99: -YY_RULE_SETUP -#line 282 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CMOVE_RSP; return COMMANDFIELD; } - YY_BREAK -case 100: -#line 284 "script_lexer.l" -case 101: -YY_RULE_SETUP -#line 284 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CSTORE_RQ; return COMMANDFIELD; } - YY_BREAK -case 102: -#line 286 "script_lexer.l" -case 103: -YY_RULE_SETUP -#line 286 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CSTORE_RSP; return COMMANDFIELD; } - YY_BREAK -case 104: -#line 288 "script_lexer.l" -case 105: -YY_RULE_SETUP -#line 288 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_CCANCEL_RQ; return COMMANDFIELD; } - YY_BREAK -case 106: -#line 290 "script_lexer.l" -case 107: -YY_RULE_SETUP -#line 290 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NACTION_RQ; return COMMANDFIELD; } - YY_BREAK -case 108: -#line 292 "script_lexer.l" -case 109: -YY_RULE_SETUP -#line 292 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NACTION_RSP; return COMMANDFIELD; } - YY_BREAK -case 110: -#line 294 "script_lexer.l" -case 111: -YY_RULE_SETUP -#line 294 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NCREATE_RQ; return COMMANDFIELD; } - YY_BREAK -case 112: -#line 296 "script_lexer.l" -case 113: -YY_RULE_SETUP -#line 296 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NCREATE_RSP; return COMMANDFIELD; } - YY_BREAK -case 114: -#line 298 "script_lexer.l" -case 115: -YY_RULE_SETUP -#line 298 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NDELETE_RQ; return COMMANDFIELD; } - YY_BREAK -case 116: -#line 300 "script_lexer.l" -case 117: -YY_RULE_SETUP -#line 300 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NDELETE_RSP; return COMMANDFIELD; } - YY_BREAK -case 118: -#line 302 "script_lexer.l" -case 119: -YY_RULE_SETUP -#line 302 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NEVENTREPORT_RQ; return COMMANDFIELD; } - YY_BREAK -case 120: -#line 304 "script_lexer.l" -case 121: -YY_RULE_SETUP -#line 304 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NEVENTREPORT_RSP; return COMMANDFIELD; } - YY_BREAK -case 122: -#line 306 "script_lexer.l" -case 123: -YY_RULE_SETUP -#line 306 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NGET_RQ; return COMMANDFIELD; } - YY_BREAK -case 124: -#line 308 "script_lexer.l" -case 125: -YY_RULE_SETUP -#line 308 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NGET_RSP; return COMMANDFIELD; } - YY_BREAK -case 126: -#line 310 "script_lexer.l" -case 127: -YY_RULE_SETUP -#line 310 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NSET_RQ; return COMMANDFIELD; } - YY_BREAK -case 128: -#line 312 "script_lexer.l" -case 129: -YY_RULE_SETUP -#line 312 "script_lexer.l" -{ scriptlval.commandField = DIMSE_CMD_NSET_RSP; return COMMANDFIELD; } - YY_BREAK -case 130: -#line 315 "script_lexer.l" -case 131: -YY_RULE_SETUP -#line 315 "script_lexer.l" -{ return T_ASSOCIATE_RQ; } - YY_BREAK -case 132: -#line 317 "script_lexer.l" -case 133: -YY_RULE_SETUP -#line 317 "script_lexer.l" -{ return T_ASSOCIATE_AC; } - YY_BREAK -case 134: -#line 319 "script_lexer.l" -case 135: -YY_RULE_SETUP -#line 319 "script_lexer.l" -{ return T_ASSOCIATE_RJ; } - YY_BREAK -case 136: -#line 321 "script_lexer.l" -case 137: -YY_RULE_SETUP -#line 321 "script_lexer.l" -{ return T_RELEASE_RQ; } - YY_BREAK -case 138: -#line 323 "script_lexer.l" -case 139: -YY_RULE_SETUP -#line 323 "script_lexer.l" -{ return T_RELEASE_RP; } - YY_BREAK -case 140: -#line 325 "script_lexer.l" -case 141: -YY_RULE_SETUP -#line 325 "script_lexer.l" -{ return T_ABORT_RQ; } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 327 "script_lexer.l" -{ return T_ALL; } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 328 "script_lexer.l" -{ return T_WAREHOUSE; } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 329 "script_lexer.l" -{ return T_ASSOCIATION; } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 330 "script_lexer.l" -{ return T_RELATION; } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 331 "script_lexer.l" -{ return T_EXECUTION_CONTEXT; } - YY_BREAK -case 147: -#line 334 "script_lexer.l" -case 148: -YY_RULE_SETUP -#line 334 "script_lexer.l" -{ return T_PROT_VER; } - YY_BREAK -case 149: -#line 336 "script_lexer.l" -case 150: -YY_RULE_SETUP -#line 336 "script_lexer.l" -{ return T_CALLED_AE; } - YY_BREAK -case 151: -#line 338 "script_lexer.l" -case 152: -YY_RULE_SETUP -#line 338 "script_lexer.l" -{ return T_CALLING_AE; } - YY_BREAK -case 153: -#line 340 "script_lexer.l" -case 154: -YY_RULE_SETUP -#line 340 "script_lexer.l" -{ return T_APPL_CTX; } - YY_BREAK -case 155: -#line 342 "script_lexer.l" -case 156: -#line 343 "script_lexer.l" -case 157: -YY_RULE_SETUP -#line 343 "script_lexer.l" -{ return T_PRES_CTX; } - YY_BREAK -case 158: -#line 345 "script_lexer.l" -case 159: -YY_RULE_SETUP -#line 345 "script_lexer.l" -{ return T_MAX_LEN; } - YY_BREAK -case 160: -#line 347 "script_lexer.l" -case 161: -YY_RULE_SETUP -#line 347 "script_lexer.l" -{ return T_IMPL_CLASS; } - YY_BREAK -case 162: -#line 349 "script_lexer.l" -case 163: -YY_RULE_SETUP -#line 349 "script_lexer.l" -{ return T_IMPL_VER; } - YY_BREAK -case 164: -YY_RULE_SETUP -#line 350 "script_lexer.l" -{ return T_SOP_EXTEND_NEG; } - YY_BREAK -case 165: -YY_RULE_SETUP -#line 351 "script_lexer.l" -{ return T_SCPSCU_ROLE; } - YY_BREAK -case 166: -YY_RULE_SETUP -#line 352 "script_lexer.l" -{ return T_ASYNC_WINDOW; } - YY_BREAK -case 167: -YY_RULE_SETUP -#line 353 "script_lexer.l" -{ return T_USER_ID_NEG; } - YY_BREAK -case 168: -YY_RULE_SETUP -#line 354 "script_lexer.l" -{ return T_RESULT; } - YY_BREAK -case 169: -YY_RULE_SETUP -#line 355 "script_lexer.l" -{ return T_SOURCE; } - YY_BREAK -case 170: -#line 357 "script_lexer.l" -case 171: -YY_RULE_SETUP -#line 357 "script_lexer.l" -{ return T_REASON; } - YY_BREAK -case 172: -#line 360 "script_lexer.l" -case 173: -YY_RULE_SETUP -#line 360 "script_lexer.l" -{ return T_FILEHEAD; } - YY_BREAK -case 174: -#line 362 "script_lexer.l" -case 175: -YY_RULE_SETUP -#line 362 "script_lexer.l" -{ return T_FILETAIL; } - YY_BREAK -case 176: -YY_RULE_SETUP -#line 364 "script_lexer.l" -{ return T_FILE_PREAMBLE; } - YY_BREAK -case 177: -YY_RULE_SETUP -#line 365 "script_lexer.l" -{ return T_DICOM_PREFIX; } - YY_BREAK -case 178: -#line 367 "script_lexer.l" -case 179: -YY_RULE_SETUP -#line 367 "script_lexer.l" -{ return T_TRANSFER_SYNTAX; } - YY_BREAK -case 180: -#line 369 "script_lexer.l" -case 181: -YY_RULE_SETUP -#line 369 "script_lexer.l" -{ return T_SECTOR_SIZE; } - YY_BREAK -case 182: -#line 371 "script_lexer.l" -case 183: -YY_RULE_SETUP -#line 371 "script_lexer.l" -{ return T_DATASET_TRAILING_PADDING; } - YY_BREAK -case 184: -#line 373 "script_lexer.l" -case 185: -YY_RULE_SETUP -#line 373 "script_lexer.l" -{ return T_PADDING_VALUE; } - YY_BREAK -case 186: -YY_RULE_SETUP -#line 375 "script_lexer.l" -{ return T_AUTOSET; } - YY_BREAK -case 187: -#line 377 "script_lexer.l" -case 188: -YY_RULE_SETUP -#line 377 "script_lexer.l" -{ return T_DEFINED_LENGTH; } - YY_BREAK -case 189: -YY_RULE_SETUP -#line 379 "script_lexer.l" -{ return T_NO; } - YY_BREAK -case 190: -YY_RULE_SETUP -#line 380 "script_lexer.l" -{ return T_YES; } - YY_BREAK -case 191: -YY_RULE_SETUP -#line 382 "script_lexer.l" -{ return T_OFF; } - YY_BREAK -case 192: -YY_RULE_SETUP -#line 383 "script_lexer.l" -{ return T_ON; } - YY_BREAK -case 193: -YY_RULE_SETUP -#line 385 "script_lexer.l" -{ return T_AND; } - YY_BREAK -case 194: -YY_RULE_SETUP -#line 386 "script_lexer.l" -{ return T_OR; } - YY_BREAK -case 195: -YY_RULE_SETUP -#line 388 "script_lexer.l" -{ scriptlval.iomLevel = IOM_PATIENT; return IOMLEVEL; } - YY_BREAK -case 196: -YY_RULE_SETUP -#line 389 "script_lexer.l" -{ scriptlval.iomLevel = IOM_STUDY; return IOMLEVEL; } - YY_BREAK -case 197: -YY_RULE_SETUP -#line 390 "script_lexer.l" -{ scriptlval.iomLevel = IOM_SERIES; return IOMLEVEL; } - YY_BREAK -case 198: -YY_RULE_SETUP -#line 391 "script_lexer.l" -{ scriptlval.iomLevel = IOM_IMAGE; return IOMLEVEL; } - YY_BREAK -case 199: -#line 394 "script_lexer.l" -case 200: -YY_RULE_SETUP -#line 394 "script_lexer.l" -{ scriptlval.userProvider = UP_ACCEPTOR; return USERPROVIDER; } - YY_BREAK -case 201: -#line 396 "script_lexer.l" -case 202: -YY_RULE_SETUP -#line 396 "script_lexer.l" -{ scriptlval.userProvider = UP_REQUESTOR; return USERPROVIDER; } - YY_BREAK -case 203: -#line 399 "script_lexer.l" -case 204: -YY_RULE_SETUP -#line 399 "script_lexer.l" -{ scriptlval.hex = strtoul(scripttext, &pEnd, 16); return HEXADECIMAL; } - YY_BREAK -case 205: -#line 402 "script_lexer.l" -case 206: -YY_RULE_SETUP -#line 402 "script_lexer.l" -{ scriptlval.integer = atoi(scripttext); return INTEGER; } - YY_BREAK -case 207: -YY_RULE_SETUP -#line 404 "script_lexer.l" -{ strncpy(scriptlval.identifier, scripttext, sizeof(scriptlval.identifier)); return IDENTIFIER; } - YY_BREAK -case 208: -YY_RULE_SETUP -#line 406 "script_lexer.l" -{ for (scriptleng = scriptleng-2; scriptleng >= 0; scriptleng--) - /* concatenate line */ - unput(scripttext[scriptleng]); - } - YY_BREAK -case 209: -YY_RULE_SETUP -#line 411 "script_lexer.l" -{ int i = 1, j = 0; - - scriptlval.string_ptr = (char*) malloc(scriptleng+1); - if (scriptlval.string_ptr == NULL) - { - char message[128]; - sprintf(message, "STRING of %d chars too long for parser - string truncated!", - scriptleng-2); - scripterror(message); - - scriptlval.string_ptr = (char*) malloc(MAX_STRING_LEN); - - scriptleng = MAX_STRING_LEN - 1; - } - - while (i < (scriptleng-1)) - { - scriptlval.string_ptr[j++] = scripttext[i++]; - } - - scriptlval.string_ptr[j] = NULLCHAR; - return STRING; - } - YY_BREAK -case 210: -YY_RULE_SETUP -#line 435 "script_lexer.l" -{ return scripttext[0]; } - YY_BREAK -case 211: -YY_RULE_SETUP -#line 436 "script_lexer.l" -ECHO; - YY_BREAK - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - scripttext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed scriptin at a new source and called - * scriptlex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = scriptin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = scripttext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = scripttext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( scriptwrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * scripttext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = scripttext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - scripttext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = scripttext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = scripttext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of scriptlex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = scripttext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - scripttext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - scripttext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - scriptrestart( scriptin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - scripttext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = scripttext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1202 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - yy_is_jam = (yy_current_state == 1201); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void scriptunput( int c, register char *yy_bp ) -#else -static void scriptunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up scripttext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --scriptlineno; - - scripttext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int scriptinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - scripttext_ptr = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - if ( scriptwrap() ) - { - yy_c_buf_p = - scripttext_ptr + YY_MORE_ADJ; - return EOF; - } - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return scriptinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = scripttext_ptr + YY_MORE_ADJ; - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in scriptinput()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve scripttext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++scriptlineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void scriptrestart( FILE *input_file ) -#else -void scriptrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = script_create_buffer( scriptin, YY_BUF_SIZE ); - - script_init_buffer( yy_current_buffer, input_file ); - script_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void script_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void script_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - script_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (scriptwrap()) processing, but the only time this flag - * is looked at is after scriptwrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void script_load_buffer_state( void ) -#else -void script_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - scripttext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - scriptin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE script_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in script_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - script_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void script_delete_buffer( YY_BUFFER_STATE b ) -#else -void script_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void script_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void script_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - script_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void script_flush_buffer( YY_BUFFER_STATE b ) -#else -void script_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - script_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE script_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in script_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - script_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script_scan_string( yyconst char *str ) -#else -YY_BUFFER_STATE script_scan_string( str ) -yyconst char *str; -#endif - { - int len; - for ( len = 0; str[len]; ++len ) - ; - - return script_scan_bytes( str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE script_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE script_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in script_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = script_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in script_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up scripttext. */ \ - scripttext[scriptleng] = yy_hold_char; \ - yy_c_buf_p = scripttext + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - scriptleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef scripttext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - scriptlex(); - return 0; - } -#endif -#line 436 "script_lexer.l" - - -//>>=========================================================================== - -void scripterror(char *errmsg) - -// DESCRIPTION : YACC/LEX error function called when parsing of the -// DICOMScript fails. -// PRECONDITIONS : -// POSTCONDITIONS : -// EXCEPTIONS : -// NOTES : -//<<=========================================================================== -{ - LOG_CLASS* logger_ptr = scriptSession_ptr->getLogger(); - - logger_ptr->text(LOG_ERROR, 1, - "%s - parsing Test Script; line %ld of %s", VAL_PREFIX_FAILED, - scriptCurrentFileOffset + (scriptlineno - scriptCurrentLineNo), - scriptCurrentFilename); - logger_ptr->text( LOG_ERROR, 1, "%s - around token : \"%s\"", errmsg, scripttext); - -} - - diff --git a/DVTk_Library/Libraries/Scripting/script_parser.cpp b/DVTk_Library/Libraries/Scripting/script_parser.cpp deleted file mode 100644 index 84dc855..0000000 --- a/DVTk_Library/Libraries/Scripting/script_parser.cpp +++ /dev/null @@ -1,5647 +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 434 "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 44: -#line 452 "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/Libraries/Scripting/script_parser.cpp.h b/DVTk_Library/Libraries/Scripting/script_parser.cpp.h deleted file mode 100644 index 3693af9..0000000 --- a/DVTk_Library/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/Libraries/Session/session_lexer.cpp b/DVTk_Library/Libraries/Session/session_lexer.cpp deleted file mode 100644 index 4c51833..0000000 --- a/DVTk_Library/Libraries/Session/session_lexer.cpp +++ /dev/null @@ -1,3047 +0,0 @@ -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE sessionrestart( sessionin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int sessionleng; -extern FILE *sessionin, *sessionout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up sessiontext. */ \ - *yy_cp = yy_hold_char; \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up sessiontext again */ \ - } \ - while ( 0 ) - -#define unput(c) sessionunput( c, sessiontext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via sessionrestart()), so that the user can continue scanning by - * just pointing sessionin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when sessiontext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int sessionleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow sessionwrap()'s to do buffer switches - * instead of setting up a fresh sessionin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void sessionrestart YY_PROTO(( FILE *input_file )); - -void session_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void session_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE session_create_buffer YY_PROTO(( FILE *file, int size )); -void session_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void session_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void session_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER session_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE session_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE session_scan_string YY_PROTO(( yyconst char *str )); -YY_BUFFER_STATE session_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer session_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = session_create_buffer( sessionin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = session_create_buffer( sessionin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - - -#define YY_USES_REJECT - -#define sessionwrap() 1 -#define YY_SKIP_YYWRAP -typedef unsigned char YY_CHAR; -FILE *sessionin = (FILE *) 0, *sessionout = (FILE *) 0; -typedef int yy_state_type; -#define YY_FLEX_LEX_COMPAT -extern int sessionlineno; -int sessionlineno = 1; -extern char sessiontext[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up sessiontext. - */ -#define YY_DO_BEFORE_ACTION \ - sessiontext_ptr = yy_bp; \ - sessiontext_ptr -= yy_more_len; \ - sessionleng = (int) (yy_cp - sessiontext_ptr); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( sessionleng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( sessiontext, sessiontext_ptr, sessionleng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 128 -#define YY_END_OF_BUFFER 129 -static yyconst short int yy_acclist[210] = - { 0, - 129, 127, 128, 6, 127, 128, 6, 128, 127, 128, - 5, 127, 128, 127, 128, 124, 127, 128, 127, 128, - 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, - 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, - 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, - 127, 128, 127, 128, 127, 128, 127, 128, 127, 128, - 127, 128, 127, 128, 127, 128, 1, 127, 128, 6, - 127, 128, 4, 6, 128, 5, 127, 128, 6, 126, - 5, 123, 124, 7, 6, 4, 6, 5, 3, 5, - 125, 107, 5, 2, 3, 20, 110, 106, 104, 57, - - 105, 114, 109, 112, 8, 115, 111, 41, 83, 63, - 35, 36, 121, 118, 113, 108, 85, 81, 19, 122, - 97, 9, 64, 15, 13, 117, 116, 54, 99, 82, - 45, 50, 37, 103, 84, 14, 100, 11, 92, 30, - 34, 62, 43, 12, 119, 93, 61, 90, 91, 48, - 25, 96, 71, 51, 52, 65, 69, 67, 26, 66, - 98, 44, 94, 68, 47, 88, 18, 72, 56, 55, - 42, 86, 49, 60, 21, 23, 46, 77, 59, 58, - 95, 10, 120, 79, 101, 102, 78, 16, 27, 53, - 28, 22, 76, 24, 70, 17, 74, 73, 38, 29, - - 89, 31, 39, 87, 32, 40, 33, 80, 75 - } ; - -static yyconst short int yy_accept[1415] = - { 0, - 1, 1, 1, 2, 4, 7, 9, 11, 14, 16, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, - 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 63, 65, 67, 70, 73, 76, 79, 80, - 80, 81, 81, 82, 83, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - - 85, 86, 88, 88, 89, 90, 91, 91, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, - 93, 93, 93, 93, 93, 93, 93, 93, 93, 94, - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, - - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 98, 98, 98, 99, 99, 99, 99, 99, 99, - 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 102, 103, 103, 103, 103, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - - 106, 106, 106, 106, 106, 106, 106, 107, 107, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 110, - 110, 110, 110, 110, 110, 110, 110, 110, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 112, 113, 113, - 113, 113, 113, 113, 113, 113, 113, 114, 114, 115, - 116, 116, 116, 117, 117, 117, 117, 117, 117, 117, - - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, - 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - - 123, 123, 123, 123, 123, 123, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 127, - 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, - 129, 130, 130, 130, 130, 130, 130, 130, 130, 130, - 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, - 130, 131, 131, 131, 131, 131, 131, 131, 131, 131, - - 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, - 131, 131, 131, 131, 131, 131, 132, 132, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 134, 134, 134, - 134, 134, 134, 134, 135, 135, 135, 135, 135, 135, - 135, 135, 136, 136, 137, 137, 137, 137, 137, 137, - 137, 138, 138, 138, 138, 138, 138, 139, 139, 139, - 140, 140, 140, 140, 141, 142, 142, 142, 142, 142, - 142, 142, 142, 142, 142, 143, 143, 143, 143, 143, - - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, - 144, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 146, 146, 146, 146, 146, - 146, 146, 146, 146, 146, 146, 146, 146, 147, 147, - 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, - - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, - 152, 152, 152, 152, 152, 152, 152, 153, 153, 153, - 153, 153, 153, 153, 153, 153, 154, 154, 154, 154, - 154, 154, 154, 154, 155, 155, 156, 156, 156, 156, - 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 159, 159, 159, 159, 159, - 159, 160, 160, 160, 160, 160, 161, 161, 161, 161, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, - - 163, 163, 163, 163, 163, 163, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 165, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 166, 167, 167, 167, 167, 167, 167, 167, 167, - 167, 167, 168, 169, 169, 169, 169, 169, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 172, 172, 172, - 172, 172, 172, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 174, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 176, 177, 178, 178, 178, 178, 178, 178, 179, - 179, 179, 179, 179, 179, 179, 180, 180, 181, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, - 183, 184, 184, 184, 184, 185, 185, 185, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 187, 187, - 187, 188, 188, 188, 188, 188, 188, 188, 188, 188, - 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, - - 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, - 189, 189, 189, 189, 189, 189, 190, 190, 190, 190, - 190, 190, 190, 190, 190, 191, 191, 191, 191, 191, - 191, 191, 192, 192, 192, 192, 192, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 195, 195, 196, 196, 196, - 196, 197, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 198, 198, 198, 198, 199, 199, 199, 200, 200, - 201, 201, 202, 202, 202, 202, 203, 204, 204, 204, - 204, 205, 206, 206, 206, 206, 206, 206, 206, 206, - - 206, 206, 207, 207, 207, 208, 208, 208, 208, 208, - 209, 209, 210, 210 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 5, 6, 1, 1, 1, 1, 1, - 1, 1, 7, 1, 8, 1, 1, 9, 9, 10, - 11, 9, 9, 9, 9, 9, 9, 1, 1, 1, - 1, 1, 1, 1, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 1, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 1, - 1, 36, 1, 1, 1, 1, 37, 38, 39, 40, - - 41, 42, 43, 44, 45, 1, 1, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 1, 56, 1, - 57, 1, 1, 1, 1, 1, 1, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58 - } ; - -static yyconst int yy_meta[59] = - { 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, 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 - } ; - -static yyconst short int yy_base[1421] = - { 0, - 0, 57, 1481, 1482, 62, 65, 56, 0, 61, 64, - 62, 66, 67, 1456, 1454, 57, 72, 83, 74, 1462, - 93, 90, 72, 1465, 1473, 61, 1428, 1437, 1424, 1431, - 1422, 74, 77, 76, 1482, 130, 135, 114, 138, 114, - 1482, 124, 0, 134, 137, 1441, 1454, 1442, 1437, 108, - 1438, 1449, 1438, 1439, 1446, 1431, 132, 112, 1437, 1429, - 136, 1430, 1431, 1442, 1442, 138, 129, 1430, 1438, 1421, - 1426, 135, 1418, 1423, 1419, 143, 141, 144, 1421, 1417, - 1416, 1436, 1427, 1420, 1482, 1402, 1432, 1384, 1392, 1389, - 1396, 147, 1379, 1383, 1381, 1383, 1386, 1393, 1391, 1373, - - 169, 174, 176, 1424, 1482, 1423, 178, 1482, 1409, 1416, - 164, 1398, 1403, 1399, 1390, 1405, 1399, 1387, 1401, 172, - 1395, 1402, 1399, 1400, 1386, 1381, 1383, 1400, 1378, 1375, - 1382, 1382, 1381, 1386, 1389, 1392, 1368, 177, 1390, 1381, - 1388, 1380, 1369, 1362, 1376, 1383, 1361, 1368, 1358, 1359, - 1366, 1362, 1358, 1375, 1374, 1351, 1372, 1347, 1370, 1357, - 1335, 147, 1329, 1321, 1330, 1327, 1318, 1329, 1482, 1314, - 1323, 1315, 1324, 1317, 1309, 1322, 1359, 1358, 1357, 1482, - 1351, 1340, 1333, 1336, 1347, 1338, 173, 1333, 1331, 1335, - 1330, 1333, 1340, 1482, 1323, 1311, 1317, 1324, 1320, 1326, - - 1333, 178, 1324, 1311, 1326, 1321, 1305, 1313, 1312, 190, - 1316, 1302, 1308, 1300, 1307, 1313, 1296, 1296, 1303, 1316, - 180, 1303, 1306, 1288, 1308, 1305, 1306, 1292, 201, 1296, - 1299, 177, 1286, 174, 1298, 1262, 1274, 1269, 1272, 1267, - 1482, 1270, 1252, 1482, 1264, 1254, 1249, 1260, 1261, 1254, - 1482, 1296, 1275, 1269, 1281, 1281, 178, 1286, 1278, 1268, - 1274, 1282, 1261, 1264, 1263, 1271, 195, 1482, 1265, 1262, - 1254, 1274, 1269, 1264, 1256, 1266, 1252, 1251, 1246, 1258, - 1243, 1249, 1256, 1262, 1261, 1254, 206, 1239, 1242, 1249, - 1250, 1251, 1250, 1239, 1229, 1237, 1250, 1226, 1242, 1239, - - 1224, 1233, 1229, 1226, 1225, 1219, 1236, 1229, 1216, 1217, - 1216, 1227, 1217, 1218, 1228, 1214, 1213, 1211, 1221, 1223, - 1218, 1225, 1204, 1215, 1218, 1175, 1174, 1187, 1172, 1482, - 1482, 1176, 1171, 1169, 1482, 1181, 1184, 1183, 1203, 1193, - 1209, 1204, 1187, 1179, 1183, 1204, 1193, 1190, 1181, 1200, - 1176, 1176, 1185, 1196, 1173, 1176, 1185, 1186, 1176, 1168, - 1189, 1170, 1161, 1166, 1179, 1163, 1183, 1182, 1173, 1172, - 1172, 1164, 1156, 1171, 1169, 1160, 1153, 1163, 1157, 1152, - 1149, 1162, 1146, 1151, 1144, 1148, 1148, 1140, 1161, 1139, - 1144, 1135, 1136, 1140, 1155, 1134, 1145, 1152, 1124, 1128, - - 1149, 1127, 1129, 1120, 1125, 1130, 1143, 1142, 1135, 1120, - 1132, 1126, 1131, 1114, 1094, 1105, 1096, 1091, 1087, 1084, - 1482, 1085, 1084, 1083, 1105, 1102, 1102, 1101, 1114, 1103, - 1106, 1115, 1118, 1111, 1108, 1101, 1106, 1101, 1092, 1090, - 1098, 1087, 1101, 1087, 1098, 1083, 1082, 1089, 1090, 1079, - 1087, 1087, 1090, 1085, 1080, 1095, 1071, 1081, 1084, 1068, - 1073, 1071, 1071, 1070, 1082, 1085, 1068, 1061, 1082, 1081, - 1080, 1075, 1060, 1077, 198, 1076, 1071, 1060, 1051, 1072, - 1049, 1062, 1069, 1044, 1067, 1058, 1043, 1042, 1049, 1050, - 1039, 1052, 1041, 1053, 1046, 1035, 1047, 1030, 1030, 1040, - - 1007, 1005, 1020, 1004, 1018, 1005, 1482, 1013, 1482, 1023, - 1025, 1025, 1029, 1036, 1031, 1017, 1029, 1032, 1031, 1019, - 1021, 1032, 1027, 1022, 1010, 1011, 1015, 1026, 1013, 1003, - 1003, 1010, 1013, 1005, 1482, 1011, 1001, 993, 995, 993, - 202, 999, 992, 1012, 1001, 995, 1009, 988, 1482, 985, - 984, 993, 981, 979, 988, 977, 985, 1482, 979, 981, - 980, 976, 985, 990, 993, 213, 980, 991, 975, 985, - 964, 980, 974, 969, 976, 968, 1482, 1482, 965, 954, - 972, 967, 969, 973, 956, 958, 50, 49, 102, 1482, - 116, 116, 1482, 202, 208, 217, 206, 204, 227, 228, - - 230, 223, 210, 216, 213, 219, 223, 232, 239, 224, - 224, 218, 225, 223, 233, 224, 232, 225, 227, 234, - 243, 252, 249, 250, 228, 238, 235, 243, 1482, 259, - 239, 1482, 249, 251, 247, 244, 257, 258, 260, 261, - 253, 255, 251, 256, 266, 253, 260, 265, 271, 267, - 265, 257, 265, 269, 280, 285, 264, 283, 273, 266, - 270, 1482, 291, 275, 293, 273, 288, 281, 258, 253, - 259, 268, 1482, 292, 289, 284, 289, 298, 305, 287, - 287, 310, 303, 290, 291, 298, 294, 294, 303, 318, - 303, 316, 299, 318, 318, 310, 317, 311, 327, 1482, - - 312, 314, 308, 309, 314, 1482, 325, 326, 331, 321, - 315, 321, 319, 330, 333, 322, 327, 324, 1482, 332, - 331, 326, 332, 350, 334, 348, 339, 1482, 332, 337, - 348, 349, 351, 347, 346, 339, 348, 348, 356, 350, - 344, 345, 352, 355, 362, 371, 372, 341, 1482, 334, - 1482, 367, 368, 369, 378, 379, 380, 373, 370, 361, - 384, 377, 1482, 386, 387, 371, 381, 383, 391, 378, - 393, 384, 372, 388, 381, 398, 377, 400, 393, 390, - 393, 397, 390, 386, 394, 401, 406, 407, 396, 405, - 1482, 394, 394, 406, 396, 410, 411, 420, 399, 415, - - 403, 409, 417, 412, 419, 411, 409, 422, 424, 420, - 413, 426, 427, 420, 437, 1482, 426, 1482, 422, 440, - 420, 422, 423, 406, 424, 430, 426, 440, 442, 446, - 430, 430, 441, 445, 455, 448, 448, 438, 443, 448, - 444, 455, 451, 444, 457, 444, 1482, 445, 454, 457, - 466, 464, 455, 1482, 473, 474, 454, 464, 456, 464, - 457, 1482, 476, 1482, 469, 460, 471, 484, 479, 470, - 1482, 483, 488, 481, 490, 483, 1482, 469, 472, 1482, - 490, 488, 492, 1482, 1482, 475, 484, 484, 483, 486, - 485, 495, 471, 456, 1482, 496, 484, 492, 497, 488, - - 490, 498, 491, 502, 509, 496, 505, 491, 509, 500, - 504, 510, 516, 507, 504, 518, 523, 520, 514, 508, - 519, 516, 530, 516, 531, 529, 516, 526, 531, 533, - 524, 531, 526, 532, 523, 542, 525, 526, 1482, 525, - 1482, 528, 539, 530, 549, 538, 551, 548, 549, 545, - 555, 554, 540, 519, 1482, 541, 550, 543, 546, 545, - 556, 561, 556, 557, 564, 553, 560, 1482, 553, 568, - 555, 558, 575, 563, 1482, 560, 560, 567, 576, 563, - 582, 587, 588, 572, 580, 587, 588, 586, 1482, 1482, - 578, 595, 580, 576, 598, 584, 596, 580, 594, 1482, - - 586, 592, 583, 585, 585, 592, 592, 587, 593, 599, - 590, 567, 604, 594, 605, 610, 599, 603, 1482, 613, - 614, 603, 607, 617, 615, 621, 1482, 620, 607, 608, - 631, 620, 623, 617, 615, 1482, 630, 621, 618, 631, - 618, 631, 638, 1482, 623, 1482, 644, 627, 638, 1482, - 1482, 627, 632, 632, 638, 642, 640, 643, 632, 638, - 639, 650, 645, 627, 1482, 640, 640, 657, 652, 649, - 1482, 650, 645, 648, 653, 1482, 648, 665, 660, 1482, - 653, 657, 653, 653, 665, 664, 671, 663, 659, 661, - 671, 676, 663, 678, 683, 671, 1482, 668, 669, 675, - - 675, 685, 677, 673, 674, 1482, 685, 676, 677, 655, - 701, 675, 683, 701, 686, 704, 697, 1482, 706, 694, - 690, 696, 706, 699, 705, 695, 713, 715, 700, 699, - 1482, 1482, 705, 702, 712, 719, 720, 719, 722, 709, - 718, 1482, 1482, 715, 712, 717, 723, 1482, 719, 715, - 716, 692, 730, 740, 724, 719, 1482, 728, 735, 730, - 726, 730, 732, 740, 750, 751, 1482, 729, 732, 733, - 737, 740, 1482, 740, 750, 753, 741, 743, 740, 746, - 764, 765, 767, 768, 759, 1482, 1482, 729, 759, 756, - 753, 752, 767, 764, 769, 751, 759, 781, 782, 777, - - 764, 763, 765, 775, 768, 789, 774, 779, 784, 770, - 1482, 1482, 1482, 778, 775, 775, 791, 778, 1482, 755, - 786, 798, 795, 777, 797, 1482, 800, 1482, 1482, 780, - 788, 800, 796, 803, 804, 805, 814, 799, 809, 798, - 819, 796, 803, 814, 1482, 815, 797, 811, 818, 819, - 1482, 820, 814, 810, 1482, 810, 828, 1482, 825, 822, - 831, 816, 831, 838, 816, 824, 820, 834, 823, 836, - 823, 825, 826, 832, 845, 830, 845, 1482, 844, 832, - 1482, 832, 834, 842, 836, 837, 851, 836, 849, 862, - 855, 843, 857, 859, 850, 846, 846, 848, 850, 851, - - 865, 1482, 862, 867, 853, 869, 857, 867, 868, 877, - 875, 867, 868, 862, 865, 1482, 867, 871, 875, 886, - 870, 880, 881, 877, 1482, 881, 875, 897, 881, 875, - 886, 1482, 897, 880, 889, 881, 1482, 885, 884, 881, - 908, 892, 886, 895, 890, 1482, 890, 898, 907, 893, - 902, 918, 897, 906, 1482, 900, 1482, 899, 907, 916, - 1482, 904, 914, 927, 921, 921, 922, 919, 911, 911, - 1482, 922, 935, 929, 1482, 930, 922, 1482, 939, 1482, - 924, 1482, 920, 935, 927, 1482, 1482, 940, 931, 926, - 1482, 1482, 943, 933, 941, 942, 936, 944, 937, 933, - - 947, 1482, 946, 934, 1482, 936, 945, 949, 939, 1482, - 941, 1482, 1482, 970, 971, 972, 974, 976, 978, 980 - } ; - -static yyconst short int yy_def[1421] = - { 0, - 1413, 1, 1413, 1413, 1413, 1413, 1414, 1415, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1416, 1413, 1414, - 1413, 1417, 1415, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1418, 1416, 1413, 1419, 1417, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1418, 1420, 1419, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1420, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 0, 1413, 1413, 1413, 1413, 1413, 1413, 1413 - } ; - -static yyconst short int yy_nxt[1541] = - { 0, - 4, 5, 6, 5, 7, 8, 9, 9, 10, 10, - 10, 11, 4, 12, 13, 14, 15, 4, 4, 16, - 4, 17, 18, 4, 4, 19, 4, 20, 21, 22, - 23, 24, 4, 4, 4, 25, 26, 4, 4, 4, - 27, 28, 4, 4, 4, 29, 30, 31, 4, 4, - 4, 32, 33, 34, 4, 4, 4, 35, 36, 37, - 41, 669, 38, 39, 39, 39, 39, 39, 39, 44, - 44, 44, 45, 45, 45, 46, 47, 50, 56, 63, - 64, 51, 57, 65, 52, 53, 58, 48, 70, 670, - 54, 42, 49, 55, 67, 82, 66, 59, 60, 86, - - 83, 71, 68, 79, 73, 80, 74, 69, 75, 671, - 93, 81, 99, 87, 94, 95, 105, 76, 41, 106, - 96, 113, 77, 78, 97, 125, 108, 100, 41, 114, - 98, 101, 102, 39, 126, 103, 39, 39, 39, 39, - 39, 39, 44, 44, 44, 45, 45, 45, 121, 42, - 129, 135, 137, 122, 167, 136, 148, 143, 672, 149, - 123, 124, 138, 144, 130, 150, 152, 673, 151, 153, - 101, 102, 39, 154, 103, 39, 39, 39, 105, 183, - 1413, 178, 41, 193, 212, 184, 237, 194, 259, 274, - 320, 343, 260, 238, 168, 303, 213, 275, 304, 323, - - 276, 286, 324, 277, 287, 288, 278, 344, 321, 289, - 354, 560, 312, 674, 355, 675, 561, 290, 291, 313, - 314, 374, 292, 315, 676, 375, 316, 624, 317, 648, - 677, 625, 649, 678, 679, 680, 376, 681, 682, 683, - 684, 685, 650, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 710, 711, 712, 713, - 714, 715, 716, 717, 709, 718, 719, 720, 721, 722, - 723, 724, 725, 726, 727, 728, 729, 731, 732, 733, - 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - - 744, 730, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, - 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 788, 789, 790, 791, 792, 793, - 794, 795, 787, 796, 797, 798, 799, 800, 801, 802, - 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, - 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, - 833, 834, 835, 836, 837, 838, 839, 840, 842, 843, - - 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, - 841, 854, 855, 856, 857, 858, 859, 860, 861, 862, - 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, - 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, - 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, - 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, - 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, - 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, - 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, - 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, - - 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, - 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, - 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, - 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, - 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, - 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, - 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, - 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, - 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, - 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, - - 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, - 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, - 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, - 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, - 1083, 1084, 1085, 1086, 1088, 1089, 1090, 1091, 1092, 1093, - 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, - 1104, 1087, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, - 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, - 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, - 1133, 1134, 1135, 1136, 1137, 1140, 1141, 1142, 1143, 1144, - - 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, - 1138, 1139, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1162, - 1163, 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1171, 1172, - 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, - 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, - 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, - 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1213, - 1214, 1215, 1216, 1212, 1217, 1218, 1219, 1220, 1221, 1222, - 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1223, 1231, 1232, - 1233, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, - - 1244, 1245, 1246, 1247, 1248, 1250, 1251, 1252, 1234, 1253, - 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, - 1264, 1265, 1249, 1266, 1267, 1268, 1269, 1270, 1271, 1272, - 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, - 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, - 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, - 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, - 1313, 1314, 1315, 1316, 1317, 1318, 1319, 1320, 1321, 1322, - 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, - 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, - - 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, - 1353, 1354, 1355, 1356, 1357, 1358, 1359, 1360, 1361, 1362, - 1363, 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372, - 1373, 1374, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, - 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, - 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, - 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, - 40, 43, 104, 104, 107, 107, 177, 177, 179, 179, - 252, 252, 668, 667, 666, 665, 664, 663, 662, 661, - 660, 659, 658, 657, 656, 655, 654, 653, 652, 651, - - 647, 646, 645, 644, 643, 642, 641, 640, 639, 638, - 637, 636, 635, 634, 633, 632, 631, 630, 629, 628, - 627, 626, 623, 622, 621, 620, 619, 618, 617, 616, - 615, 614, 613, 612, 611, 610, 609, 608, 607, 606, - 605, 604, 603, 602, 601, 600, 599, 598, 597, 596, - 595, 594, 593, 592, 591, 590, 589, 588, 587, 586, - 585, 584, 583, 582, 581, 580, 579, 578, 577, 576, - 575, 574, 573, 572, 571, 570, 569, 568, 567, 566, - 565, 564, 563, 562, 559, 558, 557, 556, 555, 554, - 553, 552, 551, 550, 549, 548, 547, 546, 545, 544, - - 543, 542, 541, 540, 539, 538, 537, 536, 535, 534, - 533, 532, 531, 530, 529, 528, 527, 526, 525, 524, - 523, 522, 521, 520, 519, 518, 517, 516, 515, 514, - 513, 512, 511, 510, 509, 508, 507, 506, 505, 504, - 503, 502, 501, 500, 499, 498, 497, 496, 495, 494, - 493, 492, 491, 490, 489, 488, 487, 486, 485, 484, - 483, 482, 481, 480, 479, 478, 477, 476, 475, 474, - 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, - 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, - 453, 452, 451, 450, 449, 448, 447, 446, 445, 444, - - 443, 442, 441, 440, 439, 438, 437, 436, 435, 434, - 433, 432, 431, 430, 429, 428, 427, 426, 425, 424, - 423, 422, 421, 420, 419, 418, 417, 416, 415, 414, - 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, - 403, 402, 401, 400, 399, 398, 397, 396, 395, 394, - 393, 392, 391, 390, 389, 388, 387, 386, 385, 384, - 383, 382, 381, 380, 379, 378, 377, 373, 372, 371, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 360, 359, 358, 357, 356, 353, 352, 351, 350, 349, - 348, 347, 346, 345, 342, 341, 340, 339, 180, 338, - - 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, - 327, 326, 325, 322, 319, 318, 311, 310, 309, 308, - 307, 306, 305, 302, 301, 300, 299, 298, 297, 296, - 295, 294, 293, 285, 284, 283, 282, 281, 280, 279, - 273, 272, 271, 270, 269, 268, 267, 266, 265, 264, - 263, 262, 261, 258, 257, 256, 255, 254, 253, 180, - 180, 105, 251, 250, 249, 248, 247, 246, 245, 244, - 243, 242, 241, 240, 239, 236, 235, 234, 233, 232, - 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, - 221, 220, 219, 218, 217, 216, 215, 214, 211, 210, - - 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, - 199, 198, 197, 196, 195, 192, 191, 190, 189, 188, - 187, 186, 185, 182, 181, 180, 105, 176, 175, 174, - 173, 172, 171, 170, 169, 166, 165, 164, 163, 162, - 161, 160, 159, 158, 157, 156, 155, 147, 146, 145, - 142, 141, 140, 139, 134, 133, 132, 131, 128, 127, - 120, 119, 118, 117, 116, 115, 112, 111, 110, 109, - 92, 91, 90, 89, 88, 85, 84, 72, 62, 61, - 1413, 3, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413 - } ; - -static yyconst short int yy_chk[1541] = - { 0, - 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, 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, 1, 1, 2, 2, - 7, 587, 2, 5, 5, 5, 6, 6, 6, 9, - 9, 9, 10, 10, 10, 11, 11, 12, 13, 16, - 16, 12, 13, 17, 12, 12, 13, 11, 19, 588, - 12, 7, 11, 12, 18, 23, 17, 13, 13, 26, - - 23, 19, 18, 22, 21, 22, 21, 18, 21, 589, - 32, 22, 34, 26, 32, 33, 38, 21, 40, 38, - 33, 50, 21, 21, 33, 58, 42, 34, 42, 50, - 33, 36, 36, 36, 58, 36, 37, 37, 37, 39, - 39, 39, 44, 44, 44, 45, 45, 45, 57, 40, - 61, 66, 67, 57, 92, 66, 76, 72, 591, 76, - 57, 57, 67, 72, 61, 77, 78, 592, 77, 78, - 101, 101, 101, 78, 101, 102, 102, 102, 103, 111, - 107, 103, 107, 120, 138, 111, 162, 120, 187, 202, - 232, 257, 187, 162, 92, 221, 138, 202, 221, 234, - - 202, 210, 234, 202, 210, 210, 202, 257, 232, 210, - 267, 475, 229, 594, 267, 595, 475, 210, 210, 229, - 229, 287, 210, 229, 596, 287, 229, 541, 229, 566, - 597, 541, 566, 598, 599, 600, 287, 601, 602, 603, - 604, 605, 566, 606, 607, 608, 609, 610, 611, 612, - 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, - 623, 624, 625, 626, 627, 628, 630, 631, 633, 634, - 635, 636, 637, 638, 628, 639, 640, 641, 642, 643, - 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 663, 664, - - 665, 650, 666, 667, 668, 669, 670, 671, 672, 674, - 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, - 695, 696, 697, 698, 699, 701, 702, 703, 704, 705, - 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 710, 720, 721, 722, 723, 724, 725, 726, - 727, 729, 730, 731, 732, 733, 734, 735, 736, 737, - 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, - 748, 750, 752, 753, 754, 755, 756, 757, 758, 759, - 760, 761, 762, 764, 765, 766, 767, 768, 769, 770, - - 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, - 768, 781, 782, 783, 784, 785, 786, 787, 788, 789, - 790, 792, 793, 794, 795, 796, 797, 798, 799, 800, - 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 817, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, - 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, - 843, 844, 845, 846, 848, 849, 850, 851, 852, 853, - 855, 856, 857, 858, 859, 860, 861, 863, 865, 866, - 867, 868, 869, 870, 872, 873, 874, 875, 876, 878, - - 879, 881, 882, 883, 886, 887, 888, 889, 890, 891, - 892, 893, 894, 896, 897, 898, 899, 900, 901, 902, - 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, - 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, - 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, - 933, 934, 935, 936, 937, 938, 940, 942, 943, 944, - 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, - 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, - 966, 967, 969, 970, 971, 972, 973, 974, 976, 977, - 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, - - 988, 991, 992, 993, 994, 995, 996, 997, 998, 999, - 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, - 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1020, 1021, - 1022, 1023, 1024, 1025, 1026, 1028, 1029, 1030, 1031, 1032, - 1033, 1034, 1035, 1037, 1038, 1039, 1040, 1041, 1042, 1043, - 1045, 1047, 1048, 1049, 1052, 1053, 1054, 1055, 1056, 1057, - 1058, 1037, 1059, 1060, 1061, 1062, 1063, 1064, 1066, 1067, - 1068, 1069, 1070, 1072, 1073, 1074, 1075, 1077, 1078, 1079, - 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, - 1091, 1092, 1093, 1094, 1095, 1096, 1098, 1099, 1100, 1101, - - 1102, 1103, 1104, 1105, 1107, 1108, 1109, 1110, 1111, 1112, - 1095, 1095, 1113, 1114, 1115, 1116, 1117, 1119, 1120, 1121, - 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1133, - 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1144, 1145, - 1146, 1147, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, - 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1168, - 1169, 1170, 1171, 1172, 1174, 1175, 1176, 1177, 1178, 1179, - 1180, 1181, 1182, 1178, 1183, 1184, 1185, 1188, 1189, 1190, - 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1190, 1198, 1199, - 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, - - 1210, 1214, 1215, 1216, 1217, 1218, 1220, 1221, 1200, 1222, - 1223, 1224, 1225, 1227, 1230, 1231, 1232, 1233, 1234, 1235, - 1236, 1237, 1217, 1238, 1239, 1240, 1241, 1242, 1243, 1244, - 1246, 1247, 1248, 1249, 1250, 1252, 1253, 1254, 1256, 1257, - 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, - 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1279, - 1280, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, - 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, - 1301, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, - 1312, 1313, 1314, 1315, 1317, 1318, 1319, 1320, 1321, 1322, - - 1323, 1324, 1326, 1327, 1328, 1329, 1330, 1331, 1333, 1334, - 1335, 1336, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, - 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1356, 1358, - 1359, 1360, 1362, 1363, 1364, 1365, 1366, 1367, 1368, 1369, - 1370, 1372, 1373, 1374, 1376, 1377, 1379, 1381, 1383, 1384, - 1385, 1388, 1389, 1390, 1393, 1394, 1395, 1396, 1397, 1398, - 1399, 1400, 1401, 1403, 1404, 1406, 1407, 1408, 1409, 1411, - 1414, 1415, 1416, 1416, 1417, 1417, 1418, 1418, 1419, 1419, - 1420, 1420, 586, 585, 584, 583, 582, 581, 580, 579, - 576, 575, 574, 573, 572, 571, 570, 569, 568, 567, - - 565, 564, 563, 562, 561, 560, 559, 557, 556, 555, - 554, 553, 552, 551, 550, 548, 547, 546, 545, 544, - 543, 542, 540, 539, 538, 537, 536, 534, 533, 532, - 531, 530, 529, 528, 527, 526, 525, 524, 523, 522, - 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, - 511, 510, 508, 506, 505, 504, 503, 502, 501, 500, - 499, 498, 497, 496, 495, 494, 493, 492, 491, 490, - 489, 488, 487, 486, 485, 484, 483, 482, 481, 480, - 479, 478, 477, 476, 474, 473, 472, 471, 470, 469, - 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, - - 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, - 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, - 428, 427, 426, 425, 424, 423, 422, 420, 419, 418, - 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, - 407, 406, 405, 404, 403, 402, 401, 400, 399, 398, - 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, - 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, - 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, - 367, 366, 365, 364, 363, 362, 361, 360, 359, 358, - - 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, - 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, - 337, 336, 334, 333, 332, 329, 328, 327, 326, 325, - 324, 323, 322, 321, 320, 319, 318, 317, 316, 315, - 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, - 304, 303, 302, 301, 300, 299, 298, 297, 296, 295, - 294, 293, 292, 291, 290, 289, 288, 286, 285, 284, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 272, 271, 270, 269, 266, 265, 264, 263, 262, - 261, 260, 259, 258, 256, 255, 254, 253, 252, 250, - - 249, 248, 247, 246, 245, 243, 242, 240, 239, 238, - 237, 236, 235, 233, 231, 230, 228, 227, 226, 225, - 224, 223, 222, 220, 219, 218, 217, 216, 215, 214, - 213, 212, 211, 209, 208, 207, 206, 205, 204, 203, - 201, 200, 199, 198, 197, 196, 195, 193, 192, 191, - 190, 189, 188, 186, 185, 184, 183, 182, 181, 179, - 178, 177, 176, 175, 174, 173, 172, 171, 170, 168, - 167, 166, 165, 164, 163, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - 146, 145, 144, 143, 142, 141, 140, 139, 137, 136, - - 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, - 125, 124, 123, 122, 121, 119, 118, 117, 116, 115, - 114, 113, 112, 110, 109, 106, 104, 100, 99, 98, - 97, 96, 95, 94, 93, 91, 90, 89, 88, 87, - 86, 84, 83, 82, 81, 80, 79, 75, 74, 73, - 71, 70, 69, 68, 65, 64, 63, 62, 60, 59, - 56, 55, 54, 53, 52, 51, 49, 48, 47, 46, - 31, 30, 29, 28, 27, 25, 24, 20, 15, 14, - 3, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, - 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413, 1413 - } ; - -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up sessiontext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} -static int yy_more_flag = 0; -static int yy_more_len = 0; -#define yymore() (yy_more_flag = 1) -#define YY_MORE_ADJ yy_more_len -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char sessiontext[YYLMAX]; -char *sessiontext_ptr; -#line 1 "session_lexer.l" -#define INITIAL 0 -#line 2 "session_lexer.l" -// Part of Dvtk Libraries - Internal Native Library Code -// Copyright 2001-2006 -// Philips Medical Systems NL B.V., Agfa-Gevaert N.V. - -//***************************************************************************** -// DESCRIPTION : Session File Lexer. -//***************************************************************************** - -#ifdef _WINDOWS -#pragma warning (disable : 4102) -#pragma warning (disable : 4273) -#pragma warning (disable : 4786) -#endif - -//***************************************************************************** -// EXTERNAL DECLARATIONS -//***************************************************************************** -// Added this for DVT -// # define YYLMAX 1024 -// - don't forget it -#include -#include "Iglobal.h" // Global component interface -#include "Ilog.h" // Log component interface -#include "Iutility.h" // Utility component interface -#include "session.h" // Test Session -#include "session_parser.cpp.h" - -extern void scripterror(char *); - -extern void sessionerror(char*); -//extern string sessionfile; -extern FILE *sessionin; -extern int scriptlineno; - -extern BASE_SESSION_CLASS *session_ptr; - - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int sessionwrap YY_PROTO(( void )); -#else -extern int sessionwrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void sessionunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef sessiontext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int sessioninput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( sessiontext, sessionleng, 1, sessionout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( sessionin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( sessionin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, sessionin )) == 0) \ - && ferror( sessionin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int sessionlex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after sessiontext and sessionleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( sessionleng > 0 ) \ - yy_current_buffer->yy_at_bol = \ - (sessiontext[sessionleng - 1] == '\n'); \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 49 "session_lexer.l" - - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! sessionin ) - sessionin = stdin; - - if ( ! sessionout ) - sessionout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - session_create_buffer( sessionin, YY_BUF_SIZE ); - - session_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_more_len = 0; - if ( yy_more_flag ) - { - yy_more_len = sessionleng; - yy_more_flag = 0; - } - yy_cp = yy_c_buf_p; - - /* Support of sessiontext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1414 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1482 ); - -yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER ) - { - int yyl; - for ( yyl = 0; yyl < sessionleng; ++yyl ) - if ( sessiontext[yyl] == '\n' ) - ++sessionlineno; - } - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ -case 1: -YY_RULE_SETUP -#line 50 "session_lexer.l" -{ /* skip charcters from 80H - FFH */ - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 52 "session_lexer.l" -{ - // copy script comment lines - strip off leading ## - int length = sessionleng; - - // check to see how line is terminated - // - and remove termination - if ((sessiontext[sessionleng-1] == LINEFEED) - && (sessiontext[sessionleng-2] == CARRIAGERETURN)) - length -= 2; - else - length--; - - memcpy(sessionlval.string, &sessiontext[0], length); - sessionlval.string[length] = '\0'; - - LOG_CLASS *logger_ptr = session_ptr->getLogger(); - if (logger_ptr) - { - logger_ptr->text(LOG_SCRIPT, 1, "%s", sessionlval.string); - } - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 73 "session_lexer.l" -{ /* skip other comments */ } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 74 "session_lexer.l" -{ /* skip empty lines */ } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 75 "session_lexer.l" -{ /* skip comment */ } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 76 "session_lexer.l" -{ /* skip white space */ } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 77 "session_lexer.l" -{ /* continuation line */ } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 79 "session_lexer.l" -{ return T_SESSION; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 80 "session_lexer.l" -{ return T_ENDSESSION; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 81 "session_lexer.l" -{ return T_SESSION_FILE_VERSION; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 82 "session_lexer.l" -{ return T_SESSION_TYPE; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 83 "session_lexer.l" -{ return T_SESSION_TITLE; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 84 "session_lexer.l" -{ return T_SESSION_ID; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 85 "session_lexer.l" -{ return T_MANUFACT; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 86 "session_lexer.l" -{ return T_MODEL; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 87 "session_lexer.l" -{ return T_APPL_ENTITY_NAME; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 88 "session_lexer.l" -{ return T_APPL_ENTITY_VERSION; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 89 "session_lexer.l" -{ return T_SOFTWARE; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 90 "session_lexer.l" -{ return T_TESTED; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 91 "session_lexer.l" -{ return T_DATE; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 92 "session_lexer.l" -{ return T_PRODUCT_ROLE_ACCEPTOR; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 93 "session_lexer.l" -{ return T_PRODUCT_ROLE_ACCEPTOR; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 94 "session_lexer.l" -{ return T_PRODUCT_ROLE_REQUESTOR; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 95 "session_lexer.l" -{ return T_PRODUCT_ROLE_REQUESTOR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 96 "session_lexer.l" -{ return T_CALLED_AE ; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 97 "session_lexer.l" -{ return T_CALLING_AE; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 98 "session_lexer.l" -{ return T_MAX_LEN; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 99 "session_lexer.l" -{ return T_IMPL_CLASS; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 100 "session_lexer.l" -{ return T_IMPL_VER; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 102 "session_lexer.l" -{ return T_SUT_AE ; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 103 "session_lexer.l" -{ return T_SUT_MAX_LEN; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 104 "session_lexer.l" -{ return T_SUT_IMPL_CLASS; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 105 "session_lexer.l" -{ return T_SUT_IMPL_VER; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 106 "session_lexer.l" -{ return T_SUT_HOSTNAME; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 107 "session_lexer.l" -{ return T_SUT_PORT; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 108 "session_lexer.l" -{ return T_SUT_ROLE; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 110 "session_lexer.l" -{ return T_DVT_AE ; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 111 "session_lexer.l" -{ return T_DVT_MAX_LEN; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 112 "session_lexer.l" -{ return T_DVT_IMPL_CLASS; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 113 "session_lexer.l" -{ return T_DVT_IMPL_VER; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 114 "session_lexer.l" -{ return T_DVT_PORT; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 115 "session_lexer.l" -{ return T_DVT_SOCKET_TIMEOUT; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 117 "session_lexer.l" -{ return T_REMOTE_HOST_NAME; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 118 "session_lexer.l" -{ return T_REMOTE_HOST_NAME; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 119 "session_lexer.l" -{ return T_PORT; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 120 "session_lexer.l" -{ return T_REMOTE_PORT; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 121 "session_lexer.l" -{ return T_LOCAL_PORT; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 122 "session_lexer.l" -{ return T_SOCKET_TIMEOUT; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 123 "session_lexer.l" -{ return T_USE_SECURE_SOCKETS; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 124 "session_lexer.l" -{ return T_TLS_VERSION; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 125 "session_lexer.l" -{ return T_MAX_TLS_VERSION; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 126 "session_lexer.l" -{ return T_MIN_TLS_VERSION; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 127 "session_lexer.l" -{ return T_CHECK_REMOTE_CERTIFICATE; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 128 "session_lexer.l" -{ return T_CIPHER_LIST; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 129 "session_lexer.l" -{ return T_CACHE_TLS_SESSIONS; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 130 "session_lexer.l" -{ return T_TLS_CACHE_TIMEOUT; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 131 "session_lexer.l" -{ return T_DELAY; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 132 "session_lexer.l" -{ return T_CREDENTIALS_FILENAME; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 133 "session_lexer.l" -{ return T_CERTIFICATE_FILENAME; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 135 "session_lexer.l" -{ return T_VAL_RES; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 136 "session_lexer.l" -{ return T_DIMSE_MSG; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 137 "session_lexer.l" -{ return T_ACSE_MSG; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 138 "session_lexer.l" -{ return T_PDU_DUMP; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 139 "session_lexer.l" -{ return T_LABEL_DUMP; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 140 "session_lexer.l" -{ return T_IMAGE_SAVE; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 141 "session_lexer.l" -{ return T_DEF_SQ_LENGTH; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 142 "session_lexer.l" -{ return T_ADD_GROUP_LENGTH; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 143 "session_lexer.l" -{ return T_CONTINUE; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 144 "session_lexer.l" -{ return T_SUPPORTED_TRANSFER_SYNTAX; } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 145 "session_lexer.l" -{ return T_SUPPORTED_TRANSFER_SYNTAX; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 146 "session_lexer.l" -{ return T_FORMAT; } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 147 "session_lexer.l" -{ return T_STRICT; } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 148 "session_lexer.l" -{ return T_DETAILED_RESULTS; } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 149 "session_lexer.l" -{ return T_SUMMARY_RESULTS; } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 150 "session_lexer.l" -{ return T_INCLUDE_TYPE3_NOTPRESENT; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 151 "session_lexer.l" -{ return T_DUMP_ATTR_REFFILE; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 152 "session_lexer.l" -{ return T_PRIVATE_MAPPING; } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 153 "session_lexer.l" -{ return T_AUTO_TYPE; } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 154 "session_lexer.l" -{ return T_AUTO_CREATE; } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 155 "session_lexer.l" -{ return T_ENSURE_EVEN_ATTRIBUTE_VALUE_LENGTH; } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 156 "session_lexer.l" -{ return T_LOG_ERROR; } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 157 "session_lexer.l" -{ return T_LOG_WARNING; } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 158 "session_lexer.l" -{ return T_LOG_INFO; } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 159 "session_lexer.l" -{ return T_LOG_RELATION; } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 160 "session_lexer.l" -{ return T_LOG_DEBUG; } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 161 "session_lexer.l" -{ return T_LOG_DICOM; } - YY_BREAK -case 87: -YY_RULE_SETUP -#line 162 "session_lexer.l" -{ return T_DICOM_VAL_RES; } - YY_BREAK -case 88: -YY_RULE_SETUP -#line 163 "session_lexer.l" -{ return T_LOG_ACSE; } - YY_BREAK -case 89: -YY_RULE_SETUP -#line 164 "session_lexer.l" -{ return T_ACSE_VAL_RES; } - YY_BREAK -case 90: -YY_RULE_SETUP -#line 165 "session_lexer.l" -{ return T_DULP_STATE; } - YY_BREAK -case 91: -YY_RULE_SETUP -#line 166 "session_lexer.l" -{ return T_LOG_SCP_THREAD; } - YY_BREAK -case 92: -YY_RULE_SETUP -#line 167 "session_lexer.l" -{ return T_STORAGE_MODE; } - YY_BREAK -case 93: -YY_RULE_SETUP -#line 168 "session_lexer.l" -{ return T_DATA_DIRECTORY; } - YY_BREAK -case 94: -YY_RULE_SETUP -#line 169 "session_lexer.l" -{ return T_UN_VR_DEF_LOOKUP; } - YY_BREAK -case 95: -YY_RULE_SETUP -#line 170 "session_lexer.l" -{ return T_DEFINITION_DIRECTORY; } - YY_BREAK -case 96: -YY_RULE_SETUP -#line 171 "session_lexer.l" -{ return T_DEFINITION_ROOT; } - YY_BREAK -case 97: -YY_RULE_SETUP -#line 172 "session_lexer.l" -{ return T_DEFINITION; } - YY_BREAK -case 98: -YY_RULE_SETUP -#line 173 "session_lexer.l" -{ return T_DICOMSCRIPT_ROOT; } - YY_BREAK -case 99: -YY_RULE_SETUP -#line 174 "session_lexer.l" -{ return T_DICOMSCRIPT; } - YY_BREAK -case 100: -YY_RULE_SETUP -#line 175 "session_lexer.l" -{ return T_RESULTS_ROOT; } - YY_BREAK -case 101: -YY_RULE_SETUP -#line 176 "session_lexer.l" -{ return T_DESCRIPTION_DIRECTORY; } - YY_BREAK -case 102: -YY_RULE_SETUP -#line 177 "session_lexer.l" -{ return T_APPEND_TO_FILE; } - YY_BREAK -case 103: -YY_RULE_SETUP -#line 178 "session_lexer.l" -{ return T_INCLUDE_PATH; } - YY_BREAK -case 104: -YY_RULE_SETUP -#line 180 "session_lexer.l" -{ sessionlval.trueOrFalse = true; return TRUE_OR_FALSE; } - YY_BREAK -case 105: -YY_RULE_SETUP -#line 181 "session_lexer.l" -{ sessionlval.trueOrFalse = false; return TRUE_OR_FALSE; } - YY_BREAK -case 106: -YY_RULE_SETUP -#line 182 "session_lexer.l" -{ return LOG_LEVEL; } - YY_BREAK -case 107: -YY_RULE_SETUP -#line 183 "session_lexer.l" -{ return LOG_LEVEL; } - YY_BREAK -case 108: -YY_RULE_SETUP -#line 184 "session_lexer.l" -{ return LOG_LEVEL; } - YY_BREAK -case 109: -YY_RULE_SETUP -#line 185 "session_lexer.l" -{ return LOG_LEVEL; } - YY_BREAK -case 110: -YY_RULE_SETUP -#line 186 "session_lexer.l" -{ return LOG_LEVEL; } - YY_BREAK -case 111: -YY_RULE_SETUP -#line 187 "session_lexer.l" -{ return LOG_LEVEL; } - YY_BREAK -case 112: -YY_RULE_SETUP -#line 188 "session_lexer.l" -{ sessionlval.sessionType = ST_SCRIPT; return SESSION_TYPE; } - YY_BREAK -case 113: -YY_RULE_SETUP -#line 189 "session_lexer.l" -{ sessionlval.sessionType = ST_EMULATOR; return SESSION_TYPE; } - YY_BREAK -case 114: -YY_RULE_SETUP -#line 190 "session_lexer.l" -{ sessionlval.sessionType = ST_MEDIA; return SESSION_TYPE; } - YY_BREAK -case 115: -YY_RULE_SETUP -#line 191 "session_lexer.l" -{ sessionlval.sessionType = ST_SNIFFER; return SESSION_TYPE; } - YY_BREAK -case 116: -YY_RULE_SETUP -#line 192 "session_lexer.l" -{ sessionlval.storageMode = SM_NO_STORAGE; return STORAGE_MODE; } - YY_BREAK -case 117: -YY_RULE_SETUP -#line 193 "session_lexer.l" -{ sessionlval.storageMode = SM_AS_DATASET; return STORAGE_MODE; } - YY_BREAK -case 118: -YY_RULE_SETUP -#line 194 "session_lexer.l" -{ sessionlval.storageMode = SM_AS_MEDIA; return STORAGE_MODE; } - YY_BREAK -case 119: -YY_RULE_SETUP -#line 195 "session_lexer.l" -{ sessionlval.storageMode = SM_AS_MEDIA_ONLY; return STORAGE_MODE; } - YY_BREAK -case 120: -YY_RULE_SETUP -#line 196 "session_lexer.l" -{ sessionlval.sutRole = UP_ACCEPTOR_REQUESTOR; return SUT_ROLE; } - YY_BREAK -case 121: -YY_RULE_SETUP -#line 197 "session_lexer.l" -{ sessionlval.sutRole = UP_ACCEPTOR; return SUT_ROLE; } - YY_BREAK -case 122: -YY_RULE_SETUP -#line 198 "session_lexer.l" -{ sessionlval.sutRole = UP_REQUESTOR; return SUT_ROLE; } - YY_BREAK -case 123: -#line 201 "session_lexer.l" -case 124: -YY_RULE_SETUP -#line 201 "session_lexer.l" -{ sessionlval.integer = atoi(sessiontext); return INTEGER; } - YY_BREAK -case 125: -YY_RULE_SETUP -#line 203 "session_lexer.l" -{ for (sessionleng = sessionleng-2; sessionleng >= 0; sessionleng--) - /* concatenate line */ - unput(sessiontext[sessionleng]); - } - YY_BREAK -case 126: -YY_RULE_SETUP -#line 208 "session_lexer.l" -{ int i = 1, j = 0; - - memset(sessionlval.string, 0, sizeof(sessionlval.string)); - if ((sessionleng-2) >= sizeof(sessionlval.string)) - { - sessionerror("STRING too long - truncated!"); - sessionleng = sizeof(sessionlval.string) + 1; - } - - while (i < (sessionleng-1)) - { - sessionlval.string[j++] = sessiontext[i++]; - } - - sessionlval.string[j] = NULLCHAR; - return STRING; - } - YY_BREAK -case 127: -YY_RULE_SETUP -#line 226 "session_lexer.l" -{ return sessiontext[0]; } - YY_BREAK -case 128: -YY_RULE_SETUP -#line 227 "session_lexer.l" -ECHO; - YY_BREAK - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - sessiontext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed sessionin at a new source and called - * sessionlex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = sessionin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = sessiontext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = sessiontext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( sessionwrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * sessiontext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = sessiontext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - sessiontext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = sessiontext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = sessiontext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of sessionlex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = sessiontext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - sessiontext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a singled characater, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - sessiontext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - sessionrestart( sessionin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - sessiontext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - yy_current_state += YY_AT_BOL(); - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = sessiontext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1414 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - - register YY_CHAR yy_c = 1; - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 1414 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; - yy_is_jam = (yy_current_state == 1413); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void sessionunput( int c, register char *yy_bp ) -#else -static void sessionunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up sessiontext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - if ( c == '\n' ) - --sessionlineno; - - sessiontext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int sessioninput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - sessiontext_ptr = yy_c_buf_p; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - if ( sessionwrap() ) - { - yy_c_buf_p = - sessiontext_ptr + YY_MORE_ADJ; - return EOF; - } - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return sessioninput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = sessiontext_ptr + YY_MORE_ADJ; - break; - - case EOB_ACT_LAST_MATCH: -#ifdef __cplusplus - YY_FATAL_ERROR( - "unexpected last match in sessioninput()" ); -#else - YY_FATAL_ERROR( - "unexpected last match in input()" ); -#endif - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve sessiontext */ - yy_hold_char = *++yy_c_buf_p; - - yy_current_buffer->yy_at_bol = (c == '\n'); - if ( yy_current_buffer->yy_at_bol ) - ++sessionlineno; - - return c; - } - - -#ifdef YY_USE_PROTOS -void sessionrestart( FILE *input_file ) -#else -void sessionrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = session_create_buffer( sessionin, YY_BUF_SIZE ); - - session_init_buffer( yy_current_buffer, input_file ); - session_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void session_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void session_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - session_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (sessionwrap()) processing, but the only time this flag - * is looked at is after sessionwrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void session_load_buffer_state( void ) -#else -void session_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - sessiontext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - sessionin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE session_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE session_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in session_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in session_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - session_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void session_delete_buffer( YY_BUFFER_STATE b ) -#else -void session_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void session_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void session_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - session_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void session_flush_buffer( YY_BUFFER_STATE b ) -#else -void session_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - session_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE session_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE session_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in session_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - session_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE session_scan_string( yyconst char *str ) -#else -YY_BUFFER_STATE session_scan_string( str ) -yyconst char *str; -#endif - { - int len; - for ( len = 0; str[len]; ++len ) - ; - - return session_scan_bytes( str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE session_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE session_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in session_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = session_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in session_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up sessiontext. */ \ - sessiontext[sessionleng] = yy_hold_char; \ - yy_c_buf_p = sessiontext + n - YY_MORE_ADJ; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - sessionleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef sessiontext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - sessionlex(); - return 0; - } -#endif -#line 227 "session_lexer.l" - - -void sessionerror(char *yymsg) -{ - printf("\n%s %s during parse of s on line no: %d (near: \"%s\")", - VAL_PREFIX_ERROR, - yymsg, -// sessionfile.c_str(), - scriptlineno, - sessiontext); -} - diff --git a/DVTk_Library/Libraries/Session/session_parser.cpp b/DVTk_Library/Libraries/Session/session_parser.cpp deleted file mode 100644 index 338d3fa..0000000 --- a/DVTk_Library/Libraries/Session/session_parser.cpp +++ /dev/null @@ -1,1729 +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_MAX_TLS_VERSION 285 -#define T_MIN_TLS_VERSION 286 -#define T_CHECK_REMOTE_CERTIFICATE 287 -#define T_CIPHER_LIST 288 -#define T_CACHE_TLS_SESSIONS 289 -#define T_TLS_CACHE_TIMEOUT 290 -#define T_DELAY 291 -#define T_CREDENTIALS_FILENAME 292 -#define T_CERTIFICATE_FILENAME 293 -#define T_VAL_RES 294 -#define T_DIMSE_MSG 295 -#define T_ACSE_MSG 296 -#define T_PDU_DUMP 297 -#define T_LABEL_DUMP 298 -#define T_IMAGE_SAVE 299 -#define T_STORAGE_MODE 300 -#define T_DEF_SQ_LENGTH 301 -#define T_ADD_GROUP_LENGTH 302 -#define T_SUPPORTED_TRANSFER_SYNTAX 303 -#define T_FORMAT 304 -#define T_STRICT 305 -#define T_DATA_DIRECTORY 306 -#define T_UN_VR_DEF_LOOKUP 307 -#define T_AUTO_TYPE 308 -#define T_AUTO_CREATE 309 -#define T_DEFINITION_DIRECTORY 310 -#define T_DEFINITION_ROOT 311 -#define T_DEFINITION 312 -#define T_DICOMSCRIPT_ROOT 313 -#define T_DICOMSCRIPT 314 -#define T_LOG_ERROR 315 -#define T_LOG_WARNING 316 -#define T_LOG_INFO 317 -#define T_LOG_RELATION 318 -#define T_LOG_DEBUG 319 -#define T_LOG_ACSE 320 -#define T_LOG_DICOM 321 -#define T_LOG_SCP_THREAD 322 -#define T_DULP_STATE 323 -#define T_CONTINUE 324 -#define T_DICOM_VAL_RES 325 -#define T_ACSE_VAL_RES 326 -#define T_RESULTS_ROOT 327 -#define T_DESCRIPTION_DIRECTORY 328 -#define T_APPEND_TO_FILE 329 -#define T_INCLUDE_PATH 330 -#define TRUE_OR_FALSE 331 -#define INTEGER 332 -#define STRING 333 -#define LOG_LEVEL 334 -#define SESSION_TYPE 335 -#define STORAGE_MODE 336 -#define SUT_ROLE 337 -#define T_ENSURE_EVEN_ATTRIBUTE_VALUE_LENGTH 338 -#define T_SUT_AE 339 -#define T_SUT_MAX_LEN 340 -#define T_SUT_IMPL_CLASS 341 -#define T_SUT_IMPL_VER 342 -#define T_SUT_HOSTNAME 343 -#define T_SUT_PORT 344 -#define T_SUT_ROLE 345 -#define T_DVT_AE 346 -#define T_DVT_MAX_LEN 347 -#define T_DVT_IMPL_CLASS 348 -#define T_DVT_IMPL_VER 349 -#define T_DVT_PORT 350 -#define T_DVT_SOCKET_TIMEOUT 351 -#define T_DETAILED_RESULTS 352 -#define T_SUMMARY_RESULTS 353 -#define T_INCLUDE_TYPE3_NOTPRESENT 354 -#define T_DUMP_ATTR_REFFILE 355 -#define T_PRIVATE_MAPPING 356 - -#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 192 -#define YYFLAG -32768 -#define YYNTBASE 102 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 356 ? yytranslate[x] : 110) - -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, 100, 101 -}; - -#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, 287 -}; - -static const short yyrhs[] = { -1, - 103, 0, 104, 0, 103, 104, 0, 105, 0, 106, - 108, 107, 0, 3, 0, 4, 0, 109, 0, 108, - 109, 0, 5, 77, 0, 6, 80, 0, 7, 78, - 0, 8, 77, 0, 9, 78, 0, 10, 78, 0, - 11, 78, 0, 14, 78, 0, 15, 78, 0, 12, - 78, 0, 13, 78, 0, 16, 76, 0, 17, 76, - 0, 18, 78, 0, 19, 78, 0, 20, 77, 0, - 21, 78, 0, 22, 78, 0, 23, 78, 0, 24, - 77, 0, 25, 77, 0, 26, 77, 0, 27, 77, - 0, 84, 78, 0, 85, 77, 0, 86, 78, 0, - 87, 78, 0, 88, 78, 0, 89, 77, 0, 90, - 82, 0, 91, 78, 0, 92, 77, 0, 93, 78, - 0, 94, 78, 0, 95, 77, 0, 96, 77, 0, - 28, 76, 0, 30, 78, 0, 31, 78, 0, 32, - 76, 0, 33, 78, 0, 34, 76, 0, 35, 77, - 0, 36, 77, 0, 37, 78, 0, 38, 78, 0, - 39, 76, 0, 40, 76, 0, 41, 76, 0, 42, - 76, 0, 43, 76, 0, 44, 76, 0, 46, 76, - 0, 47, 76, 0, 69, 76, 0, 48, 78, 0, - 49, 76, 0, 45, 81, 0, 50, 76, 0, 97, - 76, 0, 98, 76, 0, 99, 76, 0, 100, 76, - 0, 101, 76, 0, 53, 76, 0, 54, 76, 0, - 83, 76, 0, 60, 76, 0, 61, 76, 0, 62, - 76, 0, 63, 76, 0, 64, 76, 0, 66, 79, - 0, 70, 79, 0, 65, 79, 0, 67, 76, 0, - 68, 76, 0, 71, 79, 0, 55, 78, 0, 51, - 78, 0, 52, 76, 0, 56, 78, 0, 57, 78, - 0, 58, 78, 0, 59, 78, 0, 72, 78, 0, - 73, 78, 0, 74, 76, 0, 75, 78, 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, 296, 307, 311, 315, 319, 323, 337, 341, 345, - 349, 353, 357, 361, 365, 369, 373, 377, 381, 385, - 389, 393, 397, 401, 405, 409, 413, 417, 421, 425, - 429, 433, 439, 467, 471, 482, 486, 490, 494 -}; - -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_MAX_TLS_VERSION","T_MIN_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, - 102, 102, 103, 103, 104, 105, 106, 107, 108, 108, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 109, 109 -}; - -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, 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, 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, 62, 68, 63, 64, 66, - 67, 69, 90, 91, 75, 76, 89, 92, 93, 94, - 95, 78, 79, 80, 81, 82, 85, 83, 86, 87, - 65, 84, 88, 96, 97, 98, 99, 77, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 70, 71, 72, 73, 74, 8, 6, 10, 0, - 0, 0 -}; - -static const short sessiondefgoto[] = { 190, - 2, 3, 4, 5, 188, 96, 97 -}; - -static const short sessionpact[] = { 22, --32768, 22,-32768,-32768, 93,-32768, -5, -7, -3, -1, - 0, 44, 91, 92, 94, 95, 96, -2, 1, 97, - 117, 119, 120, 121, 122, 124, 125, 126, 127, 129, - 128, 130, 131, 132, 133, 134, 135, 136, 137, 140, - 141, 142, 143, 144, 145, 90, 146, 147, 148, 149, - 151, 150, 153, 154, 155, 156, 157, 158, 159, 160, - 163, 164, 165, 166, 167, 118, 168, 169, 170, 172, - 171, 173, 175, 176, 179, 178, 181, 180, 174, 182, - 183, 184, 186, 162, 187, 189, 190, 191, 193, 194, - 188, 196, 197, 198, 199, -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,-32768, 213, - 224,-32768 -}; - -static const short sessionpgoto[] = {-32768, --32768, 230,-32768,-32768,-32768,-32768, 185 -}; - - -#define YYLAST 281 - - -static const short yytable[] = { 187, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 1, 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, 98, 99, 109, 100, 101, 110, 102, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 103, 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, 104, 105, - 137, 106, 107, 108, 111, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 112, 113, 157, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 124, 123, 126, 125, - 127, 128, 191, 129, 130, 131, 132, 133, 134, 135, - 136, 138, 139, 192, 141, 140, 142, 143, 144, 145, - 146, 6, 0, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 175, 159, 160, 158, 161, 0, 162, - 170, 163, 164, 165, 166, 167, 168, 169, 0, 171, - 172, 173, 174, 182, 176, 177, 0, 178, 179, 180, - 181, 183, 184, 185, 186, 0, 0, 0, 0, 0, - 189 -}; - -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, 3, 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, 77, 80, 76, 78, 77, 76, 78, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 78, 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, 78, 78, - 81, 78, 78, 78, 78, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 78, 77, 79, 78, 78, 78, - 77, 77, 77, 77, 76, 78, 76, 78, 76, 78, - 77, 77, 0, 78, 78, 76, 76, 76, 76, 76, - 76, 76, 76, 0, 76, 78, 76, 78, 76, 76, - 76, 2, -1, 78, 78, 78, 78, 78, 76, 76, - 76, 76, 76, 82, 76, 76, 79, 76, -1, 79, - 77, 79, 78, 78, 76, 78, 76, 78, -1, 78, - 78, 78, 77, 76, 78, 77, -1, 78, 78, 77, - 77, 76, 76, 76, 76, -1, -1, -1, -1, -1, - 96 -}; -/* -*-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->setMaxTlsVersion(sessionvsp[0].string); - ; - break;} -case 49: -#line 245 "session_parser.y" -{ - session_ptr->setMinTlsVersion(sessionvsp[0].string); - ; - break;} -case 50: -#line 249 "session_parser.y" -{ - session_ptr->setCheckRemoteCertificate(sessionvsp[0].trueOrFalse); - ; - break;} -case 51: -#line 253 "session_parser.y" -{ - session_ptr->setCipherList(sessionvsp[0].string); - ; - break;} -case 52: -#line 257 "session_parser.y" -{ - session_ptr->setCacheTlsSessions(sessionvsp[0].trueOrFalse); - ; - break;} -case 53: -#line 261 "session_parser.y" -{ - session_ptr->setTlsCacheTimeout(sessionvsp[0].integer); - ; - break;} -case 54: -#line 265 "session_parser.y" -{ - session_ptr->setDelayForStorageCommitment(sessionvsp[0].integer); - ; - break;} -case 55: -#line 269 "session_parser.y" -{ - session_ptr->setCredentialsFilename(sessionvsp[0].string); - ; - break;} -case 56: -#line 273 "session_parser.y" -{ - session_ptr->setCertificateFilename(sessionvsp[0].string); - ; - 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" -{ - // deprecated - ; - break;} -case 60: -#line 289 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_PDU_BYTES); - ; - break;} -case 61: -#line 293 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_LABEL); - ; - break;} -case 62: -#line 297 "session_parser.y" -{ - if (sessionvsp[0].trueOrFalse) - { - session_ptr->setStorageMode(SM_AS_MEDIA); - } - else - { - session_ptr->setStorageMode(SM_NO_STORAGE); - } - ; - break;} -case 63: -#line 308 "session_parser.y" -{ - session_ptr->setDefineSqLength(sessionvsp[0].trueOrFalse); - ; - break;} -case 64: -#line 312 "session_parser.y" -{ - session_ptr->setAddGroupLength(sessionvsp[0].trueOrFalse); - ; - break;} -case 65: -#line 316 "session_parser.y" -{ - session_ptr->setContinueOnError(sessionvsp[0].trueOrFalse); - ; - break;} -case 66: -#line 320 "session_parser.y" -{ - session_ptr->addSupportedTransferSyntax(sessionvsp[0].string); - ; - break;} -case 67: -#line 324 "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 68: -#line 338 "session_parser.y" -{ - session_ptr->setStorageMode(sessionvsp[0].storageMode); - ; - break;} -case 69: -#line 342 "session_parser.y" -{ - session_ptr->setStrictValidation(sessionvsp[0].trueOrFalse); - ; - break;} -case 70: -#line 346 "session_parser.y" -{ - session_ptr->setDetailedValidationResults(sessionvsp[0].trueOrFalse); - ; - break;} -case 71: -#line 350 "session_parser.y" -{ - session_ptr->setSummaryValidationResults(sessionvsp[0].trueOrFalse); - ; - break;} -case 72: -#line 354 "session_parser.y" -{ - session_ptr->setIncludeType3NotPresentInResults(sessionvsp[0].trueOrFalse); - ; - break;} -case 73: -#line 358 "session_parser.y" -{ - session_ptr->setDumpAttributesOfRefFiles(sessionvsp[0].trueOrFalse); - ; - break;} -case 74: -#line 362 "session_parser.y" -{ - BASE_SESSION_CLASS::setUsePrivateAttributeMapping(sessionvsp[0].trueOrFalse); - ; - break;} -case 75: -#line 366 "session_parser.y" -{ - session_ptr->setAutoType2Attributes(sessionvsp[0].trueOrFalse); - ; - break;} -case 76: -#line 370 "session_parser.y" -{ - session_ptr->setAutoCreateDirectory(sessionvsp[0].trueOrFalse); - ; - break;} -case 77: -#line 374 "session_parser.y" -{ - session_ptr->setEnsureEvenAttributeValueLength(sessionvsp[0].trueOrFalse); - ; - break;} -case 78: -#line 378 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_ERROR); - ; - break;} -case 79: -#line 382 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_WARNING); - ; - break;} -case 80: -#line 386 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_INFO); - ; - break;} -case 81: -#line 390 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_IMAGE_RELATION); - ; - break;} -case 82: -#line 394 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_DEBUG); - ; - 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" -{ - // deprecated - ; - break;} -case 86: -#line 410 "session_parser.y" -{ - session_ptr->setLogScpThread(sessionvsp[0].trueOrFalse); - ; - break;} -case 87: -#line 414 "session_parser.y" -{ - session_ptr->setLogLevel(sessionvsp[0].trueOrFalse, LOG_DULP_FSM); - ; - break;} -case 88: -#line 418 "session_parser.y" -{ - // deprecated - ; - break;} -case 89: -#line 422 "session_parser.y" -{ - session_ptr->addDefinitionDirectory(sessionvsp[0].string); - ; - break;} -case 90: -#line 426 "session_parser.y" -{ - session_ptr->setDataDirectory(sessionvsp[0].string); - ; - break;} -case 91: -#line 430 "session_parser.y" -{ - session_ptr->setUnVrDefinitionLookUp(sessionvsp[0].trueOrFalse); - ; - break;} -case 92: -#line 434 "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 93: -#line 440 "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 94: -#line 468 "session_parser.y" -{ - session_ptr->setDicomScriptRoot(sessionvsp[0].string); - ; - break;} -case 95: -#line 472 "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 96: -#line 483 "session_parser.y" -{ - session_ptr->setResultsRoot(sessionvsp[0].string); - ; - break;} -case 97: -#line 487 "session_parser.y" -{ - session_ptr->setDescriptionDirectory(sessionvsp[0].string); - ; - break;} -case 98: -#line 491 "session_parser.y" -{ - session_ptr->setAppendToResultsFile(sessionvsp[0].trueOrFalse); - ; - break;} -case 99: -#line 495 "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 499 "session_parser.y" - - - diff --git a/DVTk_Library/Libraries/Session/session_parser.cpp.h b/DVTk_Library/Libraries/Session/session_parser.cpp.h deleted file mode 100644 index c9a68c0..0000000 --- a/DVTk_Library/Libraries/Session/session_parser.cpp.h +++ /dev/null @@ -1,110 +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_MAX_TLS_VERSION 285 -#define T_MIN_TLS_VERSION 286 -#define T_CHECK_REMOTE_CERTIFICATE 287 -#define T_CIPHER_LIST 288 -#define T_CACHE_TLS_SESSIONS 289 -#define T_TLS_CACHE_TIMEOUT 290 -#define T_DELAY 291 -#define T_CREDENTIALS_FILENAME 292 -#define T_CERTIFICATE_FILENAME 293 -#define T_VAL_RES 294 -#define T_DIMSE_MSG 295 -#define T_ACSE_MSG 296 -#define T_PDU_DUMP 297 -#define T_LABEL_DUMP 298 -#define T_IMAGE_SAVE 299 -#define T_STORAGE_MODE 300 -#define T_DEF_SQ_LENGTH 301 -#define T_ADD_GROUP_LENGTH 302 -#define T_SUPPORTED_TRANSFER_SYNTAX 303 -#define T_FORMAT 304 -#define T_STRICT 305 -#define T_DATA_DIRECTORY 306 -#define T_UN_VR_DEF_LOOKUP 307 -#define T_AUTO_TYPE 308 -#define T_AUTO_CREATE 309 -#define T_DEFINITION_DIRECTORY 310 -#define T_DEFINITION_ROOT 311 -#define T_DEFINITION 312 -#define T_DICOMSCRIPT_ROOT 313 -#define T_DICOMSCRIPT 314 -#define T_LOG_ERROR 315 -#define T_LOG_WARNING 316 -#define T_LOG_INFO 317 -#define T_LOG_RELATION 318 -#define T_LOG_DEBUG 319 -#define T_LOG_ACSE 320 -#define T_LOG_DICOM 321 -#define T_LOG_SCP_THREAD 322 -#define T_DULP_STATE 323 -#define T_CONTINUE 324 -#define T_DICOM_VAL_RES 325 -#define T_ACSE_VAL_RES 326 -#define T_RESULTS_ROOT 327 -#define T_DESCRIPTION_DIRECTORY 328 -#define T_APPEND_TO_FILE 329 -#define T_INCLUDE_PATH 330 -#define TRUE_OR_FALSE 331 -#define INTEGER 332 -#define STRING 333 -#define LOG_LEVEL 334 -#define SESSION_TYPE 335 -#define STORAGE_MODE 336 -#define SUT_ROLE 337 -#define T_ENSURE_EVEN_ATTRIBUTE_VALUE_LENGTH 338 -#define T_SUT_AE 339 -#define T_SUT_MAX_LEN 340 -#define T_SUT_IMPL_CLASS 341 -#define T_SUT_IMPL_VER 342 -#define T_SUT_HOSTNAME 343 -#define T_SUT_PORT 344 -#define T_SUT_ROLE 345 -#define T_DVT_AE 346 -#define T_DVT_MAX_LEN 347 -#define T_DVT_IMPL_CLASS 348 -#define T_DVT_IMPL_VER 349 -#define T_DVT_PORT 350 -#define T_DVT_SOCKET_TIMEOUT 351 -#define T_DETAILED_RESULTS 352 -#define T_SUMMARY_RESULTS 353 -#define T_INCLUDE_TYPE3_NOTPRESENT 354 -#define T_DUMP_ATTR_REFFILE 355 -#define T_PRIVATE_MAPPING 356 - - -extern YYSTYPE sessionlval; From 6692ba134c5ac3c0fd0c522e9dabe10e0992a745 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Fri, 27 Feb 2026 13:51:50 +0100 Subject: [PATCH 03/13] Ignore auto generated lexer and parser cpp and h files --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 8a16d6d..0b72490 100644 --- a/.gitignore +++ b/.gitignore @@ -398,3 +398,11 @@ FodyWeavers.xsd *.sln.iml .vscode/ .editorconfig + +# Auto-generated lexer/parser outputs +**/*_lex.cpp +**/*_parse.cpp +**/*_parse.cpp.h +**/*_lexer.cpp +**/*_parser.cpp +**/*_parser.cpp.h From 42101c552d5d34194a45214ce2dbe0f76a2fe894 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Fri, 27 Feb 2026 13:52:55 +0100 Subject: [PATCH 04/13] README.md: Add chapter about auto generated lexer and parser cpp and h files --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index a6a73f9..c613f56 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,11 @@ Note that the DVTk library and DVTk based applications are **not** for clinical 5. Right click on the DICOM solution and click *Build*. +### Generated source files + +Some lexer/parser outputs are generated during toolchain runs (for example `*_lexer.cpp`, `*_parser.cpp`, `*_parser.cpp.h`, and `*_lex.cpp`, `*_parse.cpp`, `*_parse.cpp.h`). +These generated files are intentionally excluded via `.gitignore` and should not be committed. + ### Errors If you get error regarding *afx.h* (*Cannot open include file 'afx.h': No such file or directory.*), make sure to check Output tab in Visual Studio and locate the error related to afx.h. Make sure the file exists and the path is correct. If the file does not exist, download the correct MSVC version from Microsoft. From a680b005d3253318418b65a17cc3fca6779e2486 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Wed, 11 Mar 2026 10:14:24 +0100 Subject: [PATCH 05/13] Add creation of NuGet package which can be used by other projects --- .github/workflows/actions.vs2026.yml | 65 ++++++++++++++++++++++++++++ DvtkHighLevelInterface.nuspec | 29 +++++++++++++ NuGet.config.example | 14 ++++++ README.md | 18 ++++++++ 4 files changed, 126 insertions(+) create mode 100644 DvtkHighLevelInterface.nuspec create mode 100644 NuGet.config.example diff --git a/.github/workflows/actions.vs2026.yml b/.github/workflows/actions.vs2026.yml index 9698b8c..be5b33d 100644 --- a/.github/workflows/actions.vs2026.yml +++ b/.github/workflows/actions.vs2026.yml @@ -17,6 +17,9 @@ env: jobs: build: runs-on: windows-2025-vs2026 + permissions: + contents: read + packages: write steps: - name: Checkout source code @@ -143,6 +146,44 @@ jobs: # Importeer de VS Developer Environment voor x86 & cmd /c "call `"$env:VS_INSTALL_PATH\VC\Auxiliary\Build\vcvarsall.bat`" x86 -vcvars_ver=14.29 && msbuild Dicom.sln /t:Rebuild /p:Configuration=Release /p:Platform=x86 /m /fl /flp:LogFile=./staging/build-msbuild.log" + - name: Build NuGet package + shell: pwsh + run: | + $packageVersion = "${{ steps.gitversion.outputs.nuGetVersionV2 }}" + + if ([string]::IsNullOrWhiteSpace($packageVersion)) { + $packageVersion = "${{ steps.gitversion.outputs.majorMinorPatch }}" + } + + $requiredFiles = @( + ".\bin\Release\DVTK.dll", + ".\bin\Release\DvtkApplicationLayer.dll", + ".\bin\Release\DvtkCommonDataFormat.dll", + ".\bin\Release\DvtkComparator.dll", + ".\bin\Release\DvtkHighLevelInterface.dll", + ".\bin\Release\DvtkData.dll", + ".\bin\Release\DvtkDefinitionQueryLibrary.dll", + ".\bin\Release\DvtkDicomEmulators.dll", + ".\bin\Release\DvtkDicomUnicodeConversion.dll", + ".\bin\Release\DvtkHl7.dll", + ".\bin\Release\DvtkIheActors.dll", + ".\bin\Release\DvtkInformationEntity.dll", + ".\bin\Release\DVTKManagedCodeAdapter.dll", + ".\bin\Release\DvtkScriptSupport.dll" + ) + + foreach ($file in $requiredFiles) { + if (-not (Test-Path $file)) { + Write-Error "Required file for NuGet package not found: $file" + exit 1 + } + } + + nuget pack .\DvtkHighLevelInterface.nuspec ` + -Version $packageVersion ` + -OutputDirectory .\staging ` + -NoPackageAnalysis + - name: Build setup projects (devenv) id: vdproj continue-on-error: true @@ -427,6 +468,30 @@ jobs: exit 1 } + - name: Publish NuGet package to GitHub Packages + if: ${{ github.event_name != 'pull_request' }} + shell: pwsh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + $packages = Get-ChildItem -Path ".\staging" -Filter "*.nupkg" -File | + Where-Object { $_.Name -notlike "*.symbols.nupkg" } + + if ($packages.Count -eq 0) { + Write-Error "No NuGet packages found in .\staging to publish." + exit 1 + } + + $sourceUrl = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + + foreach ($package in $packages) { + Write-Host "Publishing $($package.Name) to GitHub Packages" + nuget push $package.FullName ` + -Source $sourceUrl ` + -ApiKey $env:GITHUB_TOKEN ` + -NonInteractive + } + - name: Publish build artifacts if: ${{ always() }} uses: actions/upload-artifact@v4 diff --git a/DvtkHighLevelInterface.nuspec b/DvtkHighLevelInterface.nuspec new file mode 100644 index 0000000..97eb41d --- /dev/null +++ b/DvtkHighLevelInterface.nuspec @@ -0,0 +1,29 @@ + + + + DvtkHighLevelInterface + 1.0.0 + DVTK Community + DVTK High Level Interface for DICOM + false + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NuGet.config.example b/NuGet.config.example new file mode 100644 index 0000000..2b3e10d --- /dev/null +++ b/NuGet.config.example @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index c613f56..6056e46 100644 --- a/README.md +++ b/README.md @@ -54,3 +54,21 @@ Set-ItemProperty -Path $registryPath -Name "EnableOutOfProcBuild" -Value 0 -Type The setup projects can only be built after all other projects have been successfully compiled. +## NuGet package + +The GitHub Actions workflow builds a NuGet package for `DvtkHighLevelInterface` and publishes it to GitHub Packages for the `dvtk-org` owner. + +Feed URL: + +```text +https://nuget.pkg.github.com/dvtk-org/index.json +``` + +Example consumer configuration is available in [NuGet.config.example](NuGet.config.example). The GitHub Packages feed requires authentication with a GitHub username and a Personal Access Token that has permission to read packages. + +After adding the feed, install the package by ID: + +```powershell +nuget install DvtkHighLevelInterface -Source https://nuget.pkg.github.com/dvtk-org/index.json +``` + From 5a56c9865b02aba89c038783343f87f5c072c65d Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Wed, 11 Mar 2026 10:58:41 +0100 Subject: [PATCH 06/13] Fix build error in step Publish NuGet package to GitHub Packages --- .github/workflows/actions.vs2026.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions.vs2026.yml b/.github/workflows/actions.vs2026.yml index be5b33d..a438b46 100644 --- a/.github/workflows/actions.vs2026.yml +++ b/.github/workflows/actions.vs2026.yml @@ -472,7 +472,8 @@ jobs: if: ${{ github.event_name != 'pull_request' }} shell: pwsh env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} + FORK_PUBLISHING_PAT: ${{ secrets.FORK_PUBLISHING_PAT }} run: | $packages = Get-ChildItem -Path ".\staging" -Filter "*.nupkg" -File | Where-Object { $_.Name -notlike "*.symbols.nupkg" } @@ -482,13 +483,27 @@ jobs: exit 1 } - $sourceUrl = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + # Determine which token to use + $token = $env:GITHUB_TOKEN + $sourceUrl = "https://nuget.pkg.github.com/dvtk-org/index.json" + + # For forks, check if a dedicated PAT secret is available + if ("${{ github.repository }}" -ne "dvtk-org/DVTk") { + if (-not [string]::IsNullOrEmpty($env:FORK_PUBLISHING_PAT)) { + $token = $env:FORK_PUBLISHING_PAT + Write-Host "Using FORK_PUBLISHING_PAT secret for fork publishing" + } else { + Write-Warning "⚠️ This is a fork and FORK_PUBLISHING_PAT is not set. Publishing will be skipped." + Write-Host "To enable publishing from forks, add a FORK_PUBLISHING_PAT secret to your fork's repository settings." + exit 0 + } + } foreach ($package in $packages) { Write-Host "Publishing $($package.Name) to GitHub Packages" nuget push $package.FullName ` -Source $sourceUrl ` - -ApiKey $env:GITHUB_TOKEN ` + -ApiKey $token ` -NonInteractive } From 8c391264dc1fb02b3f675e42bd58650914596342 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Wed, 11 Mar 2026 11:15:34 +0100 Subject: [PATCH 07/13] actions.vs2026.yml: Wrong source url --- .github/workflows/actions.vs2026.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.vs2026.yml b/.github/workflows/actions.vs2026.yml index a438b46..9b8efc3 100644 --- a/.github/workflows/actions.vs2026.yml +++ b/.github/workflows/actions.vs2026.yml @@ -485,7 +485,7 @@ jobs: # Determine which token to use $token = $env:GITHUB_TOKEN - $sourceUrl = "https://nuget.pkg.github.com/dvtk-org/index.json" + $sourceUrl = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" # For forks, check if a dedicated PAT secret is available if ("${{ github.repository }}" -ne "dvtk-org/DVTk") { From 7ee06e44ba9b071a29eaed52b23c6f9fb8da3f19 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Wed, 11 Mar 2026 13:14:32 +0100 Subject: [PATCH 08/13] actions.vs2026.yml: Try to fix 401 (Unauthorized) error --- .github/workflows/actions.vs2026.yml | 36 +++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/.github/workflows/actions.vs2026.yml b/.github/workflows/actions.vs2026.yml index 9b8efc3..dd7a34b 100644 --- a/.github/workflows/actions.vs2026.yml +++ b/.github/workflows/actions.vs2026.yml @@ -483,14 +483,18 @@ jobs: exit 1 } - # Determine which token to use + $isMainRepo = "${{ github.repository }}" -eq "dvtk-org/DVTk" $token = $env:GITHUB_TOKEN + $userName = "${{ github.actor }}" $sourceUrl = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - - # For forks, check if a dedicated PAT secret is available - if ("${{ github.repository }}" -ne "dvtk-org/DVTk") { + $sourceName = "github-packages" + $nugetConfigPath = Join-Path $env:RUNNER_TEMP "github-packages.nuget.config" + + # For forks, a PAT is required because GITHUB_TOKEN cannot publish to packages outside the workflow repository context. + if (-not $isMainRepo) { if (-not [string]::IsNullOrEmpty($env:FORK_PUBLISHING_PAT)) { $token = $env:FORK_PUBLISHING_PAT + $userName = "${{ github.repository_owner }}" Write-Host "Using FORK_PUBLISHING_PAT secret for fork publishing" } else { Write-Warning "⚠️ This is a fork and FORK_PUBLISHING_PAT is not set. Publishing will be skipped." @@ -499,14 +503,34 @@ jobs: } } + $configXml = ( + '', + '', + ' ', + ' ', + " ", + ' ', + ' ', + " <$sourceName>", + " ", + " ", + " ", + ' ', + '' + ) -join "`n" + + Set-Content -Path $nugetConfigPath -Value $configXml -Encoding UTF8 + foreach ($package in $packages) { Write-Host "Publishing $($package.Name) to GitHub Packages" nuget push $package.FullName ` - -Source $sourceUrl ` - -ApiKey $token ` + -Source $sourceName ` + -ConfigFile $nugetConfigPath ` -NonInteractive } + Remove-Item $nugetConfigPath -Force -ErrorAction SilentlyContinue + - name: Publish build artifacts if: ${{ always() }} uses: actions/upload-artifact@v4 From b75154eb5e6f8f78902830d76a62b73705ef9aaf Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Wed, 11 Mar 2026 13:32:58 +0100 Subject: [PATCH 09/13] actions.vs2026.yml: Fix ParserError: 35 | " ", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Unexpected token '$sourceName\" value=\"$sourceUrl\" />"' in expression or statement. --- .github/workflows/actions.vs2026.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/actions.vs2026.yml b/.github/workflows/actions.vs2026.yml index dd7a34b..2d8a139 100644 --- a/.github/workflows/actions.vs2026.yml +++ b/.github/workflows/actions.vs2026.yml @@ -508,13 +508,13 @@ jobs: '', ' ', ' ', - " ", + (' ' -f $sourceName, $sourceUrl), ' ', ' ', - " <$sourceName>", - " ", - " ", - " ", + (' <{0}>' -f $sourceName), + (' ' -f $userName), + (' ' -f $token), + (' ' -f $sourceName), ' ', '' ) -join "`n" From b3708f80f0963a1195b2e5fddae9f537d9d82bf0 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Wed, 11 Mar 2026 13:35:40 +0100 Subject: [PATCH 10/13] Move step "Publish NuGet package to GitHub Packages" right after step "Build NuGet package" to get feedback of failing build faster --- .github/workflows/actions.vs2026.yml | 126 +++++++++++++-------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/.github/workflows/actions.vs2026.yml b/.github/workflows/actions.vs2026.yml index 2d8a139..2989c2d 100644 --- a/.github/workflows/actions.vs2026.yml +++ b/.github/workflows/actions.vs2026.yml @@ -184,6 +184,69 @@ jobs: -OutputDirectory .\staging ` -NoPackageAnalysis + - name: Publish NuGet package to GitHub Packages + if: ${{ github.event_name != 'pull_request' }} + shell: pwsh + env: + GITHUB_TOKEN: ${{ github.token }} + FORK_PUBLISHING_PAT: ${{ secrets.FORK_PUBLISHING_PAT }} + run: | + $packages = Get-ChildItem -Path ".\staging" -Filter "*.nupkg" -File | + Where-Object { $_.Name -notlike "*.symbols.nupkg" } + + if ($packages.Count -eq 0) { + Write-Error "No NuGet packages found in .\staging to publish." + exit 1 + } + + $isMainRepo = "${{ github.repository }}" -eq "dvtk-org/DVTk" + $token = $env:GITHUB_TOKEN + $userName = "${{ github.actor }}" + $sourceUrl = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + $sourceName = "github-packages" + $nugetConfigPath = Join-Path $env:RUNNER_TEMP "github-packages.nuget.config" + + # For forks, a PAT is required because GITHUB_TOKEN cannot publish to packages outside the workflow repository context. + if (-not $isMainRepo) { + if (-not [string]::IsNullOrEmpty($env:FORK_PUBLISHING_PAT)) { + $token = $env:FORK_PUBLISHING_PAT + $userName = "${{ github.repository_owner }}" + Write-Host "Using FORK_PUBLISHING_PAT secret for fork publishing" + } else { + Write-Warning "⚠️ This is a fork and FORK_PUBLISHING_PAT is not set. Publishing will be skipped." + Write-Host "To enable publishing from forks, add a FORK_PUBLISHING_PAT secret to your fork's repository settings." + exit 0 + } + } + + $configXml = ( + '', + '', + ' ', + ' ', + (' ' -f $sourceName, $sourceUrl), + ' ', + ' ', + (' <{0}>' -f $sourceName), + (' ' -f $userName), + (' ' -f $token), + (' ' -f $sourceName), + ' ', + '' + ) -join "`n" + + Set-Content -Path $nugetConfigPath -Value $configXml -Encoding UTF8 + + foreach ($package in $packages) { + Write-Host "Publishing $($package.Name) to GitHub Packages" + nuget push $package.FullName ` + -Source $sourceName ` + -ConfigFile $nugetConfigPath ` + -NonInteractive + } + + Remove-Item $nugetConfigPath -Force -ErrorAction SilentlyContinue + - name: Build setup projects (devenv) id: vdproj continue-on-error: true @@ -468,69 +531,6 @@ jobs: exit 1 } - - name: Publish NuGet package to GitHub Packages - if: ${{ github.event_name != 'pull_request' }} - shell: pwsh - env: - GITHUB_TOKEN: ${{ github.token }} - FORK_PUBLISHING_PAT: ${{ secrets.FORK_PUBLISHING_PAT }} - run: | - $packages = Get-ChildItem -Path ".\staging" -Filter "*.nupkg" -File | - Where-Object { $_.Name -notlike "*.symbols.nupkg" } - - if ($packages.Count -eq 0) { - Write-Error "No NuGet packages found in .\staging to publish." - exit 1 - } - - $isMainRepo = "${{ github.repository }}" -eq "dvtk-org/DVTk" - $token = $env:GITHUB_TOKEN - $userName = "${{ github.actor }}" - $sourceUrl = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - $sourceName = "github-packages" - $nugetConfigPath = Join-Path $env:RUNNER_TEMP "github-packages.nuget.config" - - # For forks, a PAT is required because GITHUB_TOKEN cannot publish to packages outside the workflow repository context. - if (-not $isMainRepo) { - if (-not [string]::IsNullOrEmpty($env:FORK_PUBLISHING_PAT)) { - $token = $env:FORK_PUBLISHING_PAT - $userName = "${{ github.repository_owner }}" - Write-Host "Using FORK_PUBLISHING_PAT secret for fork publishing" - } else { - Write-Warning "⚠️ This is a fork and FORK_PUBLISHING_PAT is not set. Publishing will be skipped." - Write-Host "To enable publishing from forks, add a FORK_PUBLISHING_PAT secret to your fork's repository settings." - exit 0 - } - } - - $configXml = ( - '', - '', - ' ', - ' ', - (' ' -f $sourceName, $sourceUrl), - ' ', - ' ', - (' <{0}>' -f $sourceName), - (' ' -f $userName), - (' ' -f $token), - (' ' -f $sourceName), - ' ', - '' - ) -join "`n" - - Set-Content -Path $nugetConfigPath -Value $configXml -Encoding UTF8 - - foreach ($package in $packages) { - Write-Host "Publishing $($package.Name) to GitHub Packages" - nuget push $package.FullName ` - -Source $sourceName ` - -ConfigFile $nugetConfigPath ` - -NonInteractive - } - - Remove-Item $nugetConfigPath -Force -ErrorAction SilentlyContinue - - name: Publish build artifacts if: ${{ always() }} uses: actions/upload-artifact@v4 From 17ee67c8a9bb4b3fee2244f76c2f070879d73be7 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Wed, 11 Mar 2026 13:48:50 +0100 Subject: [PATCH 11/13] actions.vs2026.yml: Fix warning: WARNING: Please use the --api-key option when publishing to GitHub Packages --- .github/workflows/actions.vs2026.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/actions.vs2026.yml b/.github/workflows/actions.vs2026.yml index 2989c2d..4d180f2 100644 --- a/.github/workflows/actions.vs2026.yml +++ b/.github/workflows/actions.vs2026.yml @@ -242,6 +242,7 @@ jobs: nuget push $package.FullName ` -Source $sourceName ` -ConfigFile $nugetConfigPath ` + -ApiKey $token ` -NonInteractive } From 3aab8c169af58d80f99fbbf1c1706df193320951 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Thu, 12 Mar 2026 14:21:41 +0100 Subject: [PATCH 12/13] Revert commit: Move step "Publish NuGet package to GitHub Packages" right after step "Build NuGet package" to get feedback of failing build faster --- .github/workflows/actions.vs2026.yml | 128 +++++++++++++-------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/.github/workflows/actions.vs2026.yml b/.github/workflows/actions.vs2026.yml index 4d180f2..a72a10a 100644 --- a/.github/workflows/actions.vs2026.yml +++ b/.github/workflows/actions.vs2026.yml @@ -184,70 +184,6 @@ jobs: -OutputDirectory .\staging ` -NoPackageAnalysis - - name: Publish NuGet package to GitHub Packages - if: ${{ github.event_name != 'pull_request' }} - shell: pwsh - env: - GITHUB_TOKEN: ${{ github.token }} - FORK_PUBLISHING_PAT: ${{ secrets.FORK_PUBLISHING_PAT }} - run: | - $packages = Get-ChildItem -Path ".\staging" -Filter "*.nupkg" -File | - Where-Object { $_.Name -notlike "*.symbols.nupkg" } - - if ($packages.Count -eq 0) { - Write-Error "No NuGet packages found in .\staging to publish." - exit 1 - } - - $isMainRepo = "${{ github.repository }}" -eq "dvtk-org/DVTk" - $token = $env:GITHUB_TOKEN - $userName = "${{ github.actor }}" - $sourceUrl = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - $sourceName = "github-packages" - $nugetConfigPath = Join-Path $env:RUNNER_TEMP "github-packages.nuget.config" - - # For forks, a PAT is required because GITHUB_TOKEN cannot publish to packages outside the workflow repository context. - if (-not $isMainRepo) { - if (-not [string]::IsNullOrEmpty($env:FORK_PUBLISHING_PAT)) { - $token = $env:FORK_PUBLISHING_PAT - $userName = "${{ github.repository_owner }}" - Write-Host "Using FORK_PUBLISHING_PAT secret for fork publishing" - } else { - Write-Warning "⚠️ This is a fork and FORK_PUBLISHING_PAT is not set. Publishing will be skipped." - Write-Host "To enable publishing from forks, add a FORK_PUBLISHING_PAT secret to your fork's repository settings." - exit 0 - } - } - - $configXml = ( - '', - '', - ' ', - ' ', - (' ' -f $sourceName, $sourceUrl), - ' ', - ' ', - (' <{0}>' -f $sourceName), - (' ' -f $userName), - (' ' -f $token), - (' ' -f $sourceName), - ' ', - '' - ) -join "`n" - - Set-Content -Path $nugetConfigPath -Value $configXml -Encoding UTF8 - - foreach ($package in $packages) { - Write-Host "Publishing $($package.Name) to GitHub Packages" - nuget push $package.FullName ` - -Source $sourceName ` - -ConfigFile $nugetConfigPath ` - -ApiKey $token ` - -NonInteractive - } - - Remove-Item $nugetConfigPath -Force -ErrorAction SilentlyContinue - - name: Build setup projects (devenv) id: vdproj continue-on-error: true @@ -539,6 +475,70 @@ jobs: name: "${{ github.event.repository.name }}-Package-${{ steps.gitversion.outputs.majorMinorPatch }}.${{ steps.gitversion.outputs.preReleaseNumber }}.vs2026" path: ./staging + - name: Publish NuGet package to GitHub Packages + if: ${{ github.event_name != 'pull_request' }} + shell: pwsh + env: + GITHUB_TOKEN: ${{ github.token }} + FORK_PUBLISHING_PAT: ${{ secrets.FORK_PUBLISHING_PAT }} + run: | + $packages = Get-ChildItem -Path ".\staging" -Filter "*.nupkg" -File | + Where-Object { $_.Name -notlike "*.symbols.nupkg" } + + if ($packages.Count -eq 0) { + Write-Error "No NuGet packages found in .\staging to publish." + exit 1 + } + + $isMainRepo = "${{ github.repository }}" -eq "dvtk-org/DVTk" + $token = $env:GITHUB_TOKEN + $userName = "${{ github.actor }}" + $sourceUrl = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + $sourceName = "github-packages" + $nugetConfigPath = Join-Path $env:RUNNER_TEMP "github-packages.nuget.config" + + # For forks, a PAT is required because GITHUB_TOKEN cannot publish to packages outside the workflow repository context. + if (-not $isMainRepo) { + if (-not [string]::IsNullOrEmpty($env:FORK_PUBLISHING_PAT)) { + $token = $env:FORK_PUBLISHING_PAT + $userName = "${{ github.repository_owner }}" + Write-Host "Using FORK_PUBLISHING_PAT secret for fork publishing" + } else { + Write-Warning "⚠️ This is a fork and FORK_PUBLISHING_PAT is not set. Publishing will be skipped." + Write-Host "To enable publishing from forks, add a FORK_PUBLISHING_PAT secret to your fork's repository settings." + exit 0 + } + } + + $configXml = ( + '', + '', + ' ', + ' ', + (' ' -f $sourceName, $sourceUrl), + ' ', + ' ', + (' <{0}>' -f $sourceName), + (' ' -f $userName), + (' ' -f $token), + (' ' -f $sourceName), + ' ', + '' + ) -join "`n" + + Set-Content -Path $nugetConfigPath -Value $configXml -Encoding UTF8 + + foreach ($package in $packages) { + Write-Host "Publishing $($package.Name) to GitHub Packages" + nuget push $package.FullName ` + -Source $sourceName ` + -ConfigFile $nugetConfigPath ` + -ApiKey $token ` + -NonInteractive + } + + Remove-Item $nugetConfigPath -Force -ErrorAction SilentlyContinue + publish-test-results: runs-on: ubuntu-latest needs: build From 0060362bc4f3ddfebd69cd542b2535b184289db8 Mon Sep 17 00:00:00 2001 From: Bennert de Wijs Date: Thu, 12 Mar 2026 14:36:25 +0100 Subject: [PATCH 13/13] actions.vs2026.yml: Fix review comments => 2 spaces too much on ilne 163 --- .github/workflows/actions.vs2026.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.vs2026.yml b/.github/workflows/actions.vs2026.yml index a72a10a..4a012cd 100644 --- a/.github/workflows/actions.vs2026.yml +++ b/.github/workflows/actions.vs2026.yml @@ -160,7 +160,7 @@ jobs: ".\bin\Release\DvtkApplicationLayer.dll", ".\bin\Release\DvtkCommonDataFormat.dll", ".\bin\Release\DvtkComparator.dll", - ".\bin\Release\DvtkHighLevelInterface.dll", + ".\bin\Release\DvtkHighLevelInterface.dll", ".\bin\Release\DvtkData.dll", ".\bin\Release\DvtkDefinitionQueryLibrary.dll", ".\bin\Release\DvtkDicomEmulators.dll",