taskjuggler 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +280 -0
- data/README +31 -0
- data/Rakefile +20 -0
- data/benchmarks/UTF-8-Strings.rb +58 -0
- data/benchmarks/allocate.tjp +30 -0
- data/benchmarks/booking.tjp +62 -0
- data/benchmarks/depends.tjp +112 -0
- data/benchmarks/htmltaskreport.tjp +45 -0
- data/benchmarks/runbench.rb +24 -0
- data/bin/tj3 +3 -0
- data/bin/tj3man +3 -0
- data/doc/classes/AppConfig.html +808 -0
- data/doc/classes/Arguments.html +226 -0
- data/doc/classes/String.html +395 -0
- data/doc/classes/TaskJuggler.html +1358 -0
- data/doc/classes/TaskJuggler/Account.html +257 -0
- data/doc/classes/TaskJuggler/AccountScenario.html +218 -0
- data/doc/classes/TaskJuggler/Allocation.html +419 -0
- data/doc/classes/TaskJuggler/AllocationAttribute.html +291 -0
- data/doc/classes/TaskJuggler/AttributeBase.html +608 -0
- data/doc/classes/TaskJuggler/AttributeDefinition.html +259 -0
- data/doc/classes/TaskJuggler/Booking.html +307 -0
- data/doc/classes/TaskJuggler/BookingListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/BooleanAttribute.html +261 -0
- data/doc/classes/TaskJuggler/CSVFile.html +325 -0
- data/doc/classes/TaskJuggler/Charge.html +279 -0
- data/doc/classes/TaskJuggler/ChargeListAttribute.html +229 -0
- data/doc/classes/TaskJuggler/ChargeSet.html +440 -0
- data/doc/classes/TaskJuggler/ChargeSetListAttribute.html +276 -0
- data/doc/classes/TaskJuggler/ColumnTable.html +260 -0
- data/doc/classes/TaskJuggler/DateAttribute.html +194 -0
- data/doc/classes/TaskJuggler/DependencyListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/DurationAttribute.html +229 -0
- data/doc/classes/TaskJuggler/FixnumAttribute.html +194 -0
- data/doc/classes/TaskJuggler/FlagListAttribute.html +263 -0
- data/doc/classes/TaskJuggler/FloatAttribute.html +229 -0
- data/doc/classes/TaskJuggler/GanttChart.html +667 -0
- data/doc/classes/TaskJuggler/GanttContainer.html +441 -0
- data/doc/classes/TaskJuggler/GanttHeader.html +280 -0
- data/doc/classes/TaskJuggler/GanttHeaderScaleItem.html +245 -0
- data/doc/classes/TaskJuggler/GanttLine.html +398 -0
- data/doc/classes/TaskJuggler/GanttLoadStack.html +327 -0
- data/doc/classes/TaskJuggler/GanttMilestone.html +415 -0
- data/doc/classes/TaskJuggler/GanttRouter.html +425 -0
- data/doc/classes/TaskJuggler/GanttTaskBar.html +429 -0
- data/doc/classes/TaskJuggler/HTMLDocument.html +240 -0
- data/doc/classes/TaskJuggler/HTMLGraphics.html +231 -0
- data/doc/classes/TaskJuggler/Interval.html +552 -0
- data/doc/classes/TaskJuggler/IntervalListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/KeywordDocumentation.html +796 -0
- data/doc/classes/TaskJuggler/Limits.html +416 -0
- data/doc/classes/TaskJuggler/Limits/Limit.html +381 -0
- data/doc/classes/TaskJuggler/LimitsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/Log.html +613 -0
- data/doc/classes/TaskJuggler/LogicalAttribute.html +226 -0
- data/doc/classes/TaskJuggler/LogicalExpression.html +251 -0
- data/doc/classes/TaskJuggler/LogicalFlag.html +229 -0
- data/doc/classes/TaskJuggler/LogicalFunction.html +324 -0
- data/doc/classes/TaskJuggler/LogicalOperation.html +299 -0
- data/doc/classes/TaskJuggler/Macro.html +194 -0
- data/doc/classes/TaskJuggler/MacroParser.html +360 -0
- data/doc/classes/TaskJuggler/MacroTable.html +366 -0
- data/doc/classes/TaskJuggler/Message.html +281 -0
- data/doc/classes/TaskJuggler/MessageHandler.html +215 -0
- data/doc/classes/TaskJuggler/Project.html +1606 -0
- data/doc/classes/TaskJuggler/ProjectFileParser.html +412 -0
- data/doc/classes/TaskJuggler/PropertyList.html +597 -0
- data/doc/classes/TaskJuggler/PropertySet.html +1200 -0
- data/doc/classes/TaskJuggler/PropertyTreeNode.html +1449 -0
- data/doc/classes/TaskJuggler/Query.html +600 -0
- data/doc/classes/TaskJuggler/RealFormat.html +252 -0
- data/doc/classes/TaskJuggler/ReferenceAttribute.html +194 -0
- data/doc/classes/TaskJuggler/Report.html +528 -0
- data/doc/classes/TaskJuggler/ReportElement.html +1070 -0
- data/doc/classes/TaskJuggler/ReportTable.html +497 -0
- data/doc/classes/TaskJuggler/ReportTableCell.html +518 -0
- data/doc/classes/TaskJuggler/ReportTableColumn.html +364 -0
- data/doc/classes/TaskJuggler/ReportTableElement.html +644 -0
- data/doc/classes/TaskJuggler/ReportTableLegend.html +343 -0
- data/doc/classes/TaskJuggler/ReportTableLine.html +431 -0
- data/doc/classes/TaskJuggler/Resource.html +211 -0
- data/doc/classes/TaskJuggler/ResourceListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/ResourceListRE.html +249 -0
- data/doc/classes/TaskJuggler/ResourceScenario.html +1137 -0
- data/doc/classes/TaskJuggler/RichText.html +537 -0
- data/doc/classes/TaskJuggler/RichTextAttribute.html +229 -0
- data/doc/classes/TaskJuggler/RichTextDocument.html +418 -0
- data/doc/classes/TaskJuggler/RichTextElement.html +829 -0
- data/doc/classes/TaskJuggler/RichTextException.html +212 -0
- data/doc/classes/TaskJuggler/RichTextParser.html +317 -0
- data/doc/classes/TaskJuggler/RichTextProtocolExample.html +303 -0
- data/doc/classes/TaskJuggler/RichTextProtocolHandler.html +194 -0
- data/doc/classes/TaskJuggler/RichTextScanner.html +561 -0
- data/doc/classes/TaskJuggler/RichTextSnip.html +364 -0
- data/doc/classes/TaskJuggler/RichTextSyntaxRules.html +883 -0
- data/doc/classes/TaskJuggler/Scenario.html +163 -0
- data/doc/classes/TaskJuggler/ScenarioData.html +354 -0
- data/doc/classes/TaskJuggler/Scoreboard.html +638 -0
- data/doc/classes/TaskJuggler/Shift.html +255 -0
- data/doc/classes/TaskJuggler/ShiftAssignment.html +488 -0
- data/doc/classes/TaskJuggler/ShiftAssignments.html +715 -0
- data/doc/classes/TaskJuggler/ShiftAssignmentsAttribute.html +261 -0
- data/doc/classes/TaskJuggler/ShiftScenario.html +282 -0
- data/doc/classes/TaskJuggler/SourceFileInfo.html +247 -0
- data/doc/classes/TaskJuggler/StringAttribute.html +229 -0
- data/doc/classes/TaskJuggler/SymbolAttribute.html +194 -0
- data/doc/classes/TaskJuggler/SyntaxReference.html +516 -0
- data/doc/classes/TaskJuggler/TOCEntry.html +242 -0
- data/doc/classes/TaskJuggler/TableColumnDefinition.html +273 -0
- data/doc/classes/TaskJuggler/TableOfContents.html +256 -0
- data/doc/classes/TaskJuggler/Task.html +203 -0
- data/doc/classes/TaskJuggler/TaskDependency.html +251 -0
- data/doc/classes/TaskJuggler/TaskListAttribute.html +267 -0
- data/doc/classes/TaskJuggler/TaskListRE.html +250 -0
- data/doc/classes/TaskJuggler/TaskScenario.html +2206 -0
- data/doc/classes/TaskJuggler/TextParser.html +670 -0
- data/doc/classes/TaskJuggler/TextParser/Pattern.html +923 -0
- data/doc/classes/TaskJuggler/TextParser/Rule.html +779 -0
- data/doc/classes/TaskJuggler/TextParser/StackElement.html +267 -0
- data/doc/classes/TaskJuggler/TextParser/TextParserResultArray.html +212 -0
- data/doc/classes/TaskJuggler/TextParser/TokenDoc.html +221 -0
- data/doc/classes/TaskJuggler/TextScanner.html +708 -0
- data/doc/classes/TaskJuggler/TextScanner/BufferStreamHandle.html +355 -0
- data/doc/classes/TaskJuggler/TextScanner/FileStreamHandle.html +341 -0
- data/doc/classes/TaskJuggler/TextScanner/StreamHandle.html +260 -0
- data/doc/classes/TaskJuggler/TjException.html +185 -0
- data/doc/classes/TaskJuggler/TjTime.html +1845 -0
- data/doc/classes/TaskJuggler/TjpExample.html +310 -0
- data/doc/classes/TaskJuggler/TjpExportRE.html +329 -0
- data/doc/classes/TaskJuggler/TjpSyntaxRules.html +8928 -0
- data/doc/classes/TaskJuggler/UserManual.html +606 -0
- data/doc/classes/TaskJuggler/WorkingHours.html +582 -0
- data/doc/classes/TaskJuggler/WorkingHoursAttribute.html +284 -0
- data/doc/classes/TaskJuggler/XMLBlob.html +207 -0
- data/doc/classes/TaskJuggler/XMLComment.html +206 -0
- data/doc/classes/TaskJuggler/XMLDocument.html +293 -0
- data/doc/classes/TaskJuggler/XMLElement.html +341 -0
- data/doc/classes/TaskJuggler/XMLNamedText.html +174 -0
- data/doc/classes/TaskJuggler/XMLText.html +221 -0
- data/doc/files/COPYING.html +448 -0
- data/doc/files/README.html +134 -0
- data/doc/files/lib/AccountScenario_rb.html +116 -0
- data/doc/files/lib/Account_rb.html +118 -0
- data/doc/files/lib/Allocation_rb.html +118 -0
- data/doc/files/lib/AppConfig_rb.html +116 -0
- data/doc/files/lib/AttributeBase_rb.html +106 -0
- data/doc/files/lib/AttributeDefinition_rb.html +106 -0
- data/doc/files/lib/Attributes_rb.html +130 -0
- data/doc/files/lib/Booking_rb.html +106 -0
- data/doc/files/lib/ChargeSet_rb.html +116 -0
- data/doc/files/lib/Charge_rb.html +116 -0
- data/doc/files/lib/HTMLDocument_rb.html +116 -0
- data/doc/files/lib/Interval_rb.html +116 -0
- data/doc/files/lib/KeywordDocumentation_rb.html +122 -0
- data/doc/files/lib/Limits_rb.html +116 -0
- data/doc/files/lib/Log_rb.html +116 -0
- data/doc/files/lib/LogicalExpression_rb.html +122 -0
- data/doc/files/lib/LogicalFlag_rb.html +116 -0
- data/doc/files/lib/LogicalFunction_rb.html +116 -0
- data/doc/files/lib/LogicalOperation_rb.html +116 -0
- data/doc/files/lib/MacroParser_rb.html +118 -0
- data/doc/files/lib/MacroTable_rb.html +122 -0
- data/doc/files/lib/MessageHandler_rb.html +106 -0
- data/doc/files/lib/Message_rb.html +116 -0
- data/doc/files/lib/ProjectFileParser_rb.html +122 -0
- data/doc/files/lib/Project_rb.html +148 -0
- data/doc/files/lib/PropertyList_rb.html +106 -0
- data/doc/files/lib/PropertySet_rb.html +118 -0
- data/doc/files/lib/PropertyTreeNode_rb.html +106 -0
- data/doc/files/lib/Query_rb.html +116 -0
- data/doc/files/lib/RealFormat_rb.html +106 -0
- data/doc/files/lib/ResourceScenario_rb.html +116 -0
- data/doc/files/lib/Resource_rb.html +118 -0
- data/doc/files/lib/RichTextDocument_rb.html +120 -0
- data/doc/files/lib/RichTextElement_rb.html +120 -0
- data/doc/files/lib/RichTextParser_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolExample_rb.html +120 -0
- data/doc/files/lib/RichTextProtocolHandler_rb.html +106 -0
- data/doc/files/lib/RichTextScanner_rb.html +116 -0
- data/doc/files/lib/RichTextSnip_rb.html +118 -0
- data/doc/files/lib/RichTextSyntaxRules_rb.html +106 -0
- data/doc/files/lib/RichText_rb.html +118 -0
- data/doc/files/lib/ScenarioData_rb.html +118 -0
- data/doc/files/lib/Scenario_rb.html +116 -0
- data/doc/files/lib/Scoreboard_rb.html +106 -0
- data/doc/files/lib/ShiftAssignments_rb.html +116 -0
- data/doc/files/lib/ShiftScenario_rb.html +116 -0
- data/doc/files/lib/Shift_rb.html +118 -0
- data/doc/files/lib/SourceFileInfo_rb.html +106 -0
- data/doc/files/lib/SyntaxReference_rb.html +122 -0
- data/doc/files/lib/TOCEntry_rb.html +118 -0
- data/doc/files/lib/TableColumnDefinition_rb.html +106 -0
- data/doc/files/lib/TableOfContents_rb.html +118 -0
- data/doc/files/lib/TaskDependency_rb.html +106 -0
- data/doc/files/lib/TaskJuggler_rb.html +120 -0
- data/doc/files/lib/TaskScenario_rb.html +116 -0
- data/doc/files/lib/Task_rb.html +118 -0
- data/doc/files/lib/TextParser/Pattern_rb.html +116 -0
- data/doc/files/lib/TextParser/Rule_rb.html +106 -0
- data/doc/files/lib/TextParser/StackElement_rb.html +106 -0
- data/doc/files/lib/TextParser/TokenDoc_rb.html +106 -0
- data/doc/files/lib/TextParser_rb.html +124 -0
- data/doc/files/lib/TextScanner_rb.html +128 -0
- data/doc/files/lib/Tj3Config_rb.html +118 -0
- data/doc/files/lib/TjException_rb.html +106 -0
- data/doc/files/lib/TjTime_rb.html +118 -0
- data/doc/files/lib/TjpExample_rb.html +116 -0
- data/doc/files/lib/TjpSyntaxRules_rb.html +106 -0
- data/doc/files/lib/UTF8String_rb.html +132 -0
- data/doc/files/lib/UserManual_rb.html +124 -0
- data/doc/files/lib/WorkingHours_rb.html +116 -0
- data/doc/files/lib/XMLDocument_rb.html +116 -0
- data/doc/files/lib/XMLElement_rb.html +116 -0
- data/doc/files/lib/reports/CSVFile_rb.html +116 -0
- data/doc/files/lib/reports/ColumnTable_rb.html +116 -0
- data/doc/files/lib/reports/GanttChart_rb.html +122 -0
- data/doc/files/lib/reports/GanttContainer_rb.html +116 -0
- data/doc/files/lib/reports/GanttHeaderScaleItem_rb.html +106 -0
- data/doc/files/lib/reports/GanttHeader_rb.html +116 -0
- data/doc/files/lib/reports/GanttLine_rb.html +126 -0
- data/doc/files/lib/reports/GanttLoadStack_rb.html +116 -0
- data/doc/files/lib/reports/GanttMilestone_rb.html +116 -0
- data/doc/files/lib/reports/GanttRouter_rb.html +106 -0
- data/doc/files/lib/reports/GanttTaskBar_rb.html +116 -0
- data/doc/files/lib/reports/HTMLGraphics_rb.html +106 -0
- data/doc/files/lib/reports/ReportElement_rb.html +118 -0
- data/doc/files/lib/reports/ReportTableCell_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableColumn_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableElement_rb.html +122 -0
- data/doc/files/lib/reports/ReportTableLegend_rb.html +106 -0
- data/doc/files/lib/reports/ReportTableLine_rb.html +116 -0
- data/doc/files/lib/reports/ReportTable_rb.html +118 -0
- data/doc/files/lib/reports/Report_rb.html +126 -0
- data/doc/files/lib/reports/ResourceListRE_rb.html +122 -0
- data/doc/files/lib/reports/TaskListRE_rb.html +122 -0
- data/doc/files/lib/reports/TjpExportRE_rb.html +116 -0
- data/doc/files/lib/taskjuggler3_rb.html +276 -0
- data/doc/files/lib/tj3man_rb.html +189 -0
- data/doc/fr_class_index.html +285 -0
- data/doc/fr_file_index.html +223 -0
- data/doc/fr_method_index.html +1953 -0
- data/doc/index.html +21 -0
- data/doc/rdoc-style.css +299 -0
- data/examples/tutorial.tjp +361 -0
- data/gem_spec.rb +30 -0
- data/lib/Account.rb +50 -0
- data/lib/AccountScenario.rb +39 -0
- data/lib/Allocation.rb +102 -0
- data/lib/AppConfig.rb +134 -0
- data/lib/AttributeBase.rb +131 -0
- data/lib/AttributeDefinition.rb +47 -0
- data/lib/Attributes.rb +478 -0
- data/lib/BatchProcessor.rb +209 -0
- data/lib/Booking.rb +59 -0
- data/lib/Charge.rb +71 -0
- data/lib/ChargeSet.rb +126 -0
- data/lib/HTMLDocument.rb +59 -0
- data/lib/Interval.rb +127 -0
- data/lib/KeywordDocumentation.rb +560 -0
- data/lib/Limits.rb +219 -0
- data/lib/Log.rb +160 -0
- data/lib/LogicalExpression.rb +71 -0
- data/lib/LogicalFlag.rb +34 -0
- data/lib/LogicalFunction.rb +102 -0
- data/lib/LogicalOperation.rb +118 -0
- data/lib/MacroParser.rb +77 -0
- data/lib/MacroTable.rb +84 -0
- data/lib/Message.rb +56 -0
- data/lib/MessageHandler.rb +34 -0
- data/lib/Project.rb +662 -0
- data/lib/ProjectFileParser.rb +333 -0
- data/lib/PropertyList.rb +181 -0
- data/lib/PropertySet.rb +304 -0
- data/lib/PropertyTreeNode.rb +461 -0
- data/lib/Query.rb +227 -0
- data/lib/RealFormat.rb +73 -0
- data/lib/Resource.rb +42 -0
- data/lib/ResourceScenario.rb +511 -0
- data/lib/RichText.rb +147 -0
- data/lib/RichTextDocument.rb +139 -0
- data/lib/RichTextElement.rb +391 -0
- data/lib/RichTextParser.rb +66 -0
- data/lib/RichTextProtocolExample.rb +65 -0
- data/lib/RichTextProtocolHandler.rb +35 -0
- data/lib/RichTextScanner.rb +390 -0
- data/lib/RichTextSnip.rb +104 -0
- data/lib/RichTextSyntaxRules.rb +265 -0
- data/lib/Scenario.rb +27 -0
- data/lib/ScenarioData.rb +65 -0
- data/lib/Scoreboard.rb +141 -0
- data/lib/Shift.rb +48 -0
- data/lib/ShiftAssignments.rb +291 -0
- data/lib/ShiftScenario.rb +46 -0
- data/lib/SourceFileInfo.rb +37 -0
- data/lib/SyntaxReference.rb +284 -0
- data/lib/TOCEntry.rb +76 -0
- data/lib/TableColumnDefinition.rb +54 -0
- data/lib/TableOfContents.rb +46 -0
- data/lib/Task.rb +37 -0
- data/lib/TaskDependency.rb +39 -0
- data/lib/TaskJuggler.rb +84 -0
- data/lib/TaskScenario.rb +1622 -0
- data/lib/TextParser.rb +416 -0
- data/lib/TextParser/Pattern.rb +263 -0
- data/lib/TextParser/Rule.rb +171 -0
- data/lib/TextParser/StackElement.rb +45 -0
- data/lib/TextParser/TokenDoc.rb +38 -0
- data/lib/TextScanner.rb +682 -0
- data/lib/Tj3Config.rb +27 -0
- data/lib/TjException.rb +27 -0
- data/lib/TjTime.rb +395 -0
- data/lib/TjpExample.rb +119 -0
- data/lib/TjpSyntaxRules.rb +4022 -0
- data/lib/UTF8String.rb +100 -0
- data/lib/UserManual.rb +282 -0
- data/lib/WorkingHours.rb +323 -0
- data/lib/XMLDocument.rb +54 -0
- data/lib/XMLElement.rb +175 -0
- data/lib/reports/CSVFile.rb +146 -0
- data/lib/reports/ColumnTable.rb +66 -0
- data/lib/reports/GanttChart.rb +308 -0
- data/lib/reports/GanttContainer.rb +107 -0
- data/lib/reports/GanttHeader.rb +141 -0
- data/lib/reports/GanttHeaderScaleItem.rb +42 -0
- data/lib/reports/GanttLine.rb +329 -0
- data/lib/reports/GanttLoadStack.rb +113 -0
- data/lib/reports/GanttMilestone.rb +80 -0
- data/lib/reports/GanttRouter.rb +375 -0
- data/lib/reports/GanttTaskBar.rb +95 -0
- data/lib/reports/HTMLGraphics.rb +65 -0
- data/lib/reports/Report.rb +344 -0
- data/lib/reports/ReportElement.rb +427 -0
- data/lib/reports/ReportTable.rb +144 -0
- data/lib/reports/ReportTableCell.rb +142 -0
- data/lib/reports/ReportTableColumn.rb +82 -0
- data/lib/reports/ReportTableElement.rb +852 -0
- data/lib/reports/ReportTableLegend.rb +167 -0
- data/lib/reports/ReportTableLine.rb +87 -0
- data/lib/reports/ResourceListRE.rb +72 -0
- data/lib/reports/TaskListRE.rb +73 -0
- data/lib/reports/TjpExportRE.rb +394 -0
- data/lib/taskjuggler3.rb +106 -0
- data/lib/tj3man.rb +88 -0
- data/manual/Day_To_Day_Juggling +168 -0
- data/manual/Getting_Started +61 -0
- data/manual/How_To_Contribute +185 -0
- data/manual/Installation +68 -0
- data/manual/Intro +102 -0
- data/manual/Reporting_Bugs +26 -0
- data/manual/Rich_Text_Attributes +90 -0
- data/manual/TaskJuggler_2x_Migration +40 -0
- data/manual/Tutorial +579 -0
- data/manual/fdl +450 -0
- data/prj_cfg.rb +43 -0
- data/setup.rb +1585 -0
- data/tasks/csts.rake +72 -0
- data/tasks/gem.rake +14 -0
- data/tasks/manual.rake +10 -0
- data/tasks/missing.rake +21 -0
- data/tasks/rcov.rake +14 -0
- data/tasks/rdoc.rake +17 -0
- data/tasks/rexml_fix.rb +16 -0
- data/tasks/rexml_fix_19.rb +49 -0
- data/tasks/show.rake +21 -0
- data/tasks/stats.rake +25 -0
- data/tasks/test.rake +11 -0
- data/test/MessageChecker.rb +53 -0
- data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/celltext.tjp +7 -0
- data/test/TestSuite/CSV-Reports/genrefs +6 -0
- data/test/TestSuite/CSV-Reports/project-1.tji +57 -0
- data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -0
- data/test/TestSuite/CSV-Reports/resourcereport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -0
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks.tjp +11 -0
- data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortByTree.tjp +8 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_duration.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_effort.up.tjp +10 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -0
- data/test/TestSuite/CSV-Reports/taskreport.tjp +10 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +24 -0
- data/test/TestSuite/CSV-Reports/taskreport_with_resources.tjp +11 -0
- data/test/TestSuite/Scheduler/Correct/Allocate.tjp +86 -0
- data/test/TestSuite/Scheduler/Correct/AutomaticMilestones.tjp +63 -0
- data/test/TestSuite/Scheduler/Correct/Booking.tjp +161 -0
- data/test/TestSuite/Scheduler/Correct/Depends.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Duration.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/InheritStartEnd.tjp +129 -0
- data/test/TestSuite/Scheduler/Correct/Limits.tjp +81 -0
- data/test/TestSuite/Scheduler/Correct/MultipleMandatories.tjp +43 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-1.tjp +28 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-2.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-3.tjp +33 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-4.tjp +34 -0
- data/test/TestSuite/Scheduler/Correct/Optimize-5.tjp +62 -0
- data/test/TestSuite/Scheduler/Correct/Precedes.tjp +50 -0
- data/test/TestSuite/Scheduler/Correct/Shift.tjp +102 -0
- data/test/TestSuite/Scheduler/Errors/account_no_leaf.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/booking_conflict.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/booking_no_duty.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/booking_on_vacation.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/container_booking.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/container_duration.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/effort_no_allocations.tjp +7 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_1.tjp +19 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_10.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_11.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_12.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_13.tjp +27 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_14.tjp +26 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_2.tjp +24 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_3.tjp +18 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_4.tjp +36 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_5.tjp +37 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_6.tjp +35 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_7.tjp +46 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_8.tjp +51 -0
- data/test/TestSuite/Scheduler/Errors/loop_detected_9.tjp +20 -0
- data/test/TestSuite/Scheduler/Errors/maxend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/maxstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_booking.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/milestone_duration.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/milestone_start_end.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minend.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/minstart.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/multiple_durations.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/no_tasks.tjp +6 -0
- data/test/TestSuite/Scheduler/Errors/not_scheduled.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_child.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_multi.tjp +13 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_parent.tjp +11 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_self.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_depend_unknown.tjp +10 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_1.tjp +9 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_2.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_overspecified_3.tjp +14 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_1.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_2.tjp +8 -0
- data/test/TestSuite/Scheduler/Errors/task_underspecified_3.tjp +9 -0
- data/test/TestSuite/Syntax/Correct/Account.tjp +53 -0
- data/test/TestSuite/Syntax/Correct/Allocate-1.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/Alternative.tjp +13 -0
- data/test/TestSuite/Syntax/Correct/AutoMacros.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Booking.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Caption.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Celltext.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Comments.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Complete.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/CompletedWork.tji +20 -0
- data/test/TestSuite/Syntax/Correct/CriticalPath.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Currencyformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/CustomAttributes.tjp +14 -0
- data/test/TestSuite/Syntax/Correct/Depends1.tjp +22 -0
- data/test/TestSuite/Syntax/Correct/Durations.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Efficiency.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Export.tjp +40 -0
- data/test/TestSuite/Syntax/Correct/Flags.tjp +32 -0
- data/test/TestSuite/Syntax/Correct/Freeze.tjp +28 -0
- data/test/TestSuite/Syntax/Correct/Gap.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/HtmlTaskReport.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/Limits-1.tjp +71 -0
- data/test/TestSuite/Syntax/Correct/LoadUnits.tjp +31 -0
- data/test/TestSuite/Syntax/Correct/Macro-1.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Mandatory.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Milestone.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/MinMax.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Numberformat.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Period.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Persistent.tjp +11 -0
- data/test/TestSuite/Syntax/Correct/Precedes1.tjp +17 -0
- data/test/TestSuite/Syntax/Correct/Priority.tjp +30 -0
- data/test/TestSuite/Syntax/Correct/Project.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/ProjectIDs.tjp +23 -0
- data/test/TestSuite/Syntax/Correct/RawHTML.tjp +29 -0
- data/test/TestSuite/Syntax/Correct/Reports.tjp +54 -0
- data/test/TestSuite/Syntax/Correct/Resource.tjp +20 -0
- data/test/TestSuite/Syntax/Correct/Responsible.tjp +16 -0
- data/test/TestSuite/Syntax/Correct/Scenario.tjp +15 -0
- data/test/TestSuite/Syntax/Correct/Scheduling.tjp +26 -0
- data/test/TestSuite/Syntax/Correct/Select.tjp +27 -0
- data/test/TestSuite/Syntax/Correct/Shift.tjp +55 -0
- data/test/TestSuite/Syntax/Correct/Simple.tjp +25 -0
- data/test/TestSuite/Syntax/Correct/String.tjp +12 -0
- data/test/TestSuite/Syntax/Correct/Supplement.tjp +24 -0
- data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +34 -0
- data/test/TestSuite/Syntax/Correct/TimeFrame.tjp +19 -0
- data/test/TestSuite/Syntax/Correct/Timezone.tjp +8 -0
- data/test/TestSuite/Syntax/Correct/Vacation.tjp +33 -0
- data/test/TestSuite/Syntax/Correct/csvtest +16 -0
- data/test/TestSuite/Syntax/Correct/manual2example.rb +24 -0
- data/test/TestSuite/Syntax/Correct/tutorial.tjp +485 -0
- data/test/TestSuite/Syntax/Errors/bad_include.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/booking_group.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/booking_milestone.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/booking_no_leaf.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/chargeset.tjp +14 -0
- data/test/TestSuite/Syntax/Errors/chargeset_master.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/container_attribute.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/cost_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/cost_rev_same.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/date_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/effort_zero.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/empty.tjp +1 -0
- data/test/TestSuite/Syntax/Errors/export_bad_extn.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/extend_id_cap.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_end_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/interval_start_in_range.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/leaf_resource_id_expected.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/misaligned_date.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/no_csv_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/no_html_suffix.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/operand_attribute.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_flag.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/operand_unkn_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/overtime_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/purge_no_list.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/purge_unknown_id.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/report_end.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_redifinition.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/report_start.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/resource_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/resource_id_expected.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/rev_acct_no_top.tjp +24 -0
- data/test/TestSuite/Syntax/Errors/scenario_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_assignment_overlap.tjp +15 -0
- data/test/TestSuite/Syntax/Errors/shift_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/shift_id_expected.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/sloppy_range.tjp +13 -0
- data/test/TestSuite/Syntax/Errors/sort_direction.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sort_unknown_scen.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd1.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_crit_exptd2.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/sorting_wbs.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/start_before_end1.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/start_before_end2.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/task_complete.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_exists.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/task_priority.tjp +8 -0
- data/test/TestSuite/Syntax/Errors/task_without_chargeset.tjp +9 -0
- data/test/TestSuite/Syntax/Errors/time_interval.tjp +12 -0
- data/test/TestSuite/Syntax/Errors/too_many_bangs.tjp +10 -0
- data/test/TestSuite/Syntax/Errors/undecl_flag.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_projectid.tjp +7 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_id.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unknown_scenario_idx.tjp +11 -0
- data/test/TestSuite/Syntax/Errors/unknown_task.tjp +10 -0
- data/test/all.rb +31 -0
- data/test/test_BatchProcessor.rb +54 -0
- data/test/test_CSV-Reports.rb +101 -0
- data/test/test_Limits.rb +104 -0
- data/test/test_LogicalExpression.rb +110 -0
- data/test/test_MacroTable.rb +51 -0
- data/test/test_Project.rb +57 -0
- data/test/test_PropertySet.rb +71 -0
- data/test/test_Query.rb +83 -0
- data/test/test_RealFormat.rb +83 -0
- data/test/test_RichText.rb +869 -0
- data/test/test_Scheduler.rb +42 -0
- data/test/test_ShiftAssignments.rb +77 -0
- data/test/test_Syntax.rb +41 -0
- data/test/test_TextScanner.rb +95 -0
- data/test/test_TjTime.rb +114 -0
- data/test/test_TjpExample.rb +169 -0
- data/test/test_UTF8String.rb +84 -0
- data/test/test_WorkingHours.rb +56 -0
- metadata +649 -0
@@ -0,0 +1,333 @@
|
|
1
|
+
#!/usr/bin/env ruby -w
|
2
|
+
# encoding: UTF-8
|
3
|
+
#
|
4
|
+
# = ProjectFileParser.rb -- The TaskJuggler III Project Management Software
|
5
|
+
#
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
7
|
+
#
|
8
|
+
# This program is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of version 2 of the GNU General Public License as
|
10
|
+
# published by the Free Software Foundation.
|
11
|
+
#
|
12
|
+
|
13
|
+
require 'TextParser'
|
14
|
+
require 'TextScanner'
|
15
|
+
require 'TjpSyntaxRules'
|
16
|
+
require 'RichText'
|
17
|
+
|
18
|
+
class TaskJuggler
|
19
|
+
|
20
|
+
# This class specializes the TextParser class for use with TaskJuggler project
|
21
|
+
# files (TJP Files). The primary purpose is to provide functionality that make
|
22
|
+
# it more comfortable to define the TaskJuggler syntax in a form that is human
|
23
|
+
# creatable but also powerful enough to define the data structures the parser
|
24
|
+
# needs to understand the syntax.
|
25
|
+
#
|
26
|
+
# By adding some additional information to the syntax rules, we can also
|
27
|
+
# generate the complete reference manual from this rule set.
|
28
|
+
class ProjectFileParser < TextParser
|
29
|
+
|
30
|
+
include TjpSyntaxRules
|
31
|
+
|
32
|
+
# Create the parser object. _messageHandler_ is a TjMessageHandler that is
|
33
|
+
# used for error reporting.
|
34
|
+
def initialize(messageHandler)
|
35
|
+
super()
|
36
|
+
|
37
|
+
@messageHandler = messageHandler
|
38
|
+
# Define the token types that the TextScanner may return for variable
|
39
|
+
# elements.
|
40
|
+
@variables = %w( INTEGER FLOAT DATE TIME STRING LITERAL ID ID_WITH_COLON
|
41
|
+
RELATIVE_ID ABSOLUTE_ID MACRO )
|
42
|
+
|
43
|
+
initRules
|
44
|
+
|
45
|
+
@project = nil
|
46
|
+
end
|
47
|
+
|
48
|
+
# Call this function with the master file to start processing a TJP file or
|
49
|
+
# a set of TJP files.
|
50
|
+
def open(masterFile)
|
51
|
+
begin
|
52
|
+
@scanner = TextScanner.new(masterFile, @messageHandler)
|
53
|
+
@scanner.open
|
54
|
+
rescue StandardError
|
55
|
+
error('file_open', $!.message)
|
56
|
+
end
|
57
|
+
|
58
|
+
@property = @report = nil
|
59
|
+
@scenarioIdx = 0
|
60
|
+
initFileStack
|
61
|
+
end
|
62
|
+
|
63
|
+
# Call this function to cleanup the parser structures after the file
|
64
|
+
# processing has been completed.
|
65
|
+
def close
|
66
|
+
res = @scanner.close
|
67
|
+
res
|
68
|
+
end
|
69
|
+
|
70
|
+
# This function will deliver the next token from the scanner. A token is a
|
71
|
+
# two element Array that contains the ID or type of the token as well as the
|
72
|
+
# text string of the token.
|
73
|
+
def nextToken
|
74
|
+
@scanner.nextToken
|
75
|
+
end
|
76
|
+
|
77
|
+
# This function can be used to return tokens. Returned tokens will be pushed
|
78
|
+
# on a LIFO stack. To preserve the order of the original tokens the last
|
79
|
+
# token must be returned first. This mechanism is used to implement
|
80
|
+
# look-ahead functionality.
|
81
|
+
def returnToken(token)
|
82
|
+
@scanner.returnToken(token)
|
83
|
+
end
|
84
|
+
|
85
|
+
# A set of standard marcros is defined in all files as soon as the project
|
86
|
+
# header has been read. Calling this functions gets the values from @project
|
87
|
+
# and inserts the Macro objects into the TextScanner.
|
88
|
+
def setGlobalMacros
|
89
|
+
@scanner.addMacro(Macro.new('projectstart', @project['start'].to_s,
|
90
|
+
@scanner.sourceFileInfo))
|
91
|
+
@scanner.addMacro(Macro.new('projectend', @project['end'].to_s,
|
92
|
+
@scanner.sourceFileInfo))
|
93
|
+
@scanner.addMacro(Macro.new('now', @project['now'].to_s,
|
94
|
+
@scanner.sourceFileInfo))
|
95
|
+
end
|
96
|
+
|
97
|
+
private
|
98
|
+
|
99
|
+
# Utility function that convers English weekday names into their index
|
100
|
+
# number and does some error checking. It returns 0 for 'sun', 1 for 'mon'
|
101
|
+
# and so on.
|
102
|
+
def weekDay(name)
|
103
|
+
names = %w( sun mon tue wed thu fri sat )
|
104
|
+
if (day = names.index(@val[0])).nil?
|
105
|
+
error('weekday', "Weekday name expected (#{names.join(', ')})")
|
106
|
+
end
|
107
|
+
day
|
108
|
+
end
|
109
|
+
|
110
|
+
# Make sure that certain attributes are not used after sub properties have
|
111
|
+
# been added to a property.
|
112
|
+
def checkContainer(attribute)
|
113
|
+
if @property.container?
|
114
|
+
error('container_attribute',
|
115
|
+
"The attribute #{attribute} may not be used for this property " +
|
116
|
+
'after sub properties have been added.')
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# Convenience function to check that an Interval fits completely within the
|
121
|
+
# project time frame.
|
122
|
+
def checkInterval(iv)
|
123
|
+
# Make sure the interval is within the project time frame.
|
124
|
+
if iv.start < @project['start'] || iv.start >= @project['end']
|
125
|
+
error('interval_start_in_range',
|
126
|
+
"Start date #{iv.start} must be within the project time frame")
|
127
|
+
end
|
128
|
+
if iv.end <= @project['start'] || iv.end > @project['end']
|
129
|
+
error('interval_end_in_range',
|
130
|
+
"End date #{iv.end} must be within the project time frame")
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# Convenience function to check the integrity of a booking statement.
|
135
|
+
def checkBooking(task, resource)
|
136
|
+
unless task.leaf?
|
137
|
+
error('booking_no_leaf', "#{task.fullId} is not a leaf task")
|
138
|
+
end
|
139
|
+
if task['milestone', @scenarioIdx]
|
140
|
+
error('booking_milestone', "You cannot add bookings to a milestone")
|
141
|
+
end
|
142
|
+
unless resource.leaf?
|
143
|
+
error('booking_group', "You cannot book a group resource")
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
# The TaskJuggler syntax can be extended by the user when the properties are
|
148
|
+
# extended with user-defined attributes. These attribute definitions
|
149
|
+
# introduce keywords that have to be processed like the build-in keywords.
|
150
|
+
# The parser therefor needs to adapt on the fly to the new syntax. By
|
151
|
+
# calling this function, a TaskJuggler property can be extended with a new
|
152
|
+
# attribute. @propertySet determines what property should be extended.
|
153
|
+
# _type_ is the attribute type, _default_ is the default value.
|
154
|
+
def extendPropertySetDefinition(type, default)
|
155
|
+
# Determine the values for scenarioSpecific and inheritable.
|
156
|
+
inherit = false
|
157
|
+
scenarioSpecific = false
|
158
|
+
unless @val[3].nil?
|
159
|
+
@val[3].each do |option|
|
160
|
+
case option
|
161
|
+
when 'inherit'
|
162
|
+
inherit = true
|
163
|
+
when 'scenariospecific'
|
164
|
+
scenarioSpecific = true
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
# Register the new Attribute type with the Property set it should belong
|
169
|
+
# to.
|
170
|
+
@propertySet.addAttributeType(AttributeDefinition.new(
|
171
|
+
@val[1], @val[2], type, inherit, scenarioSpecific, default, true))
|
172
|
+
|
173
|
+
# Add the new user-defined attribute as reportable attribute to the parser
|
174
|
+
# rule.
|
175
|
+
oldCurrentRule = @cr
|
176
|
+
@cr = @rules['reportableAttributes']
|
177
|
+
singlePattern('_' + @val[1])
|
178
|
+
descr(@val[2])
|
179
|
+
@cr = oldCurrentRule
|
180
|
+
|
181
|
+
scenarioSpecific
|
182
|
+
end
|
183
|
+
|
184
|
+
# This function is primarily a wrapper around the RichText constructor. It
|
185
|
+
# catches all RichTextScanner processing problems and converts the exception
|
186
|
+
# data into a MessageHandler message that points to the correct location.
|
187
|
+
# This is necessary, because the RichText parser knows nothing about the
|
188
|
+
# actual input file. So we have to map the error location in the RichText
|
189
|
+
# input stream back to the position in the project file.
|
190
|
+
def newRichText(text)
|
191
|
+
begin
|
192
|
+
rText = RichText.new(text)
|
193
|
+
rescue RichTextException => msg
|
194
|
+
sfi = sourceFileInfo
|
195
|
+
correctSFI = SourceFileInfo.new(sfi.fileName,
|
196
|
+
sfi.lineNo + msg.lineNo - 1, 0)
|
197
|
+
message = Message.new(msg.id, 'error', msg.text + "\n" + msg.line,
|
198
|
+
@property, nil, correctSFI)
|
199
|
+
@messageHandler.send(message)
|
200
|
+
|
201
|
+
end
|
202
|
+
rText
|
203
|
+
end
|
204
|
+
|
205
|
+
# If the @limitResources list is not empty, we have to create a Limits
|
206
|
+
# object for each Resource. Otherwise, one Limits object is enough.
|
207
|
+
def setLimit(name, value, interval)
|
208
|
+
if @limitResources.empty?
|
209
|
+
@limits.setLimit(name, value, interval)
|
210
|
+
else
|
211
|
+
@limitResources.each do |resource|
|
212
|
+
@limits.setLimit(name, value, interval, resource)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
# The following functions are mostly conveniance functions to simplify the
|
218
|
+
# syntax tree definition. The *Rule functions may only be used in _rule
|
219
|
+
# functions. And only one function call per _rule function is allowed.
|
220
|
+
|
221
|
+
def listRule(name, listItem)
|
222
|
+
pattern([ "#{listItem}", "!#{name}" ], lambda {
|
223
|
+
[ @val[0] ] + (@val[1].nil? ? [] : @val[1])
|
224
|
+
})
|
225
|
+
newRule(name)
|
226
|
+
commaListRule(listItem)
|
227
|
+
end
|
228
|
+
|
229
|
+
def commaListRule(listItem)
|
230
|
+
optional
|
231
|
+
repeatable
|
232
|
+
pattern([ '_,', "#{listItem}" ], lambda {
|
233
|
+
@val[1]
|
234
|
+
})
|
235
|
+
end
|
236
|
+
|
237
|
+
# Create pattern that turns the rule into the definition for optional
|
238
|
+
# attributes. _attributes_ is the rule that lists these attributes.
|
239
|
+
def optionsRule(attributes)
|
240
|
+
optional
|
241
|
+
pattern([ '_{', "!#{attributes}", '_}' ], lambda {
|
242
|
+
@val[1]
|
243
|
+
})
|
244
|
+
end
|
245
|
+
|
246
|
+
# Create a pattern with just a single _item_. The pattern returns the value
|
247
|
+
# of that item.
|
248
|
+
def singlePattern(item)
|
249
|
+
pattern([ item ], lambda {
|
250
|
+
@val[0]
|
251
|
+
})
|
252
|
+
end
|
253
|
+
|
254
|
+
# Add documentation for the current pattern of the currently processed rule.
|
255
|
+
def doc(keyword, text)
|
256
|
+
@cr.setDoc(keyword, text)
|
257
|
+
end
|
258
|
+
|
259
|
+
# Add documentation for patterns that only consists of a single terminal
|
260
|
+
# token.
|
261
|
+
def descr(text)
|
262
|
+
if @cr.patterns[-1].length != 1 ||
|
263
|
+
(@cr.patterns[-1][0][0] != ?_ && @cr.patterns[-1][0][0] != ?$)
|
264
|
+
raise('descr() may only be used for patterns with terminal tokens.')
|
265
|
+
end
|
266
|
+
arg(0, nil, text)
|
267
|
+
end
|
268
|
+
|
269
|
+
# Add documentation for the arguments with index _idx_ of the current
|
270
|
+
# pattern of the currently processed rule. _name_ is that should be used for
|
271
|
+
# this variable. _text_ is the documentation text.
|
272
|
+
def arg(idx, name, text)
|
273
|
+
@cr.setArg(idx, TextParser::TokenDoc.new(name, text))
|
274
|
+
end
|
275
|
+
|
276
|
+
# Restrict the syntax documentation of the previously defined pattern to
|
277
|
+
# the first +idx+ tokens.
|
278
|
+
def lastSyntaxToken(idx)
|
279
|
+
@cr.setLastSyntaxToken(idx)
|
280
|
+
end
|
281
|
+
|
282
|
+
# Add a reference to another pattern. This information is only used to
|
283
|
+
# generate the documentation for the patterns of this rule.
|
284
|
+
def also(seeAlso)
|
285
|
+
@cr.setSeeAlso(seeAlso)
|
286
|
+
end
|
287
|
+
|
288
|
+
# Add a TJP file or parts of it as an example. The TJP _file_ must be in the
|
289
|
+
# directory test/TestSuite/Syntax/Correct. _tag_ can be used to identify
|
290
|
+
# that only a part of the file should be included.
|
291
|
+
def example(file, tag = nil)
|
292
|
+
@cr.setExample(file, tag)
|
293
|
+
end
|
294
|
+
|
295
|
+
# To manage certain variables that have file scope throughout a hierachie
|
296
|
+
# of nested include files, we use a @fileStack to track those variables.
|
297
|
+
# The values primarily live in their class instance variables. But upon
|
298
|
+
# return from an included file, we need to restore the old values. This
|
299
|
+
# function creates or resets the stack.
|
300
|
+
def initFileStack
|
301
|
+
@fileStackVariables = %w( taskprefix resourceprefix accountprefix )
|
302
|
+
stackEntry = {}
|
303
|
+
@fileStackVariables.each do |var|
|
304
|
+
stackEntry[var] = ''
|
305
|
+
instance_variable_set('@' + var, '')
|
306
|
+
end
|
307
|
+
@fileStack = [ stackEntry ]
|
308
|
+
end
|
309
|
+
|
310
|
+
# Push a new set of variables onto the @fileStack.
|
311
|
+
def pushFileStack
|
312
|
+
stackEntry = {}
|
313
|
+
@fileStackVariables.each do |var|
|
314
|
+
stackEntry[var] = instance_variable_get('@' + var)
|
315
|
+
end
|
316
|
+
@fileStack << stackEntry
|
317
|
+
end
|
318
|
+
|
319
|
+
# Pop the last stack entry from the @fileStack and restore the class
|
320
|
+
# variables according to the now top-entry.
|
321
|
+
def popFileStack
|
322
|
+
@fileStack.pop
|
323
|
+
@fileStackVariables.each do |var|
|
324
|
+
stackEntry = @fileStack.last
|
325
|
+
instance_variable_set('@' + var, stackEntry[var])
|
326
|
+
end
|
327
|
+
@property = nil
|
328
|
+
end
|
329
|
+
|
330
|
+
end
|
331
|
+
|
332
|
+
end
|
333
|
+
|
data/lib/PropertyList.rb
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
#!/usr/bin/env ruby -w
|
2
|
+
# encoding: UTF-8
|
3
|
+
#
|
4
|
+
# = PropertyList.rb -- The TaskJuggler III Project Management Software
|
5
|
+
#
|
6
|
+
# Copyright (c) 2006, 2007, 2008, 2009 by Chris Schlaeger <cs@kde.org>
|
7
|
+
#
|
8
|
+
# This program is free software; you can redistribute it and/or modify
|
9
|
+
# it under the terms of version 2 of the GNU General Public License as
|
10
|
+
# published by the Free Software Foundation.
|
11
|
+
#
|
12
|
+
|
13
|
+
class TaskJuggler
|
14
|
+
|
15
|
+
# The PropertyList is a utility class that can be used to hold a list of
|
16
|
+
# properties. It's derived from an Array, so it can hold the properties in a
|
17
|
+
# well defined order. The order can be determined by an arbitrary number of
|
18
|
+
# sorting levels. A sorting level specifies an attribute who's value should
|
19
|
+
# be used for sorting, a scenario index if necessary and the sorting
|
20
|
+
# direction (up/down). All nodes in the PropertyList must belong to the same
|
21
|
+
# PropertySet.
|
22
|
+
class PropertyList < Array
|
23
|
+
|
24
|
+
attr_writer :query
|
25
|
+
attr_reader :propertySet, :query, :sortingLevels, :sortingCriteria,
|
26
|
+
:sortingUp, :scenarioIdx
|
27
|
+
|
28
|
+
# A PropertyList is always bound to a certain PropertySet. All properties
|
29
|
+
# in the list must be of that set.
|
30
|
+
def initialize(arg)
|
31
|
+
super(arg.to_ary)
|
32
|
+
if arg.is_a?(PropertySet)
|
33
|
+
# Create a PropertyList from the given PropertySet.
|
34
|
+
@propertySet = arg
|
35
|
+
# To keep the list sorted, we may have to access Property attributes.
|
36
|
+
# Pre-scheduling, we can only use static attributes. Post-scheduling,
|
37
|
+
# we can include dynamic attributes as well. This query template will
|
38
|
+
# be used to query attributes when it has been set. Otherwise the list
|
39
|
+
# can only be sorted by static attributes.
|
40
|
+
@query = nil
|
41
|
+
resetSorting
|
42
|
+
addSortingCriteria('seqno', true, -1)
|
43
|
+
self.sort!
|
44
|
+
else
|
45
|
+
# Create a PropertyList from a given other PropertyList.
|
46
|
+
@propertySet = arg.propertySet
|
47
|
+
@query = arg.query ? arg.query.dup : nil
|
48
|
+
@sortingLevels = arg.sortingLevels
|
49
|
+
@sortingCriteria = arg.sortingCriteria.dup
|
50
|
+
@sortingUp = arg.sortingUp.dup
|
51
|
+
@scenarioIdx = arg.scenarioIdx.dup
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Set all sorting levels as Array of triplets.
|
56
|
+
def setSorting(modes)
|
57
|
+
resetSorting
|
58
|
+
modes.each do |mode|
|
59
|
+
addSortingCriteria(*mode)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Clear all sorting levels.
|
64
|
+
def resetSorting
|
65
|
+
@sortingLevels = 0
|
66
|
+
@sortingCriteria = []
|
67
|
+
@sortingUp = []
|
68
|
+
@scenarioIdx = []
|
69
|
+
end
|
70
|
+
|
71
|
+
# Append another Array of Tasks or a PropertyList to this. The list will be
|
72
|
+
# sorted again.
|
73
|
+
def append(list)
|
74
|
+
if $DEBUG
|
75
|
+
list.each do |node|
|
76
|
+
unless node.propertySet == @propertySet
|
77
|
+
raise "Fatal Error: All nodes must belong to the same PropertySet."
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
concat(list)
|
83
|
+
self.sort!
|
84
|
+
end
|
85
|
+
|
86
|
+
# Append a new sorting level to the existing levels.
|
87
|
+
def addSortingCriteria(criteria, up, scIdx)
|
88
|
+
unless @propertySet.knownAttribute?(criteria)
|
89
|
+
raise TjException.new, "Unknown attribute #{criteria} used for " +
|
90
|
+
'sorting criterium'
|
91
|
+
end
|
92
|
+
if scIdx == -1
|
93
|
+
if @propertySet.scenarioSpecific?(criteria)
|
94
|
+
raise TjException.new, "Attribute #{criteria} is scenario specific"
|
95
|
+
end
|
96
|
+
else
|
97
|
+
if !@propertySet.scenarioSpecific?(criteria)
|
98
|
+
raise TjException.new, "Attribute #{criteria} is not scenario specific"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
@sortingCriteria.push(criteria)
|
102
|
+
@sortingUp.push(up)
|
103
|
+
@scenarioIdx.push(scIdx)
|
104
|
+
@sortingLevels += 1
|
105
|
+
end
|
106
|
+
|
107
|
+
# If the first sorting level is 'tree' the breakdown structure of the
|
108
|
+
# list is preserved. This is a somewhat special mode and this function
|
109
|
+
# returns true if the mode is set.
|
110
|
+
def treeMode?
|
111
|
+
@sortingLevels > 0 && @sortingCriteria[0] == 'tree'
|
112
|
+
end
|
113
|
+
|
114
|
+
# Sort the properties according to the currently defined sorting criteria.
|
115
|
+
def sort!
|
116
|
+
super do |a, b|
|
117
|
+
res = 0
|
118
|
+
@sortingLevels.times do |i|
|
119
|
+
if @query
|
120
|
+
# In case we have a Query reference, we get the two values with this
|
121
|
+
# query.
|
122
|
+
@query.scenarioIdx = @scenarioIdx[i] < 0 ? nil : @scenarioIdx[i]
|
123
|
+
@query.attributeId = @sortingCriteria[i]
|
124
|
+
|
125
|
+
@query.property = a
|
126
|
+
@query.process
|
127
|
+
aVal = @query.sortableResult
|
128
|
+
|
129
|
+
@query.property = b
|
130
|
+
@query.process
|
131
|
+
bVal = @query.sortableResult
|
132
|
+
else
|
133
|
+
# In case we don't have a query, we use the static mechanism.
|
134
|
+
# If the scenario index is negative we have a non-scenario-specific
|
135
|
+
# attribute.
|
136
|
+
if @scenarioIdx[i] < 0
|
137
|
+
aVal = a.get(@sortingCriteria[i])
|
138
|
+
bVal = b.get(@sortingCriteria[i])
|
139
|
+
else
|
140
|
+
aVal = a[@sortingCriteria[i], @scenarioIdx[i]]
|
141
|
+
bVal = b[@sortingCriteria[i], @scenarioIdx[i]]
|
142
|
+
end
|
143
|
+
end
|
144
|
+
res = aVal <=> bVal
|
145
|
+
# Invert the result if we have to sort in decreasing order.
|
146
|
+
res = -res unless @sortingUp[i]
|
147
|
+
# If the two elements are equal on this compare level we try the next
|
148
|
+
# level.
|
149
|
+
break if res != 0
|
150
|
+
end
|
151
|
+
res
|
152
|
+
end
|
153
|
+
# Update indexes.
|
154
|
+
index
|
155
|
+
end
|
156
|
+
|
157
|
+
# This function sets the index attribute of all the properties in the list.
|
158
|
+
# The index starts with 0 and increases for each property.
|
159
|
+
def index
|
160
|
+
i = 0
|
161
|
+
each do |p|
|
162
|
+
p.set('index', i += 1)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Turn the list into a String. This is only used for debugging.
|
167
|
+
def to_s # :nodoc:
|
168
|
+
res = "Sorting: "
|
169
|
+
@sortingLevels.times do |i|
|
170
|
+
res += "#{@sortingCriteria[i]}/#{@sortingUp[i] ? 'up' : 'down'}/" +
|
171
|
+
"#{@scenarioIdx[i]}, "
|
172
|
+
end
|
173
|
+
res += "\n"
|
174
|
+
each { |i| res += "#{i.get('id')}: #{i.get('name')}\n" }
|
175
|
+
res
|
176
|
+
end
|
177
|
+
|
178
|
+
end
|
179
|
+
|
180
|
+
end
|
181
|
+
|