taskjuggler 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +119 -0
- data/benchmarks/allocatedSlots.tjp +1602 -0
- data/benchmarks/booking.tjp +40 -30
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/css/tjmanual.css +0 -0
- data/{test/TestSuite/Scheduler/Correct → benchmarks}/css/tjreport.css +1 -0
- data/benchmarks/gantt.tjp +57 -0
- data/benchmarks/htmltaskreport.tjp +26 -1
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/details.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-green.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-red.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/flag-yellow.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/resource.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/resourcegroup.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/task.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/taskgroup.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-down.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-flat.png +0 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/icons/trend-up.png +0 -0
- data/benchmarks/profile.clt +36082 -0
- data/benchmarks/profile.html +58182 -0
- data/benchmarks/runbench.rb +6 -0
- data/{test/TestSuite/ReportGenerator/Errors → benchmarks}/scripts/wz_tooltip.js +0 -0
- data/doc/AppConfig.html +85 -37
- data/doc/Arguments.html +11 -1
- data/doc/CHANGELOG.html +131 -2
- data/doc/COPYING.html +11 -1
- data/doc/Object.html +12 -3
- data/doc/README.html +11 -1
- data/doc/RuntimeConfig.html +11 -1
- data/doc/String.html +11 -1
- data/doc/StringIO.html +11 -1
- data/doc/TaskJuggler.html +250 -219
- data/doc/TaskJuggler/Account.html +11 -1
- data/doc/TaskJuggler/AccountAttribute.html +11 -1
- data/doc/TaskJuggler/AccountScenario.html +11 -1
- data/doc/TaskJuggler/Allocation.html +11 -1
- data/doc/TaskJuggler/AllocationAttribute.html +11 -1
- data/doc/TaskJuggler/AttributeBase.html +11 -1
- data/doc/TaskJuggler/AttributeDefinition.html +11 -1
- data/doc/TaskJuggler/BatchProcessor.html +11 -1
- data/doc/TaskJuggler/Booking.html +11 -1
- data/doc/TaskJuggler/BookingListAttribute.html +11 -1
- data/doc/TaskJuggler/BooleanAttribute.html +11 -1
- data/doc/TaskJuggler/CSVFile.html +12 -2
- data/doc/TaskJuggler/CellSettingPattern.html +11 -1
- data/doc/TaskJuggler/CellSettingPatternList.html +11 -1
- data/doc/TaskJuggler/Charge.html +11 -1
- data/doc/TaskJuggler/ChargeListAttribute.html +11 -1
- data/doc/TaskJuggler/ChargeSet.html +11 -1
- data/doc/TaskJuggler/ChargeSetListAttribute.html +11 -1
- data/doc/TaskJuggler/CollisionDetector.html +1063 -0
- data/doc/TaskJuggler/ColumnListAttribute.html +11 -1
- data/doc/TaskJuggler/ColumnTable.html +11 -1
- data/doc/TaskJuggler/Daemon.html +11 -1
- data/doc/TaskJuggler/{OnShiftCache.html → DataCache.html} +127 -139
- data/doc/TaskJuggler/DataCacheEntry.html +711 -0
- data/doc/TaskJuggler/DateAttribute.html +11 -1
- data/doc/TaskJuggler/DefinitionListAttribute.html +11 -1
- data/doc/TaskJuggler/DependencyListAttribute.html +11 -1
- data/doc/TaskJuggler/DurationAttribute.html +16 -5
- data/doc/TaskJuggler/FileList.html +11 -1
- data/doc/TaskJuggler/FileRecord.html +11 -1
- data/doc/TaskJuggler/FixnumAttribute.html +19 -9
- data/doc/TaskJuggler/FlagListAttribute.html +29 -19
- data/doc/TaskJuggler/FloatAttribute.html +23 -13
- data/doc/TaskJuggler/FormatListAttribute.html +19 -9
- data/doc/TaskJuggler/GanttChart.html +94 -133
- data/doc/TaskJuggler/GanttContainer.html +11 -1
- data/doc/TaskJuggler/GanttHeader.html +11 -1
- data/doc/TaskJuggler/GanttHeaderScaleItem.html +11 -1
- data/doc/TaskJuggler/GanttLine.html +11 -1
- data/doc/TaskJuggler/GanttLoadStack.html +11 -1
- data/doc/TaskJuggler/GanttMilestone.html +11 -1
- data/doc/TaskJuggler/GanttRouter.html +247 -596
- data/doc/TaskJuggler/GanttTaskBar.html +11 -1
- data/doc/TaskJuggler/HTMLDocument.html +11 -1
- data/doc/TaskJuggler/HTMLGraphics.html +11 -1
- data/doc/TaskJuggler/Interval.html +11 -1
- data/doc/TaskJuggler/IntervalListAttribute.html +33 -23
- data/doc/TaskJuggler/JobInfo.html +11 -1
- data/doc/TaskJuggler/Journal.html +11 -1
- data/doc/TaskJuggler/JournalEntry.html +11 -1
- data/doc/TaskJuggler/JournalEntryList.html +11 -1
- data/doc/TaskJuggler/KeywordArray.html +11 -1
- data/doc/TaskJuggler/KeywordDocumentation.html +16 -6
- data/doc/TaskJuggler/Limits.html +11 -1
- data/doc/TaskJuggler/Limits/Limit.html +11 -1
- data/doc/TaskJuggler/LimitsAttribute.html +24 -14
- data/doc/TaskJuggler/ListAttributeBase.html +11 -1
- data/doc/TaskJuggler/Log.html +11 -1
- data/doc/TaskJuggler/LogFile.html +11 -1
- data/doc/TaskJuggler/LogicalAttribute.html +11 -1
- data/doc/TaskJuggler/LogicalExpression.html +11 -1
- data/doc/TaskJuggler/LogicalExpressionAttribute.html +19 -9
- data/doc/TaskJuggler/LogicalFlag.html +11 -1
- data/doc/TaskJuggler/LogicalFunction.html +11 -1
- data/doc/TaskJuggler/LogicalOperation.html +11 -1
- data/doc/TaskJuggler/Macro.html +11 -1
- data/doc/TaskJuggler/MacroTable.html +11 -1
- data/doc/TaskJuggler/ManagerResponsibilities.html +11 -1
- data/doc/TaskJuggler/ManagerStatusRecord.html +11 -1
- data/doc/TaskJuggler/Message.html +11 -1
- data/doc/TaskJuggler/MessageHandler.html +11 -1
- data/doc/TaskJuggler/Navigator.html +12 -2
- data/doc/TaskJuggler/NavigatorElement.html +11 -1
- data/doc/TaskJuggler/NikuProject.html +11 -1
- data/doc/TaskJuggler/NikuReport.html +11 -1
- data/doc/TaskJuggler/NikuResource.html +11 -1
- data/doc/TaskJuggler/NodeListAttribute.html +17 -7
- data/doc/TaskJuggler/PlaceHolderCell.html +722 -0
- data/doc/TaskJuggler/ProcessIntercom.html +11 -1
- data/doc/TaskJuggler/ProcessIntercomIface.html +11 -1
- data/doc/TaskJuggler/Project.html +587 -500
- data/doc/TaskJuggler/ProjectBroker.html +11 -1
- data/doc/TaskJuggler/ProjectBrokerIface.html +11 -1
- data/doc/TaskJuggler/ProjectFileParser.html +205 -192
- data/doc/TaskJuggler/ProjectFileScanner.html +230 -207
- data/doc/TaskJuggler/ProjectRecord.html +11 -1
- data/doc/TaskJuggler/ProjectServer.html +11 -1
- data/doc/TaskJuggler/ProjectServerIface.html +11 -1
- data/doc/TaskJuggler/PropertyAttribute.html +19 -9
- data/doc/TaskJuggler/PropertyList.html +95 -83
- data/doc/TaskJuggler/PropertySet.html +11 -1
- data/doc/TaskJuggler/PropertyTreeNode.html +11 -1
- data/doc/TaskJuggler/Query.html +234 -232
- data/doc/TaskJuggler/RTFHandlers.html +11 -1
- data/doc/TaskJuggler/RTFNavigator.html +11 -1
- data/doc/TaskJuggler/RTFQuery.html +11 -1
- data/doc/TaskJuggler/RTFReport.html +11 -1
- data/doc/TaskJuggler/RTFReportLink.html +11 -1
- data/doc/TaskJuggler/RTFWithQuerySupport.html +11 -1
- data/doc/TaskJuggler/RealFormat.html +12 -2
- data/doc/TaskJuggler/RealFormatAttribute.html +15 -5
- data/doc/TaskJuggler/ReferenceAttribute.html +38 -28
- data/doc/TaskJuggler/Report.html +96 -113
- data/doc/TaskJuggler/ReportBase.html +161 -152
- data/doc/TaskJuggler/ReportContext.html +11 -1
- data/doc/TaskJuggler/ReportServer.html +59 -48
- data/doc/TaskJuggler/ReportServerIface.html +51 -41
- data/doc/TaskJuggler/ReportServerRecord.html +11 -1
- data/doc/TaskJuggler/ReportServlet.html +11 -1
- data/doc/TaskJuggler/ReportTable.html +46 -25
- data/doc/TaskJuggler/ReportTableCell.html +296 -275
- data/doc/TaskJuggler/ReportTableColumn.html +14 -4
- data/doc/TaskJuggler/ReportTableLegend.html +11 -1
- data/doc/TaskJuggler/ReportTableLine.html +19 -7
- data/doc/TaskJuggler/Resource.html +12 -2
- data/doc/TaskJuggler/ResourceListAttribute.html +40 -30
- data/doc/TaskJuggler/ResourceListRE.html +11 -1
- data/doc/TaskJuggler/ResourceScenario.html +708 -565
- data/doc/TaskJuggler/RichText.html +54 -36
- data/doc/TaskJuggler/RichTextAttribute.html +31 -21
- data/doc/TaskJuggler/RichTextDocument.html +11 -1
- data/doc/TaskJuggler/RichTextElement.html +11 -1
- data/doc/TaskJuggler/RichTextFunctionExample.html +11 -1
- data/doc/TaskJuggler/RichTextFunctionHandler.html +11 -1
- data/doc/TaskJuggler/RichTextImage.html +11 -1
- data/doc/TaskJuggler/RichTextIntermediate.html +81 -71
- data/doc/TaskJuggler/RichTextParser.html +88 -33
- data/doc/TaskJuggler/RichTextScanner.html +45 -35
- data/doc/TaskJuggler/RichTextSnip.html +11 -1
- data/doc/TaskJuggler/RichTextSyntaxRules.html +436 -389
- data/doc/TaskJuggler/Scenario.html +11 -1
- data/doc/TaskJuggler/ScenarioData.html +11 -1
- data/doc/TaskJuggler/ScenarioListAttribute.html +23 -13
- data/doc/TaskJuggler/Scoreboard.html +92 -73
- data/doc/TaskJuggler/SheetHandlerBase.html +11 -1
- data/doc/TaskJuggler/SheetReceiver.html +11 -1
- data/doc/TaskJuggler/SheetSender.html +11 -1
- data/doc/TaskJuggler/Shift.html +11 -1
- data/doc/TaskJuggler/ShiftAssignment.html +11 -1
- data/doc/TaskJuggler/ShiftAssignments.html +11 -1
- data/doc/TaskJuggler/ShiftAssignmentsAttribute.html +24 -14
- data/doc/TaskJuggler/ShiftScenario.html +11 -1
- data/doc/TaskJuggler/SimpleQueryExpander.html +11 -1
- data/doc/TaskJuggler/SortListAttribute.html +21 -11
- data/doc/TaskJuggler/SourceFileInfo.html +11 -1
- data/doc/TaskJuggler/StatusSheetReceiver.html +11 -1
- data/doc/TaskJuggler/StatusSheetReport.html +11 -1
- data/doc/TaskJuggler/StatusSheetSender.html +112 -11
- data/doc/TaskJuggler/StringAttribute.html +23 -13
- data/doc/TaskJuggler/SymbolAttribute.html +19 -9
- data/doc/TaskJuggler/SyntaxReference.html +80 -71
- data/doc/TaskJuggler/TOCEntry.html +11 -1
- data/doc/TaskJuggler/TSResourceRecord.html +11 -1
- data/doc/TaskJuggler/TSTaskRecord.html +11 -1
- data/doc/TaskJuggler/TableColumnDefinition.html +11 -1
- data/doc/TaskJuggler/TableOfContents.html +11 -1
- data/doc/TaskJuggler/TableReport.html +422 -411
- data/doc/TaskJuggler/Task.html +11 -1
- data/doc/TaskJuggler/TaskDependency.html +11 -1
- data/doc/TaskJuggler/TaskListAttribute.html +33 -23
- data/doc/TaskJuggler/TaskListRE.html +11 -1
- data/doc/TaskJuggler/TaskScenario.html +2007 -1919
- data/doc/TaskJuggler/TextFormatter.html +11 -1
- data/doc/TaskJuggler/TextParser.html +421 -612
- data/doc/TaskJuggler/TextParser/Pattern.html +410 -211
- data/doc/TaskJuggler/TextParser/Rule.html +224 -152
- data/doc/TaskJuggler/TextParser/StackElement.html +190 -28
- data/doc/TaskJuggler/TextParser/State.html +989 -0
- data/doc/TaskJuggler/TextParser/StateTransition.html +782 -0
- data/doc/TaskJuggler/TextParser/TextParserResultArray.html +25 -14
- data/doc/TaskJuggler/TextParser/TokenDoc.html +11 -1
- data/doc/TaskJuggler/TextReport.html +11 -1
- data/doc/TaskJuggler/TextScanner.html +285 -273
- data/doc/TaskJuggler/TextScanner/BufferStreamHandle.html +17 -7
- data/doc/TaskJuggler/TextScanner/FileStreamHandle.html +24 -14
- data/doc/TaskJuggler/TextScanner/MacroStackEntry.html +11 -1
- data/doc/TaskJuggler/TextScanner/StreamHandle.html +64 -52
- data/doc/TaskJuggler/TimeSheet.html +11 -1
- data/doc/TaskJuggler/TimeSheetReceiver.html +11 -1
- data/doc/TaskJuggler/TimeSheetRecord.html +11 -1
- data/doc/TaskJuggler/TimeSheetReport.html +11 -1
- data/doc/TaskJuggler/TimeSheetSender.html +11 -1
- data/doc/TaskJuggler/TimeSheetSummary.html +11 -1
- data/doc/TaskJuggler/TimeSheets.html +11 -1
- data/doc/TaskJuggler/Tj3AppBase.html +11 -1
- data/doc/TaskJuggler/Tj3Client.html +11 -1
- data/doc/TaskJuggler/Tj3Daemon.html +11 -1
- data/doc/TaskJuggler/Tj3SheetAppBase.html +11 -1
- data/doc/TaskJuggler/Tj3SsReceiver.html +11 -1
- data/doc/TaskJuggler/Tj3SsSender.html +11 -1
- data/doc/TaskJuggler/Tj3TsReceiver.html +11 -1
- data/doc/TaskJuggler/Tj3TsSender.html +11 -1
- data/doc/TaskJuggler/Tj3TsSummary.html +11 -1
- data/doc/TaskJuggler/TjException.html +11 -1
- data/doc/TaskJuggler/TjTime.html +474 -324
- data/doc/TaskJuggler/TjpExample.html +11 -1
- data/doc/TaskJuggler/TjpExportRE.html +11 -1
- data/doc/TaskJuggler/TjpSyntaxRules.html +3731 -3662
- data/doc/TaskJuggler/URLParameter.html +11 -1
- data/doc/TaskJuggler/UserManual.html +11 -1
- data/doc/TaskJuggler/VimSyntax.html +11 -1
- data/doc/TaskJuggler/WebServer.html +11 -1
- data/doc/TaskJuggler/WorkingHours.html +295 -221
- data/doc/TaskJuggler/WorkingHoursAttribute.html +11 -1
- data/doc/TaskJuggler/XMLBlob.html +11 -1
- data/doc/TaskJuggler/XMLComment.html +11 -1
- data/doc/TaskJuggler/XMLDocument.html +11 -1
- data/doc/TaskJuggler/XMLElement.html +11 -1
- data/doc/TaskJuggler/XMLNamedText.html +11 -1
- data/doc/TaskJuggler/XMLText.html +11 -1
- data/doc/index.html +694 -624
- data/doc/lib/AppConfig_rb.html +1 -1
- data/doc/lib/Attributes_rb.html +1 -1
- data/doc/lib/Booking_rb.html +1 -1
- data/doc/lib/DataCache_rb.html +69 -0
- data/doc/lib/KeywordDocumentation_rb.html +1 -1
- data/doc/lib/ProjectFileParser_rb.html +1 -1
- data/doc/lib/ProjectFileScanner_rb.html +1 -1
- data/doc/lib/Project_rb.html +1 -1
- data/doc/lib/PropertyList_rb.html +1 -1
- data/doc/lib/Query_rb.html +1 -1
- data/doc/lib/RealFormat_rb.html +1 -1
- data/doc/lib/ResourceScenario_rb.html +1 -1
- data/doc/lib/Resource_rb.html +1 -1
- data/doc/lib/RichTextParser_rb.html +1 -1
- data/doc/lib/RichTextScanner_rb.html +1 -1
- data/doc/lib/RichTextSyntaxRules_rb.html +1 -1
- data/doc/lib/RichText_rb.html +1 -1
- data/doc/lib/Scoreboard_rb.html +1 -1
- data/doc/lib/StatusSheetSender_rb.html +1 -1
- data/doc/lib/SyntaxReference_rb.html +1 -1
- data/doc/lib/TaskJuggler_rb.html +1 -1
- data/doc/lib/TaskScenario_rb.html +3 -1
- data/doc/lib/TextParser/Pattern_rb.html +3 -1
- data/doc/lib/TextParser/Rule_rb.html +3 -1
- data/doc/lib/TextParser/StackElement_rb.html +3 -1
- data/doc/lib/TextParser/State_rb.html +65 -0
- data/doc/lib/TextParser_rb.html +1 -1
- data/doc/lib/TextScanner_rb.html +1 -1
- data/doc/lib/Tj3Config_rb.html +1 -1
- data/doc/lib/TjTime_rb.html +1 -1
- data/doc/lib/TjpSyntaxRules_rb.html +1 -1
- data/doc/lib/WorkingHours_rb.html +3 -1
- data/doc/lib/daemon/ReportServer_rb.html +1 -1
- data/doc/lib/reports/CSVFile_rb.html +1 -1
- data/doc/lib/reports/CollisionDetector_rb.html +67 -0
- data/doc/lib/reports/GanttChart_rb.html +1 -1
- data/doc/lib/reports/GanttRouter_rb.html +3 -1
- data/doc/lib/reports/Navigator_rb.html +1 -1
- data/doc/lib/reports/ReportBase_rb.html +1 -1
- data/doc/lib/reports/ReportTableCell_rb.html +1 -1
- data/doc/lib/reports/ReportTableColumn_rb.html +1 -1
- data/doc/lib/reports/ReportTableLine_rb.html +1 -1
- data/doc/lib/reports/ReportTable_rb.html +1 -1
- data/doc/lib/reports/Report_rb.html +1 -1
- data/doc/lib/reports/TableReport_rb.html +1 -1
- data/doc/lib/taskjuggler3_rb.html +1 -1
- data/examples/tutorial.tjp +1 -2
- data/lib/AppConfig.rb +10 -4
- data/lib/Attributes.rb +4 -4
- data/lib/DataCache.rb +124 -0
- data/lib/KeywordDocumentation.rb +5 -5
- data/lib/Project.rb +54 -10
- data/lib/ProjectFileParser.rb +10 -9
- data/lib/ProjectFileScanner.rb +38 -25
- data/lib/PropertyList.rb +6 -4
- data/lib/Query.rb +0 -8
- data/lib/RealFormat.rb +1 -1
- data/lib/Resource.rb +1 -1
- data/lib/ResourceScenario.rb +96 -31
- data/lib/RichText.rb +17 -5
- data/lib/RichTextParser.rb +22 -9
- data/lib/RichTextScanner.rb +34 -34
- data/lib/RichTextSyntaxRules.rb +41 -36
- data/lib/Scoreboard.rb +16 -7
- data/lib/StatusSheetSender.rb +63 -0
- data/lib/SyntaxReference.rb +9 -10
- data/lib/TaskJuggler.rb +28 -4
- data/lib/TaskScenario.rb +66 -19
- data/lib/TextParser.rb +219 -384
- data/lib/TextParser/Pattern.rb +168 -49
- data/lib/TextParser/Rule.rb +33 -17
- data/lib/TextParser/StackElement.rb +42 -2
- data/lib/TextParser/State.rb +175 -0
- data/lib/TextScanner.rb +19 -15
- data/lib/Tj3Config.rb +1 -1
- data/lib/TjTime.rb +111 -3
- data/lib/TjpSyntaxRules.rb +122 -66
- data/lib/WorkingHours.rb +91 -186
- data/lib/daemon/ReportServer.rb +3 -2
- data/lib/reports/CSVFile.rb +1 -1
- data/lib/reports/CollisionDetector.rb +177 -0
- data/lib/reports/GanttChart.rb +25 -41
- data/lib/reports/GanttRouter.rb +104 -233
- data/lib/reports/Navigator.rb +1 -1
- data/lib/reports/Report.rb +9 -33
- data/lib/reports/ReportBase.rb +0 -1
- data/lib/reports/ReportTable.rb +19 -8
- data/lib/reports/ReportTableCell.rb +61 -25
- data/lib/reports/ReportTableColumn.rb +2 -2
- data/lib/reports/ReportTableLine.rb +4 -2
- data/lib/reports/TableReport.rb +1 -0
- data/lib/taskjuggler3.rb +0 -1
- data/manual/Installation +7 -3
- data/manual/Intro +12 -10
- data/manual/The_TaskJuggler_Syntax +4 -4
- data/test/TestSuite/CSV-Reports/celltext-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/genrefs +1 -1
- data/test/TestSuite/CSV-Reports/resourcereport-Reference.csv +4 -4
- data/test/TestSuite/CSV-Reports/resourcereport_with_tasks-Reference.csv +22 -22
- data/test/TestSuite/CSV-Reports/sortByTree-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/sortBy_duration.down-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/sortBy_effort.up-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/sortBy_plan.start.down-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/taskreport-Reference.csv +14 -14
- data/test/TestSuite/CSV-Reports/taskreport_with_resources-Reference.csv +32 -24
- data/test/TestSuite/CSV-Reports/weekly-Reference.csv +13 -0
- data/test/TestSuite/CSV-Reports/weekly.tjp +9 -0
- data/test/TestSuite/HTML-Reports/css/tjreport.css +7 -2
- data/test/TestSuite/HTML-Reports/depArrows.html +839 -830
- data/test/TestSuite/HTML-Reports/depArrows.tjp +12 -12
- data/test/TestSuite/HTML-Reports/profile.html +37581 -0
- data/test/TestSuite/ReportGenerator/Errors/no_report_defined.tjp +7 -0
- data/test/TestSuite/ReportGenerator/Errors/rtp_report_recursion.tjp +1 -1
- data/test/TestSuite/StatusSheets/TimeSheets/2002-03-01/missing-reports +2 -0
- data/test/TestSuite/StatusSheets/run +2 -0
- data/test/TestSuite/Syntax/Correct/Booking.tjp +13 -5
- data/test/TestSuite/Syntax/Correct/ResourceRoot.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/RollupResource.tjp +21 -0
- data/test/TestSuite/Syntax/Correct/TaskRoot.tjp +1 -1
- data/test/TestSuite/Syntax/Errors/empty.tjp +1 -1
- data/test/TestSuite/Syntax/Errors/include_before_project.tjp +2 -0
- data/test/TestSuite/Syntax/Errors/no_reduce.tjp +6 -0
- data/test/TestSuite/Syntax/Errors/unsupported_token.tjp +1 -1
- data/test/TestSuite/TimeSheets/run +1 -1
- data/test/test_CSV-Reports.rb +2 -4
- data/test/test_CollisionDetector.rb +85 -0
- data/test/test_Project.rb +2 -2
- data/test/test_ProjectFileScanner.rb +73 -31
- data/test/test_Query.rb +2 -2
- data/test/test_ReportGenerator.rb +1 -1
- data/test/test_RichText.rb +4 -4
- data/test/test_WorkingHours.rb +150 -11
- metadata +75 -67
- data/test/TestSuite/ReportGenerator/Errors/css/tjreport.css +0 -407
- data/test/TestSuite/ReportGenerator/Errors/rtp_report_recursion.html +0 -26
- data/test/TestSuite/Scheduler/Correct/Allocate.html +0 -3210
- data/test/TestSuite/Scheduler/Correct/Container.html +0 -349
- data/test/TestSuite/Scheduler/Correct/Limits.html +0 -4964
- data/test/TestSuite/Scheduler/Correct/Shift.html +0 -1719
- data/test/TestSuite/Scheduler/Correct/Shift2.html +0 -476
- data/test/TestSuite/Scheduler/Correct/css/tjmanual.css +0 -66
- data/test/TestSuite/Scheduler/Correct/icons/details.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/flag-green.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/flag-red.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/flag-yellow.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/resource.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/resourcegroup.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/task.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/taskgroup.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/trend-down.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/trend-flat.png +0 -0
- data/test/TestSuite/Scheduler/Correct/icons/trend-up.png +0 -0
- data/test/TestSuite/Scheduler/Correct/scripts/wz_tooltip.js +0 -1301
- data/test/TestSuite/Scheduler/Errors/css/tjmanual.css +0 -66
- data/test/TestSuite/Scheduler/Errors/css/tjreport.css +0 -407
- data/test/TestSuite/Scheduler/Errors/icons/details.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/flag-green.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/flag-red.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/flag-yellow.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/resource.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/resourcegroup.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/task.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/taskgroup.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/trend-down.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/trend-flat.png +0 -0
- data/test/TestSuite/Scheduler/Errors/icons/trend-up.png +0 -0
- data/test/TestSuite/Scheduler/Errors/scripts/wz_tooltip.js +0 -1301
- data/test/TestSuite/StatusSheets/resrep.tji +0 -7
- data/test/TestSuite/StatusSheets/tj3d.log +0 -312
- data/test/TestSuite/Syntax/Correct/Managers.html +0 -263
- data/test/TestSuite/TimeSheets/acceptable_intervals +0 -1
- data/test/TestSuite/TimeSheets/statussheets.log +0 -1
data/lib/TextParser/Pattern.rb
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
|
|
13
13
|
require 'TextParser/TokenDoc'
|
|
14
|
+
require 'TextParser/State'
|
|
14
15
|
|
|
15
16
|
class TaskJuggler::TextParser
|
|
16
17
|
|
|
@@ -19,18 +20,18 @@ class TaskJuggler::TextParser
|
|
|
19
20
|
# are Strings where the first character determines the type of the token.
|
|
20
21
|
# There are 4 known types.
|
|
21
22
|
#
|
|
22
|
-
# Terminal token:
|
|
23
|
-
# tokens are terminal symbols of the syntax tree.
|
|
24
|
-
# themselves.
|
|
23
|
+
# Terminal token: In the syntax declaration the terminal token is prefixed
|
|
24
|
+
# by an underscore. Terminal tokens are terminal symbols of the syntax tree.
|
|
25
|
+
# They just represent themselves.
|
|
25
26
|
#
|
|
26
27
|
# Variable token: The variable token describes values of a certain class such
|
|
27
|
-
# as strings or numbers.
|
|
28
|
-
# of the token specifies the variable type. See
|
|
29
|
-
# complete list of variable types.
|
|
28
|
+
# as strings or numbers. In the syntax declaration the token is prefixed by
|
|
29
|
+
# a dollar sign and the text of the token specifies the variable type. See
|
|
30
|
+
# ProjectFileParser for a complete list of variable types.
|
|
30
31
|
#
|
|
31
32
|
# Reference token: The reference token specifies a reference to another parser
|
|
32
|
-
# rule.
|
|
33
|
-
# rule. See TextParserRule for details.
|
|
33
|
+
# rule. In the syntax declaration the token is prefixed by a bang and the
|
|
34
|
+
# text matches the name of the rule. See TextParserRule for details.
|
|
34
35
|
#
|
|
35
36
|
# End token: The . token marks the expected end of the input stream.
|
|
36
37
|
#
|
|
@@ -57,19 +58,125 @@ class TaskJuggler::TextParser
|
|
|
57
58
|
@exampleFile = nil
|
|
58
59
|
@exampleTag = nil
|
|
59
60
|
|
|
61
|
+
@tokens = []
|
|
60
62
|
tokens.each do |token|
|
|
61
63
|
unless '!$_.'.include?(token[0])
|
|
62
64
|
raise "Fatal Error: All pattern tokens must start with a type " +
|
|
63
65
|
"identifier [!$_.]: #{tokens.join(', ')}"
|
|
64
66
|
end
|
|
67
|
+
# For the syntax specification using a prefix character is more
|
|
68
|
+
# convenient. But for further processing, we need to split the string
|
|
69
|
+
# into two symbols. The prefix determines the token type, the rest is
|
|
70
|
+
# the token name. There are 4 types of tokens:
|
|
71
|
+
# :reference : a reference to another rule
|
|
72
|
+
# :variable : a terminal symbol
|
|
73
|
+
# :literal : a user defined string
|
|
74
|
+
# :eof : marks the end of an input stream
|
|
75
|
+
type = [ :reference, :variable, :literal, :eof ]['!$_.'.index(token[0])]
|
|
76
|
+
# For literals we use a String to store the token content. For others,
|
|
77
|
+
# a symbol is better suited.
|
|
78
|
+
name = type == :literal ?
|
|
79
|
+
token[1..-1] : (type == :eof ? '<END>' : token[1..-1].intern)
|
|
80
|
+
# We favor an Array to store the 2 elements over a Hash for
|
|
81
|
+
# performance reasons.
|
|
82
|
+
@tokens << [ type, name ]
|
|
65
83
|
# Initialize pattern argument descriptions as empty.
|
|
66
84
|
@args << nil
|
|
67
85
|
end
|
|
68
|
-
@tokens = tokens
|
|
69
86
|
@function = function
|
|
70
87
|
# In some cases we don't want to show all tokens in the syntax
|
|
71
88
|
# documentation. This value specifies the index of the last shown token.
|
|
72
89
|
@lastSyntaxToken = @tokens.length - 1
|
|
90
|
+
|
|
91
|
+
@transitions = []
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Generate the state machine states for the pattern. _rule_ is the Rule
|
|
95
|
+
# that the pattern belongs to. A list of generated State objects will be
|
|
96
|
+
# returned.
|
|
97
|
+
def generateStates(rule)
|
|
98
|
+
states = []
|
|
99
|
+
@tokens.length.times { |i| states << State.new(rule, self, i) }
|
|
100
|
+
states
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Add the transitions to the State objects of this pattern. _states_ is a
|
|
104
|
+
# Hash with all State objects. _rules_ is a Hash with the Rule objects of
|
|
105
|
+
# the syntax. _stateStack_ is an Array of State objects that have been
|
|
106
|
+
# traversed before reaching this pattern. _sourceState_ is the State that
|
|
107
|
+
# the transition originates from. _destRule_, this pattern and _destIndex_
|
|
108
|
+
# describe the State the transition is leading to. _loopBack_ is boolean
|
|
109
|
+
# flag, set to true when the transition describes a loop back to the start
|
|
110
|
+
# of the Rule.
|
|
111
|
+
def addTransitionsToState(states, rules, stateStack, sourceState,
|
|
112
|
+
destRule, destIndex, loopBack)
|
|
113
|
+
# If we hit a token in the pattern that is optional, we need to consider
|
|
114
|
+
# the next token of the pattern as well.
|
|
115
|
+
loop do
|
|
116
|
+
if destIndex >= @tokens.length
|
|
117
|
+
# Have we reached the end of the pattern? Such state always trigger
|
|
118
|
+
# a reduce operation.
|
|
119
|
+
sourceState.noReduce = false
|
|
120
|
+
if sourceState.rule == destRule
|
|
121
|
+
if destRule.repeatable
|
|
122
|
+
# The transition leads us back to the start of the Rule. This
|
|
123
|
+
# will generate transitions to the first token of all patterns
|
|
124
|
+
# of this Rule.
|
|
125
|
+
destRule.addTransitionsToState(states, rules, [], sourceState,
|
|
126
|
+
true)
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
# We've reached the end of the pattern. No more transitions to
|
|
130
|
+
# consider.
|
|
131
|
+
return
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# The token descriptor tells us where the transition(s) need to go to.
|
|
135
|
+
tokenType, tokenName = token = @tokens[destIndex]
|
|
136
|
+
|
|
137
|
+
case tokenType
|
|
138
|
+
when :reference
|
|
139
|
+
# The descriptor references another rule.
|
|
140
|
+
unless (refRule = rules[tokenName])
|
|
141
|
+
raise "Unknown rule #{tokenName} referenced in rule #{refRule.name}"
|
|
142
|
+
end
|
|
143
|
+
# If we reference another rule from a pattern, we need to come back
|
|
144
|
+
# to the pattern once we are done with the referenced rule. To be
|
|
145
|
+
# able to come back, we collect a list of all the States that we
|
|
146
|
+
# have passed during a reference resolution. This list forms a stack
|
|
147
|
+
# that is popped during recude operations of the parser FSM.
|
|
148
|
+
skippedState = states[[ destRule, self, destIndex ]]
|
|
149
|
+
# Rules may reference themselves directly or indirectly. To avoid
|
|
150
|
+
# endless recursions of this algorithm, we stop once we have
|
|
151
|
+
# detected a recursion. We have already all necessary transitions
|
|
152
|
+
# collected. The recursion will be unrolled in the parser FSM.
|
|
153
|
+
unless stateStack.include?(skippedState)
|
|
154
|
+
# Push the skipped state on the stateStack before recursing.
|
|
155
|
+
stateStack.push(skippedState)
|
|
156
|
+
refRule.addTransitionsToState(states, rules, stateStack,
|
|
157
|
+
sourceState, loopBack)
|
|
158
|
+
# Once we're done, remove the State from the stateStack again.
|
|
159
|
+
stateStack.pop
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# If the referenced rule is not optional, we have no further
|
|
163
|
+
# transitions for this pattern at this destIndex.
|
|
164
|
+
break unless refRule.optional?(rules)
|
|
165
|
+
else
|
|
166
|
+
unless (destState = states[[ destRule, self, destIndex ]])
|
|
167
|
+
raise "Destination state not found"
|
|
168
|
+
end
|
|
169
|
+
# We've found a transition to a terminal token. Add the transition
|
|
170
|
+
# to the source State.
|
|
171
|
+
sourceState.addTransition(@tokens[destIndex], destState, stateStack,
|
|
172
|
+
loopBack)
|
|
173
|
+
# Fixed tokens are never optional. There are no more transitions for
|
|
174
|
+
# this pattern at this index.
|
|
175
|
+
break
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
destIndex += 1
|
|
179
|
+
end
|
|
73
180
|
end
|
|
74
181
|
|
|
75
182
|
# Set the keyword and documentation text for the pattern.
|
|
@@ -106,7 +213,7 @@ class TaskJuggler::TextParser
|
|
|
106
213
|
|
|
107
214
|
# Iterator for tokens.
|
|
108
215
|
def each
|
|
109
|
-
@tokens.each { |
|
|
216
|
+
@tokens.each { |type, name| yield(type, name) }
|
|
110
217
|
end
|
|
111
218
|
|
|
112
219
|
# Returns true of the pattern is empty.
|
|
@@ -122,12 +229,11 @@ class TaskJuggler::TextParser
|
|
|
122
229
|
# Return true if all tokens of the pattern are optional. If a token
|
|
123
230
|
# references a rule, this rule is followed for the check.
|
|
124
231
|
def optional?(rules)
|
|
125
|
-
@tokens.each do |
|
|
126
|
-
if
|
|
232
|
+
@tokens.each do |type, name|
|
|
233
|
+
if type == :literal || type == :variable
|
|
127
234
|
return false
|
|
128
|
-
elsif
|
|
129
|
-
|
|
130
|
-
if !rules[token].optional?(rules)
|
|
235
|
+
elsif type == :reference
|
|
236
|
+
if !rules[name].optional?(rules)
|
|
131
237
|
return false
|
|
132
238
|
end
|
|
133
239
|
end
|
|
@@ -137,32 +243,29 @@ class TaskJuggler::TextParser
|
|
|
137
243
|
|
|
138
244
|
# Returns true if the i-th token is a terminal symbol.
|
|
139
245
|
def terminalSymbol?(i)
|
|
140
|
-
@tokens[i][0] ==
|
|
246
|
+
@tokens[i][0] == :variable || @tokens[i][0] == :literal
|
|
141
247
|
end
|
|
142
248
|
|
|
143
249
|
# Find recursively the first terminal token of this pattern. If an index is
|
|
144
250
|
# specified start the search at this n-th pattern token instead of the
|
|
145
251
|
# first. The return value is an Array of [ token, pattern ] tuple.
|
|
146
252
|
def terminalTokens(rules, index = 0)
|
|
253
|
+
type, name = @tokens[index]
|
|
147
254
|
# Terminal token start with an underscore or dollar character.
|
|
148
|
-
if
|
|
149
|
-
return [ [
|
|
150
|
-
elsif
|
|
255
|
+
if type == :literal
|
|
256
|
+
return [ [ name, self ] ]
|
|
257
|
+
elsif type == :variable
|
|
151
258
|
return []
|
|
152
|
-
elsif
|
|
153
|
-
#
|
|
154
|
-
|
|
155
|
-
# get the rule name.
|
|
156
|
-
token = @tokens[index][1..-1]
|
|
157
|
-
# Then find the rule
|
|
158
|
-
rule = rules[token]
|
|
259
|
+
elsif type == :reference
|
|
260
|
+
# We have to continue the search at this rule.
|
|
261
|
+
rule = rules[name]
|
|
159
262
|
# The rule may only have a single pattern. If not, then this pattern
|
|
160
263
|
# has no terminal token.
|
|
161
264
|
tts = []
|
|
162
265
|
rule.patterns.each { |p| tts += p.terminalTokens(rules, 0) }
|
|
163
266
|
return tts
|
|
164
267
|
else
|
|
165
|
-
raise "Unexpected token #{
|
|
268
|
+
raise "Unexpected token #{type} #{name}"
|
|
166
269
|
end
|
|
167
270
|
end
|
|
168
271
|
|
|
@@ -173,6 +276,7 @@ class TaskJuggler::TextParser
|
|
|
173
276
|
to_syntax_r({}, argDocs, rules, skip)
|
|
174
277
|
end
|
|
175
278
|
|
|
279
|
+
# Generate a syntax description for this pattern.
|
|
176
280
|
def to_syntax_r(stack, argDocs, rules, skip)
|
|
177
281
|
# If we find ourself on the stack we hit a recursive pattern. This is used
|
|
178
282
|
# in repetitions.
|
|
@@ -187,20 +291,17 @@ class TaskJuggler::TextParser
|
|
|
187
291
|
first = true
|
|
188
292
|
# Analyze the tokens of the pattern skipping the first 'skip' tokens.
|
|
189
293
|
skip.upto(@lastSyntaxToken) do |i|
|
|
190
|
-
|
|
294
|
+
type, name = @tokens[i]
|
|
191
295
|
# If the first token is a _{ the pattern describes optional attributes.
|
|
192
296
|
# They are represented by a standard idiom.
|
|
193
297
|
if first
|
|
194
298
|
first = false
|
|
195
|
-
return '{ <attributes> }' if
|
|
299
|
+
return '{ <attributes> }' if name == '{'
|
|
196
300
|
else
|
|
197
301
|
# Separate the syntax elemens by a whitespace.
|
|
198
302
|
str << ' '
|
|
199
303
|
end
|
|
200
304
|
|
|
201
|
-
typeId = token[0]
|
|
202
|
-
token = token.slice(1, token.length - 1)
|
|
203
|
-
|
|
204
305
|
if @args[i]
|
|
205
306
|
# The argument is documented in the syntax definition. We copy the
|
|
206
307
|
# entry as we need to modify it.
|
|
@@ -209,8 +310,8 @@ class TaskJuggler::TextParser
|
|
|
209
310
|
# A documented argument without a name is a terminal token. We use the
|
|
210
311
|
# terminal symbol as name.
|
|
211
312
|
if @args[i].name.nil?
|
|
212
|
-
str << "#{
|
|
213
|
-
argDoc.name =
|
|
313
|
+
str << "#{name}"
|
|
314
|
+
argDoc.name = name
|
|
214
315
|
else
|
|
215
316
|
str << "<#{@args[i].name}>"
|
|
216
317
|
end
|
|
@@ -218,27 +319,27 @@ class TaskJuggler::TextParser
|
|
|
218
319
|
|
|
219
320
|
# Documented arguments don't have the type set yet. Use the token
|
|
220
321
|
# value for that.
|
|
221
|
-
if
|
|
222
|
-
argDoc.typeSpec = "<#{
|
|
322
|
+
if type == :variable
|
|
323
|
+
argDoc.typeSpec = "<#{name}>"
|
|
223
324
|
end
|
|
224
325
|
else
|
|
225
326
|
# Undocumented tokens are recursively expanded.
|
|
226
|
-
case
|
|
227
|
-
when
|
|
327
|
+
case type
|
|
328
|
+
when :literal
|
|
228
329
|
# Literals are shown as such.
|
|
229
|
-
str <<
|
|
230
|
-
when
|
|
330
|
+
str << name.to_s
|
|
331
|
+
when :variable
|
|
231
332
|
# Variables are enclosed by angle brackets.
|
|
232
|
-
str <<
|
|
233
|
-
when
|
|
234
|
-
if rules[
|
|
235
|
-
!rules[
|
|
236
|
-
addArgDoc(argDocs, TokenDoc.new(rules[
|
|
237
|
-
rules[
|
|
238
|
-
str << '<' + rules[
|
|
333
|
+
str << "<#{name}>"
|
|
334
|
+
when :reference
|
|
335
|
+
if rules[name].patterns.length == 1 &&
|
|
336
|
+
!rules[name].patterns[0].doc.nil?
|
|
337
|
+
addArgDoc(argDocs, TokenDoc.new(rules[name].patterns[0].keyword,
|
|
338
|
+
rules[name].patterns[0]))
|
|
339
|
+
str << '<' + rules[name].patterns[0].keyword + '>'
|
|
239
340
|
else
|
|
240
341
|
# References are followed recursively.
|
|
241
|
-
str << rules[
|
|
342
|
+
str << rules[name].to_syntax(stack, argDocs, rules, 0)
|
|
242
343
|
end
|
|
243
344
|
end
|
|
244
345
|
end
|
|
@@ -248,8 +349,26 @@ class TaskJuggler::TextParser
|
|
|
248
349
|
str
|
|
249
350
|
end
|
|
250
351
|
|
|
352
|
+
# Generate a text form of the pattern. This is similar to the syntax in
|
|
353
|
+
# the original syntax description.
|
|
251
354
|
def to_s
|
|
252
|
-
|
|
355
|
+
str = ""
|
|
356
|
+
@tokens.each do |type, name|
|
|
357
|
+
case type
|
|
358
|
+
when :reference
|
|
359
|
+
str += "!#{name} "
|
|
360
|
+
when :variable
|
|
361
|
+
str += "$#{name } "
|
|
362
|
+
when :literal
|
|
363
|
+
str += "#{name} "
|
|
364
|
+
when :eof
|
|
365
|
+
str += ". "
|
|
366
|
+
else
|
|
367
|
+
raise "Unknown type #{type}"
|
|
368
|
+
end
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
str
|
|
253
372
|
end
|
|
254
373
|
|
|
255
374
|
private
|
data/lib/TextParser/Rule.rb
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
# published by the Free Software Foundation.
|
|
11
11
|
#
|
|
12
12
|
|
|
13
|
+
require 'TextParser/State'
|
|
14
|
+
|
|
13
15
|
class TaskJuggler::TextParser
|
|
14
16
|
|
|
15
17
|
# The TextParserRule holds the basic elment of the syntax description. Each
|
|
@@ -25,7 +27,6 @@ class TaskJuggler::TextParser
|
|
|
25
27
|
class Rule
|
|
26
28
|
|
|
27
29
|
attr_reader :name, :patterns, :optional, :repeatable, :keyword, :doc
|
|
28
|
-
attr_accessor :transitions
|
|
29
30
|
|
|
30
31
|
# Create a new syntax rule called +name+.
|
|
31
32
|
def initialize(name)
|
|
@@ -33,11 +34,16 @@ class TaskJuggler::TextParser
|
|
|
33
34
|
@patterns = []
|
|
34
35
|
@repeatable = false
|
|
35
36
|
@optional = false
|
|
36
|
-
@transitions = []
|
|
37
|
-
# In case a rule is optional or any of the patterns is fully optional,
|
|
38
|
-
# this variable is set to true.
|
|
39
|
-
@transitiveOptional = nil
|
|
40
37
|
@keyword = nil
|
|
38
|
+
|
|
39
|
+
flushCache
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def flushCache
|
|
43
|
+
# A rule is considered to describe optional tokens in case the @optional
|
|
44
|
+
# flag is set or all of the patterns reference optional rules again.
|
|
45
|
+
# This variable caches the transitively determined optional value.
|
|
46
|
+
@transitiveOptional = nil
|
|
41
47
|
end
|
|
42
48
|
|
|
43
49
|
# Add a new +pattern+ to the Rule. It should be of type
|
|
@@ -71,6 +77,28 @@ class TaskJuggler::TextParser
|
|
|
71
77
|
end
|
|
72
78
|
end
|
|
73
79
|
|
|
80
|
+
def generateStates
|
|
81
|
+
# First, add an entry State for this rule. Entry states are never
|
|
82
|
+
# reached by normal state transitions. They are only used as (re-)start
|
|
83
|
+
# states.
|
|
84
|
+
states = [ State.new(self) ]
|
|
85
|
+
|
|
86
|
+
@patterns.each do |pattern|
|
|
87
|
+
states += pattern.generateStates(self)
|
|
88
|
+
end
|
|
89
|
+
states
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Return a Hash of all state transitions caused by the 1st token of each
|
|
93
|
+
# pattern of this rule.
|
|
94
|
+
def addTransitionsToState(states, rules, stateStack, sourceState,
|
|
95
|
+
loopBack)
|
|
96
|
+
@patterns.each do |pattern|
|
|
97
|
+
pattern.addTransitionsToState(states, rules, stateStack.dup, sourceState,
|
|
98
|
+
self, 0, loopBack)
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
74
102
|
# Mark the syntax element described by this Rule as a repeatable element
|
|
75
103
|
# that can occur once or more times in sequence.
|
|
76
104
|
def setRepeatable
|
|
@@ -117,18 +145,6 @@ class TaskJuggler::TextParser
|
|
|
117
145
|
@patterns[idx]
|
|
118
146
|
end
|
|
119
147
|
|
|
120
|
-
# Return the pattern of this rule that matches the given +token+. If no
|
|
121
|
-
# pattern matches, return nil.
|
|
122
|
-
def matchingPatternIndex(token)
|
|
123
|
-
i = 0
|
|
124
|
-
@transitions.each do |t|
|
|
125
|
-
return i if t.has_key?(token)
|
|
126
|
-
i += 1
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
nil
|
|
130
|
-
end
|
|
131
|
-
|
|
132
148
|
def to_syntax(stack, docs, rules, skip)
|
|
133
149
|
str = ''
|
|
134
150
|
str << '[' if @optional || @repeatable
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
# published by the Free Software Foundation.
|
|
11
11
|
#
|
|
12
12
|
|
|
13
|
+
require 'SourceFileInfo'
|
|
14
|
+
|
|
13
15
|
class TaskJuggler::TextParser
|
|
14
16
|
|
|
15
17
|
# This class models the elements of the stack that the TextParser uses to keep
|
|
@@ -18,22 +20,52 @@ class TaskJuggler::TextParser
|
|
|
18
20
|
# also store the function that must be called to store the collected values.
|
|
19
21
|
class StackElement
|
|
20
22
|
|
|
21
|
-
attr_reader :val, :
|
|
23
|
+
attr_reader :val, :function, :sourceFileInfo, :firstSourceFileInfo
|
|
24
|
+
attr_accessor :state
|
|
22
25
|
|
|
23
26
|
# Create a new stack element. _rule_ is the TextParserRule that triggered
|
|
24
27
|
# the creation of this element. _function_ is the function that will be
|
|
25
28
|
# called at the end to store the collected data. _sourceFileInfo_ is a
|
|
26
29
|
# SourceFileInfo reference that describes the TextScanner position when the
|
|
27
30
|
# rule was entered.
|
|
28
|
-
def initialize(function)
|
|
31
|
+
def initialize(function, state = nil)
|
|
29
32
|
# This Array stores the collected values.
|
|
30
33
|
@val = []
|
|
31
34
|
# Array to store the source file references for the collected values.
|
|
32
35
|
@sourceFileInfo = []
|
|
36
|
+
# A shortcut to the first non-nil sourceFileInfo.
|
|
37
|
+
@firstSourceFileInfo = nil
|
|
33
38
|
# Counter used for StackElement::store()
|
|
34
39
|
@position = 0
|
|
35
40
|
# The method that will process the collected values.
|
|
36
41
|
@function = function
|
|
42
|
+
@state = state
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Insert the value _val_ at the position _index_. It also stores the
|
|
46
|
+
# _sourceFileInfo_ for this element. In case _multiValue_ is true, the
|
|
47
|
+
# old value is not overwritten, but values are stored in an
|
|
48
|
+
# TextParserResultArray object.
|
|
49
|
+
def insert(index, val, sourceFileInfo, multiValue)
|
|
50
|
+
if multiValue
|
|
51
|
+
if @val[index]
|
|
52
|
+
# We already have a value for this token position.
|
|
53
|
+
unless @val[index].is_a?(TextParserResultArray)
|
|
54
|
+
# This should never happen.
|
|
55
|
+
raise "#{@val[index].class} must be an Array"
|
|
56
|
+
end
|
|
57
|
+
else
|
|
58
|
+
@val[index] = TextParserResultArray.new
|
|
59
|
+
end
|
|
60
|
+
# Just append the value and apply the special Array merging.
|
|
61
|
+
@val[index] << val
|
|
62
|
+
else
|
|
63
|
+
@val[index] = val
|
|
64
|
+
end
|
|
65
|
+
@sourceFileInfo[index] = sourceFileInfo
|
|
66
|
+
# Store the first SFI for faster access.
|
|
67
|
+
@firstSourceFileInfo = sourceFileInfo unless @firstSourceFileInfo
|
|
68
|
+
val
|
|
37
69
|
end
|
|
38
70
|
|
|
39
71
|
# Store a collected value and move the position to the next pattern.
|
|
@@ -43,6 +75,14 @@ class TaskJuggler::TextParser
|
|
|
43
75
|
@position += 1
|
|
44
76
|
end
|
|
45
77
|
|
|
78
|
+
def each
|
|
79
|
+
@val.each { |x| yield x }
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def length
|
|
83
|
+
@val.length
|
|
84
|
+
end
|
|
85
|
+
|
|
46
86
|
end
|
|
47
87
|
|
|
48
88
|
end
|