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
|
@@ -75,10 +75,14 @@
|
|
|
75
75
|
|
|
76
76
|
<li><a href="#method-i-addArgDoc">#addArgDoc</a></li>
|
|
77
77
|
|
|
78
|
+
<li><a href="#method-i-addTransitionsToState">#addTransitionsToState</a></li>
|
|
79
|
+
|
|
78
80
|
<li><a href="#method-i-each">#each</a></li>
|
|
79
81
|
|
|
80
82
|
<li><a href="#method-i-empty%3F">#empty?</a></li>
|
|
81
83
|
|
|
84
|
+
<li><a href="#method-i-generateStates">#generateStates</a></li>
|
|
85
|
+
|
|
82
86
|
<li><a href="#method-i-length">#length</a></li>
|
|
83
87
|
|
|
84
88
|
<li><a href="#method-i-optional%3F">#optional?</a></li>
|
|
@@ -181,12 +185,18 @@
|
|
|
181
185
|
|
|
182
186
|
<li><a href="../../TaskJuggler/ChargeSetListAttribute.html">TaskJuggler::ChargeSetListAttribute</a></li>
|
|
183
187
|
|
|
188
|
+
<li><a href="../../TaskJuggler/CollisionDetector.html">TaskJuggler::CollisionDetector</a></li>
|
|
189
|
+
|
|
184
190
|
<li><a href="../../TaskJuggler/ColumnListAttribute.html">TaskJuggler::ColumnListAttribute</a></li>
|
|
185
191
|
|
|
186
192
|
<li><a href="../../TaskJuggler/ColumnTable.html">TaskJuggler::ColumnTable</a></li>
|
|
187
193
|
|
|
188
194
|
<li><a href="../../TaskJuggler/Daemon.html">TaskJuggler::Daemon</a></li>
|
|
189
195
|
|
|
196
|
+
<li><a href="../../TaskJuggler/DataCache.html">TaskJuggler::DataCache</a></li>
|
|
197
|
+
|
|
198
|
+
<li><a href="../../TaskJuggler/DataCacheEntry.html">TaskJuggler::DataCacheEntry</a></li>
|
|
199
|
+
|
|
190
200
|
<li><a href="../../TaskJuggler/DateAttribute.html">TaskJuggler::DateAttribute</a></li>
|
|
191
201
|
|
|
192
202
|
<li><a href="../../TaskJuggler/DefinitionListAttribute.html">TaskJuggler::DefinitionListAttribute</a></li>
|
|
@@ -293,7 +303,7 @@
|
|
|
293
303
|
|
|
294
304
|
<li><a href="../../TaskJuggler/NodeListAttribute.html">TaskJuggler::NodeListAttribute</a></li>
|
|
295
305
|
|
|
296
|
-
<li><a href="../../TaskJuggler/
|
|
306
|
+
<li><a href="../../TaskJuggler/PlaceHolderCell.html">TaskJuggler::PlaceHolderCell</a></li>
|
|
297
307
|
|
|
298
308
|
<li><a href="../../TaskJuggler/ProcessIntercom.html">TaskJuggler::ProcessIntercom</a></li>
|
|
299
309
|
|
|
@@ -473,6 +483,10 @@
|
|
|
473
483
|
|
|
474
484
|
<li><a href="../../TaskJuggler/TextParser/StackElement.html">TaskJuggler::TextParser::StackElement</a></li>
|
|
475
485
|
|
|
486
|
+
<li><a href="../../TaskJuggler/TextParser/State.html">TaskJuggler::TextParser::State</a></li>
|
|
487
|
+
|
|
488
|
+
<li><a href="../../TaskJuggler/TextParser/StateTransition.html">TaskJuggler::TextParser::StateTransition</a></li>
|
|
489
|
+
|
|
476
490
|
<li><a href="../../TaskJuggler/TextParser/TextParserResultArray.html">TaskJuggler::TextParser::TextParserResultArray</a></li>
|
|
477
491
|
|
|
478
492
|
<li><a href="../../TaskJuggler/TextParser/TokenDoc.html">TaskJuggler::TextParser::TokenDoc</a></li>
|
|
@@ -586,21 +600,21 @@ are Strings where the first character determines the type of the token.
|
|
|
586
600
|
There are 4 known types.
|
|
587
601
|
</p>
|
|
588
602
|
<p>
|
|
589
|
-
Terminal token:
|
|
590
|
-
tokens are terminal symbols of the syntax tree.
|
|
591
|
-
themselves.
|
|
603
|
+
Terminal token: In the syntax declaration the terminal token is prefixed by
|
|
604
|
+
an underscore. Terminal tokens are terminal symbols of the syntax tree.
|
|
605
|
+
They just represent themselves.
|
|
592
606
|
</p>
|
|
593
607
|
<p>
|
|
594
608
|
Variable token: The variable token describes values of a certain class such
|
|
595
|
-
as strings or numbers.
|
|
596
|
-
of the token specifies the variable type. See <a
|
|
609
|
+
as strings or numbers. In the syntax declaration the token is prefixed by a
|
|
610
|
+
dollar sign and the text of the token specifies the variable type. See <a
|
|
597
611
|
href="../ProjectFileParser.html">ProjectFileParser</a> for a complete list
|
|
598
612
|
of variable types.
|
|
599
613
|
</p>
|
|
600
614
|
<p>
|
|
601
615
|
Reference token: The reference token specifies a reference to another
|
|
602
|
-
parser rule.
|
|
603
|
-
of the rule. See TextParserRule for details.
|
|
616
|
+
parser rule. In the syntax declaration the token is prefixed by a bang and
|
|
617
|
+
the text matches the name of the rule. See TextParserRule for details.
|
|
604
618
|
</p>
|
|
605
619
|
<p>
|
|
606
620
|
End token: The . token marks the expected end of the input stream.
|
|
@@ -755,37 +769,55 @@ documentary information about the pattern.
|
|
|
755
769
|
<div class="method-source-code"
|
|
756
770
|
id="new-source">
|
|
757
771
|
<pre>
|
|
758
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
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
|
-
|
|
787
|
-
|
|
788
|
-
|
|
772
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 45</span>
|
|
773
|
+
45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">tokens</span>, <span class="ruby-identifier">function</span> = <span class="ruby-keyword kw">nil</span>)
|
|
774
|
+
46: <span class="ruby-comment cmt"># A unique name for the pattern that is used in the documentation.</span>
|
|
775
|
+
47: <span class="ruby-ivar">@keyword</span> = <span class="ruby-keyword kw">nil</span>
|
|
776
|
+
48: <span class="ruby-comment cmt"># Initialize pattern doc as empty.</span>
|
|
777
|
+
49: <span class="ruby-ivar">@doc</span> = <span class="ruby-keyword kw">nil</span>
|
|
778
|
+
50: <span class="ruby-comment cmt"># A list of TokenDoc elements that describe the meaning of variable</span>
|
|
779
|
+
51: <span class="ruby-comment cmt"># tokens. The order of the tokens and entries in the Array must correlate.</span>
|
|
780
|
+
52: <span class="ruby-ivar">@args</span> = []
|
|
781
|
+
53: <span class="ruby-comment cmt"># A list of references to other patterns that are related to this pattern.</span>
|
|
782
|
+
54: <span class="ruby-ivar">@seeAlso</span> = []
|
|
783
|
+
55: <span class="ruby-comment cmt"># A reference to a file under test/TestSuite/Syntax/Correct and a tag</span>
|
|
784
|
+
56: <span class="ruby-comment cmt"># within that file. This identifies example TJP code to be included with</span>
|
|
785
|
+
57: <span class="ruby-comment cmt"># the reference manual.</span>
|
|
786
|
+
58: <span class="ruby-ivar">@exampleFile</span> = <span class="ruby-keyword kw">nil</span>
|
|
787
|
+
59: <span class="ruby-ivar">@exampleTag</span> = <span class="ruby-keyword kw">nil</span>
|
|
788
|
+
60:
|
|
789
|
+
61: <span class="ruby-ivar">@tokens</span> = []
|
|
790
|
+
62: <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">token</span><span class="ruby-operator">|</span>
|
|
791
|
+
63: <span class="ruby-keyword kw">unless</span> <span class="ruby-value str">'!$_.'</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">token</span>[<span class="ruby-value">0</span>])
|
|
792
|
+
64: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Fatal Error: All pattern tokens must start with a type "</span> <span class="ruby-operator">+</span>
|
|
793
|
+
65: <span class="ruby-node">"identifier [!$_.]: #{tokens.join(', ')}"</span>
|
|
794
|
+
66: <span class="ruby-keyword kw">end</span>
|
|
795
|
+
67: <span class="ruby-comment cmt"># For the syntax specification using a prefix character is more</span>
|
|
796
|
+
68: <span class="ruby-comment cmt"># convenient. But for further processing, we need to split the string</span>
|
|
797
|
+
69: <span class="ruby-comment cmt"># into two symbols. The prefix determines the token type, the rest is</span>
|
|
798
|
+
70: <span class="ruby-comment cmt"># the token name. There are 4 types of tokens:</span>
|
|
799
|
+
71: <span class="ruby-comment cmt"># :reference : a reference to another rule</span>
|
|
800
|
+
72: <span class="ruby-comment cmt"># :variable : a terminal symbol</span>
|
|
801
|
+
73: <span class="ruby-comment cmt"># :literal : a user defined string</span>
|
|
802
|
+
74: <span class="ruby-comment cmt"># :eof : marks the end of an input stream</span>
|
|
803
|
+
75: <span class="ruby-identifier">type</span> = [ <span class="ruby-value">:reference</span>, <span class="ruby-value">:variable</span>, <span class="ruby-value">:literal</span>, <span class="ruby-value">:eof</span> ][<span class="ruby-value str">'!$_.'</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">token</span>[<span class="ruby-value">0</span>])]
|
|
804
|
+
76: <span class="ruby-comment cmt"># For literals we use a String to store the token content. For others,</span>
|
|
805
|
+
77: <span class="ruby-comment cmt"># a symbol is better suited.</span>
|
|
806
|
+
78: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:literal</span> <span class="ruby-operator">?</span>
|
|
807
|
+
79: <span class="ruby-identifier">token</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">1</span>] <span class="ruby-operator">:</span> (<span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:eof</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'<END>'</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">token</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">1</span>].<span class="ruby-identifier">intern</span>)
|
|
808
|
+
80: <span class="ruby-comment cmt"># We favor an Array to store the 2 elements over a Hash for</span>
|
|
809
|
+
81: <span class="ruby-comment cmt"># performance reasons.</span>
|
|
810
|
+
82: <span class="ruby-ivar">@tokens</span> <span class="ruby-operator"><<</span> [ <span class="ruby-identifier">type</span>, <span class="ruby-identifier">name</span> ]
|
|
811
|
+
83: <span class="ruby-comment cmt"># Initialize pattern argument descriptions as empty.</span>
|
|
812
|
+
84: <span class="ruby-ivar">@args</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">nil</span>
|
|
813
|
+
85: <span class="ruby-keyword kw">end</span>
|
|
814
|
+
86: <span class="ruby-ivar">@function</span> = <span class="ruby-identifier">function</span>
|
|
815
|
+
87: <span class="ruby-comment cmt"># In some cases we don't want to show all tokens in the syntax</span>
|
|
816
|
+
88: <span class="ruby-comment cmt"># documentation. This value specifies the index of the last shown token.</span>
|
|
817
|
+
89: <span class="ruby-ivar">@lastSyntaxToken</span> = <span class="ruby-ivar">@tokens</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
|
818
|
+
90:
|
|
819
|
+
91: <span class="ruby-ivar">@transitions</span> = []
|
|
820
|
+
92: <span class="ruby-keyword kw">end</span></pre>
|
|
789
821
|
</div>
|
|
790
822
|
|
|
791
823
|
</div>
|
|
@@ -824,10 +856,123 @@ Conveniance function to access individual tokens by index.
|
|
|
824
856
|
<div class="method-source-code"
|
|
825
857
|
id="--source">
|
|
826
858
|
<pre>
|
|
827
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
859
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 210</span>
|
|
860
|
+
210: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">i</span>)
|
|
861
|
+
211: <span class="ruby-ivar">@tokens</span>[<span class="ruby-identifier">i</span>]
|
|
862
|
+
212: <span class="ruby-keyword kw">end</span></pre>
|
|
863
|
+
</div>
|
|
864
|
+
|
|
865
|
+
</div>
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
</div>
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
<div id="add-ransitions-o-tate-method" class="method-detail ">
|
|
874
|
+
<a name="method-i-addTransitionsToState"></a>
|
|
875
|
+
|
|
876
|
+
<div class="method-heading">
|
|
877
|
+
|
|
878
|
+
<span class="method-name">addTransitionsToState</span><span
|
|
879
|
+
class="method-args">(states, rules, stateStack, sourceState, destRule, destIndex, loopBack)</span>
|
|
880
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
881
|
+
|
|
882
|
+
</div>
|
|
883
|
+
|
|
884
|
+
<div class="method-description">
|
|
885
|
+
|
|
886
|
+
<p>
|
|
887
|
+
Add the transitions to the <a href="State.html">State</a> objects of this
|
|
888
|
+
pattern. <em>states</em> is a Hash with all <a href="State.html">State</a>
|
|
889
|
+
objects. <em>rules</em> is a Hash with the <a href="Rule.html">Rule</a>
|
|
890
|
+
objects of the syntax. <em>stateStack</em> is an Array of <a
|
|
891
|
+
href="State.html">State</a> objects that have been traversed before
|
|
892
|
+
reaching this pattern. <em>sourceState</em> is the <a
|
|
893
|
+
href="State.html">State</a> that the transition originates from.
|
|
894
|
+
<em>destRule</em>, this pattern and <em>destIndex</em> describe the <a
|
|
895
|
+
href="State.html">State</a> the transition is leading to. <em>loopBack</em>
|
|
896
|
+
is boolean flag, set to true when the transition describes a loop back to
|
|
897
|
+
the start of the <a href="Rule.html">Rule</a>.
|
|
898
|
+
</p>
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
<div class="method-source-code"
|
|
903
|
+
id="add-ransitions-o-tate-source">
|
|
904
|
+
<pre>
|
|
905
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 111</span>
|
|
906
|
+
111: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">addTransitionsToState</span>(<span class="ruby-identifier">states</span>, <span class="ruby-identifier">rules</span>, <span class="ruby-identifier">stateStack</span>, <span class="ruby-identifier">sourceState</span>,
|
|
907
|
+
112: <span class="ruby-identifier">destRule</span>, <span class="ruby-identifier">destIndex</span>, <span class="ruby-identifier">loopBack</span>)
|
|
908
|
+
113: <span class="ruby-comment cmt"># If we hit a token in the pattern that is optional, we need to consider</span>
|
|
909
|
+
114: <span class="ruby-comment cmt"># the next token of the pattern as well.</span>
|
|
910
|
+
115: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
|
|
911
|
+
116: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">destIndex</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@tokens</span>.<span class="ruby-identifier">length</span>
|
|
912
|
+
117: <span class="ruby-comment cmt"># Have we reached the end of the pattern? Such state always trigger</span>
|
|
913
|
+
118: <span class="ruby-comment cmt"># a reduce operation.</span>
|
|
914
|
+
119: <span class="ruby-identifier">sourceState</span>.<span class="ruby-identifier">noReduce</span> = <span class="ruby-keyword kw">false</span>
|
|
915
|
+
120: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sourceState</span>.<span class="ruby-identifier">rule</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">destRule</span>
|
|
916
|
+
121: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">destRule</span>.<span class="ruby-identifier">repeatable</span>
|
|
917
|
+
122: <span class="ruby-comment cmt"># The transition leads us back to the start of the Rule. This</span>
|
|
918
|
+
123: <span class="ruby-comment cmt"># will generate transitions to the first token of all patterns</span>
|
|
919
|
+
124: <span class="ruby-comment cmt"># of this Rule.</span>
|
|
920
|
+
125: <span class="ruby-identifier">destRule</span>.<span class="ruby-identifier">addTransitionsToState</span>(<span class="ruby-identifier">states</span>, <span class="ruby-identifier">rules</span>, [], <span class="ruby-identifier">sourceState</span>,
|
|
921
|
+
126: <span class="ruby-keyword kw">true</span>)
|
|
922
|
+
127: <span class="ruby-keyword kw">end</span>
|
|
923
|
+
128: <span class="ruby-keyword kw">end</span>
|
|
924
|
+
129: <span class="ruby-comment cmt"># We've reached the end of the pattern. No more transitions to</span>
|
|
925
|
+
130: <span class="ruby-comment cmt"># consider.</span>
|
|
926
|
+
131: <span class="ruby-keyword kw">return</span>
|
|
927
|
+
132: <span class="ruby-keyword kw">end</span>
|
|
928
|
+
133:
|
|
929
|
+
134: <span class="ruby-comment cmt"># The token descriptor tells us where the transition(s) need to go to.</span>
|
|
930
|
+
135: <span class="ruby-identifier">tokenType</span>, <span class="ruby-identifier">tokenName</span> = <span class="ruby-identifier">token</span> = <span class="ruby-ivar">@tokens</span>[<span class="ruby-identifier">destIndex</span>]
|
|
931
|
+
136:
|
|
932
|
+
137: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">tokenType</span>
|
|
933
|
+
138: <span class="ruby-keyword kw">when</span> <span class="ruby-value">:reference</span>
|
|
934
|
+
139: <span class="ruby-comment cmt"># The descriptor references another rule.</span>
|
|
935
|
+
140: <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">refRule</span> = <span class="ruby-identifier">rules</span>[<span class="ruby-identifier">tokenName</span>])
|
|
936
|
+
141: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Unknown rule #{tokenName} referenced in rule #{refRule.name}"</span>
|
|
937
|
+
142: <span class="ruby-keyword kw">end</span>
|
|
938
|
+
143: <span class="ruby-comment cmt"># If we reference another rule from a pattern, we need to come back</span>
|
|
939
|
+
144: <span class="ruby-comment cmt"># to the pattern once we are done with the referenced rule. To be</span>
|
|
940
|
+
145: <span class="ruby-comment cmt"># able to come back, we collect a list of all the States that we</span>
|
|
941
|
+
146: <span class="ruby-comment cmt"># have passed during a reference resolution. This list forms a stack</span>
|
|
942
|
+
147: <span class="ruby-comment cmt"># that is popped during recude operations of the parser FSM.</span>
|
|
943
|
+
148: <span class="ruby-identifier">skippedState</span> = <span class="ruby-identifier">states</span>[[ <span class="ruby-identifier">destRule</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">destIndex</span> ]]
|
|
944
|
+
149: <span class="ruby-comment cmt"># Rules may reference themselves directly or indirectly. To avoid</span>
|
|
945
|
+
150: <span class="ruby-comment cmt"># endless recursions of this algorithm, we stop once we have</span>
|
|
946
|
+
151: <span class="ruby-comment cmt"># detected a recursion. We have already all necessary transitions</span>
|
|
947
|
+
152: <span class="ruby-comment cmt"># collected. The recursion will be unrolled in the parser FSM.</span>
|
|
948
|
+
153: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">stateStack</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">skippedState</span>)
|
|
949
|
+
154: <span class="ruby-comment cmt"># Push the skipped state on the stateStack before recursing.</span>
|
|
950
|
+
155: <span class="ruby-identifier">stateStack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">skippedState</span>)
|
|
951
|
+
156: <span class="ruby-identifier">refRule</span>.<span class="ruby-identifier">addTransitionsToState</span>(<span class="ruby-identifier">states</span>, <span class="ruby-identifier">rules</span>, <span class="ruby-identifier">stateStack</span>,
|
|
952
|
+
157: <span class="ruby-identifier">sourceState</span>, <span class="ruby-identifier">loopBack</span>)
|
|
953
|
+
158: <span class="ruby-comment cmt"># Once we're done, remove the State from the stateStack again.</span>
|
|
954
|
+
159: <span class="ruby-identifier">stateStack</span>.<span class="ruby-identifier">pop</span>
|
|
955
|
+
160: <span class="ruby-keyword kw">end</span>
|
|
956
|
+
161:
|
|
957
|
+
162: <span class="ruby-comment cmt"># If the referenced rule is not optional, we have no further</span>
|
|
958
|
+
163: <span class="ruby-comment cmt"># transitions for this pattern at this destIndex.</span>
|
|
959
|
+
164: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">refRule</span>.<span class="ruby-identifier">optional?</span>(<span class="ruby-identifier">rules</span>)
|
|
960
|
+
165: <span class="ruby-keyword kw">else</span>
|
|
961
|
+
166: <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">destState</span> = <span class="ruby-identifier">states</span>[[ <span class="ruby-identifier">destRule</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">destIndex</span> ]])
|
|
962
|
+
167: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Destination state not found"</span>
|
|
963
|
+
168: <span class="ruby-keyword kw">end</span>
|
|
964
|
+
169: <span class="ruby-comment cmt"># We've found a transition to a terminal token. Add the transition</span>
|
|
965
|
+
170: <span class="ruby-comment cmt"># to the source State.</span>
|
|
966
|
+
171: <span class="ruby-identifier">sourceState</span>.<span class="ruby-identifier">addTransition</span>(<span class="ruby-ivar">@tokens</span>[<span class="ruby-identifier">destIndex</span>], <span class="ruby-identifier">destState</span>, <span class="ruby-identifier">stateStack</span>,
|
|
967
|
+
172: <span class="ruby-identifier">loopBack</span>)
|
|
968
|
+
173: <span class="ruby-comment cmt"># Fixed tokens are never optional. There are no more transitions for</span>
|
|
969
|
+
174: <span class="ruby-comment cmt"># this pattern at this index.</span>
|
|
970
|
+
175: <span class="ruby-keyword kw">break</span>
|
|
971
|
+
176: <span class="ruby-keyword kw">end</span>
|
|
972
|
+
177:
|
|
973
|
+
178: <span class="ruby-identifier">destIndex</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
974
|
+
179: <span class="ruby-keyword kw">end</span>
|
|
975
|
+
180: <span class="ruby-keyword kw">end</span></pre>
|
|
831
976
|
</div>
|
|
832
977
|
|
|
833
978
|
</div>
|
|
@@ -860,10 +1005,10 @@ Iterator for tokens.
|
|
|
860
1005
|
<div class="method-source-code"
|
|
861
1006
|
id="each-source">
|
|
862
1007
|
<pre>
|
|
863
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1008
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 215</span>
|
|
1009
|
+
215: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>
|
|
1010
|
+
216: <span class="ruby-ivar">@tokens</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">type</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">name</span>) }
|
|
1011
|
+
217: <span class="ruby-keyword kw">end</span></pre>
|
|
867
1012
|
</div>
|
|
868
1013
|
|
|
869
1014
|
</div>
|
|
@@ -896,10 +1041,50 @@ Returns true of the pattern is empty.
|
|
|
896
1041
|
<div class="method-source-code"
|
|
897
1042
|
id="empty--source">
|
|
898
1043
|
<pre>
|
|
899
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1044
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 220</span>
|
|
1045
|
+
220: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">empty?</span>
|
|
1046
|
+
221: <span class="ruby-ivar">@tokens</span>.<span class="ruby-identifier">empty?</span>
|
|
1047
|
+
222: <span class="ruby-keyword kw">end</span></pre>
|
|
1048
|
+
</div>
|
|
1049
|
+
|
|
1050
|
+
</div>
|
|
1051
|
+
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
</div>
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
<div id="generate-tates-method" class="method-detail ">
|
|
1059
|
+
<a name="method-i-generateStates"></a>
|
|
1060
|
+
|
|
1061
|
+
<div class="method-heading">
|
|
1062
|
+
|
|
1063
|
+
<span class="method-name">generateStates</span><span
|
|
1064
|
+
class="method-args">(rule)</span>
|
|
1065
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1066
|
+
|
|
1067
|
+
</div>
|
|
1068
|
+
|
|
1069
|
+
<div class="method-description">
|
|
1070
|
+
|
|
1071
|
+
<p>
|
|
1072
|
+
Generate the state machine states for the pattern. <em>rule</em> is the <a
|
|
1073
|
+
href="Rule.html">Rule</a> that the pattern belongs to. A list of generated
|
|
1074
|
+
<a href="State.html">State</a> objects will be returned.
|
|
1075
|
+
</p>
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
<div class="method-source-code"
|
|
1080
|
+
id="generate-tates-source">
|
|
1081
|
+
<pre>
|
|
1082
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 97</span>
|
|
1083
|
+
97: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generateStates</span>(<span class="ruby-identifier">rule</span>)
|
|
1084
|
+
98: <span class="ruby-identifier">states</span> = []
|
|
1085
|
+
99: <span class="ruby-ivar">@tokens</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">states</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">State</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rule</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">i</span>) }
|
|
1086
|
+
100: <span class="ruby-identifier">states</span>
|
|
1087
|
+
101: <span class="ruby-keyword kw">end</span></pre>
|
|
903
1088
|
</div>
|
|
904
1089
|
|
|
905
1090
|
</div>
|
|
@@ -932,10 +1117,10 @@ Returns the number of tokens in the pattern.
|
|
|
932
1117
|
<div class="method-source-code"
|
|
933
1118
|
id="length-source">
|
|
934
1119
|
<pre>
|
|
935
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1120
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 225</span>
|
|
1121
|
+
225: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">length</span>
|
|
1122
|
+
226: <span class="ruby-ivar">@tokens</span>.<span class="ruby-identifier">length</span>
|
|
1123
|
+
227: <span class="ruby-keyword kw">end</span></pre>
|
|
939
1124
|
</div>
|
|
940
1125
|
|
|
941
1126
|
</div>
|
|
@@ -969,20 +1154,19 @@ references a rule, this rule is followed for the check.
|
|
|
969
1154
|
<div class="method-source-code"
|
|
970
1155
|
id="optional--source">
|
|
971
1156
|
<pre>
|
|
972
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
136: <span class="ruby-keyword kw">end</span></pre>
|
|
1157
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 231</span>
|
|
1158
|
+
231: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">optional?</span>(<span class="ruby-identifier">rules</span>)
|
|
1159
|
+
232: <span class="ruby-ivar">@tokens</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">type</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
|
1160
|
+
233: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:literal</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:variable</span>
|
|
1161
|
+
234: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
|
1162
|
+
235: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:reference</span>
|
|
1163
|
+
236: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">rules</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">optional?</span>(<span class="ruby-identifier">rules</span>)
|
|
1164
|
+
237: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
|
1165
|
+
238: <span class="ruby-keyword kw">end</span>
|
|
1166
|
+
239: <span class="ruby-keyword kw">end</span>
|
|
1167
|
+
240: <span class="ruby-keyword kw">end</span>
|
|
1168
|
+
241: <span class="ruby-keyword kw">true</span>
|
|
1169
|
+
242: <span class="ruby-keyword kw">end</span></pre>
|
|
986
1170
|
</div>
|
|
987
1171
|
|
|
988
1172
|
</div>
|
|
@@ -1015,10 +1199,10 @@ Set the documentation text and for the idx-th variable.
|
|
|
1015
1199
|
<div class="method-source-code"
|
|
1016
1200
|
id="set-rg-source">
|
|
1017
1201
|
<pre>
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1202
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 189</span>
|
|
1203
|
+
189: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setArg</span>(<span class="ruby-identifier">idx</span>, <span class="ruby-identifier">doc</span>)
|
|
1204
|
+
190: <span class="ruby-ivar">@args</span>[<span class="ruby-identifier">idx</span>] = <span class="ruby-identifier">doc</span>
|
|
1205
|
+
191: <span class="ruby-keyword kw">end</span></pre>
|
|
1022
1206
|
</div>
|
|
1023
1207
|
|
|
1024
1208
|
</div>
|
|
@@ -1051,11 +1235,11 @@ Set the keyword and documentation text for the pattern.
|
|
|
1051
1235
|
<div class="method-source-code"
|
|
1052
1236
|
id="set-oc-source">
|
|
1053
1237
|
<pre>
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1238
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 183</span>
|
|
1239
|
+
183: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setDoc</span>(<span class="ruby-identifier">keyword</span>, <span class="ruby-identifier">doc</span>)
|
|
1240
|
+
184: <span class="ruby-ivar">@keyword</span> = <span class="ruby-identifier">keyword</span>
|
|
1241
|
+
185: <span class="ruby-ivar">@doc</span> = <span class="ruby-identifier">doc</span>
|
|
1242
|
+
186: <span class="ruby-keyword kw">end</span></pre>
|
|
1059
1243
|
</div>
|
|
1060
1244
|
|
|
1061
1245
|
</div>
|
|
@@ -1088,11 +1272,11 @@ Set the file and tag for the TJP code example.
|
|
|
1088
1272
|
<div class="method-source-code"
|
|
1089
1273
|
id="set-xample-source">
|
|
1090
1274
|
<pre>
|
|
1091
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1275
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 204</span>
|
|
1276
|
+
204: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setExample</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">tag</span>)
|
|
1277
|
+
205: <span class="ruby-ivar">@exampleFile</span> = <span class="ruby-identifier">file</span>
|
|
1278
|
+
206: <span class="ruby-ivar">@exampleTag</span> = <span class="ruby-identifier">tag</span>
|
|
1279
|
+
207: <span class="ruby-keyword kw">end</span></pre>
|
|
1096
1280
|
</div>
|
|
1097
1281
|
|
|
1098
1282
|
</div>
|
|
@@ -1125,10 +1309,10 @@ Restrict the syntax documentation to the first <tt>idx</tt> tokens.
|
|
|
1125
1309
|
<div class="method-source-code"
|
|
1126
1310
|
id="set-ast-yntax-oken-source">
|
|
1127
1311
|
<pre>
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1312
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 194</span>
|
|
1313
|
+
194: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setLastSyntaxToken</span>(<span class="ruby-identifier">idx</span>)
|
|
1314
|
+
195: <span class="ruby-ivar">@lastSyntaxToken</span> = <span class="ruby-identifier">idx</span>
|
|
1315
|
+
196: <span class="ruby-keyword kw">end</span></pre>
|
|
1132
1316
|
</div>
|
|
1133
1317
|
|
|
1134
1318
|
</div>
|
|
@@ -1161,10 +1345,10 @@ Set the references to related patterns.
|
|
|
1161
1345
|
<div class="method-source-code"
|
|
1162
1346
|
id="set-ee-lso-source">
|
|
1163
1347
|
<pre>
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1348
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 199</span>
|
|
1349
|
+
199: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setSeeAlso</span>(<span class="ruby-identifier">also</span>)
|
|
1350
|
+
200: <span class="ruby-ivar">@seeAlso</span> = <span class="ruby-identifier">also</span>
|
|
1351
|
+
201: <span class="ruby-keyword kw">end</span></pre>
|
|
1168
1352
|
</div>
|
|
1169
1353
|
|
|
1170
1354
|
</div>
|
|
@@ -1197,10 +1381,10 @@ Returns true if the i-th token is a terminal symbol.
|
|
|
1197
1381
|
<div class="method-source-code"
|
|
1198
1382
|
id="terminal-ymbol--source">
|
|
1199
1383
|
<pre>
|
|
1200
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1384
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 245</span>
|
|
1385
|
+
245: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">terminalSymbol?</span>(<span class="ruby-identifier">i</span>)
|
|
1386
|
+
246: <span class="ruby-ivar">@tokens</span>[<span class="ruby-identifier">i</span>][<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:variable</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@tokens</span>[<span class="ruby-identifier">i</span>][<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:literal</span>
|
|
1387
|
+
247: <span class="ruby-keyword kw">end</span></pre>
|
|
1204
1388
|
</div>
|
|
1205
1389
|
|
|
1206
1390
|
</div>
|
|
@@ -1235,29 +1419,26 @@ The return value is an Array of [ token, pattern ] tuple.
|
|
|
1235
1419
|
<div class="method-source-code"
|
|
1236
1420
|
id="terminal-okens-source">
|
|
1237
1421
|
<pre>
|
|
1238
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
165: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Unexpected token #{tokens[index]}"</span>
|
|
1259
|
-
166: <span class="ruby-keyword kw">end</span>
|
|
1260
|
-
167: <span class="ruby-keyword kw">end</span></pre>
|
|
1422
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 252</span>
|
|
1423
|
+
252: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">terminalTokens</span>(<span class="ruby-identifier">rules</span>, <span class="ruby-identifier">index</span> = <span class="ruby-value">0</span>)
|
|
1424
|
+
253: <span class="ruby-identifier">type</span>, <span class="ruby-identifier">name</span> = <span class="ruby-ivar">@tokens</span>[<span class="ruby-identifier">index</span>]
|
|
1425
|
+
254: <span class="ruby-comment cmt"># Terminal token start with an underscore or dollar character.</span>
|
|
1426
|
+
255: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:literal</span>
|
|
1427
|
+
256: <span class="ruby-keyword kw">return</span> [ [ <span class="ruby-identifier">name</span>, <span class="ruby-keyword kw">self</span> ] ]
|
|
1428
|
+
257: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:variable</span>
|
|
1429
|
+
258: <span class="ruby-keyword kw">return</span> []
|
|
1430
|
+
259: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:reference</span>
|
|
1431
|
+
260: <span class="ruby-comment cmt"># We have to continue the search at this rule.</span>
|
|
1432
|
+
261: <span class="ruby-identifier">rule</span> = <span class="ruby-identifier">rules</span>[<span class="ruby-identifier">name</span>]
|
|
1433
|
+
262: <span class="ruby-comment cmt"># The rule may only have a single pattern. If not, then this pattern</span>
|
|
1434
|
+
263: <span class="ruby-comment cmt"># has no terminal token.</span>
|
|
1435
|
+
264: <span class="ruby-identifier">tts</span> = []
|
|
1436
|
+
265: <span class="ruby-identifier">rule</span>.<span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">tts</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">terminalTokens</span>(<span class="ruby-identifier">rules</span>, <span class="ruby-value">0</span>) }
|
|
1437
|
+
266: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">tts</span>
|
|
1438
|
+
267: <span class="ruby-keyword kw">else</span>
|
|
1439
|
+
268: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Unexpected token #{type} #{name}"</span>
|
|
1440
|
+
269: <span class="ruby-keyword kw">end</span>
|
|
1441
|
+
270: <span class="ruby-keyword kw">end</span></pre>
|
|
1261
1442
|
</div>
|
|
1262
1443
|
|
|
1263
1444
|
</div>
|
|
@@ -1281,17 +1462,36 @@ The return value is an Array of [ token, pattern ] tuple.
|
|
|
1281
1462
|
|
|
1282
1463
|
<div class="method-description">
|
|
1283
1464
|
|
|
1284
|
-
|
|
1465
|
+
<p>
|
|
1466
|
+
Generate a text form of the pattern. This is similar to the syntax in the
|
|
1467
|
+
original syntax description.
|
|
1468
|
+
</p>
|
|
1285
1469
|
|
|
1286
1470
|
|
|
1287
1471
|
|
|
1288
1472
|
<div class="method-source-code"
|
|
1289
1473
|
id="to-s-source">
|
|
1290
1474
|
<pre>
|
|
1291
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1475
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 354</span>
|
|
1476
|
+
354: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
|
1477
|
+
355: <span class="ruby-identifier">str</span> = <span class="ruby-value str">""</span>
|
|
1478
|
+
356: <span class="ruby-ivar">@tokens</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">type</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
|
|
1479
|
+
357: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">type</span>
|
|
1480
|
+
358: <span class="ruby-keyword kw">when</span> <span class="ruby-value">:reference</span>
|
|
1481
|
+
359: <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"!#{name} "</span>
|
|
1482
|
+
360: <span class="ruby-keyword kw">when</span> <span class="ruby-value">:variable</span>
|
|
1483
|
+
361: <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"$#{name } "</span>
|
|
1484
|
+
362: <span class="ruby-keyword kw">when</span> <span class="ruby-value">:literal</span>
|
|
1485
|
+
363: <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"#{name} "</span>
|
|
1486
|
+
364: <span class="ruby-keyword kw">when</span> <span class="ruby-value">:eof</span>
|
|
1487
|
+
365: <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">". "</span>
|
|
1488
|
+
366: <span class="ruby-keyword kw">else</span>
|
|
1489
|
+
367: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Unknown type #{type}"</span>
|
|
1490
|
+
368: <span class="ruby-keyword kw">end</span>
|
|
1491
|
+
369: <span class="ruby-keyword kw">end</span>
|
|
1492
|
+
370:
|
|
1493
|
+
371: <span class="ruby-identifier">str</span>
|
|
1494
|
+
372: <span class="ruby-keyword kw">end</span></pre>
|
|
1295
1495
|
</div>
|
|
1296
1496
|
|
|
1297
1497
|
</div>
|
|
@@ -1326,10 +1526,10 @@ the wrapper function that sets up the stack.
|
|
|
1326
1526
|
<div class="method-source-code"
|
|
1327
1527
|
id="to-syntax-source">
|
|
1328
1528
|
<pre>
|
|
1329
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1529
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 275</span>
|
|
1530
|
+
275: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_syntax</span>(<span class="ruby-identifier">argDocs</span>, <span class="ruby-identifier">rules</span>, <span class="ruby-identifier">skip</span> = <span class="ruby-value">0</span>)
|
|
1531
|
+
276: <span class="ruby-identifier">to_syntax_r</span>({}, <span class="ruby-identifier">argDocs</span>, <span class="ruby-identifier">rules</span>, <span class="ruby-identifier">skip</span>)
|
|
1532
|
+
277: <span class="ruby-keyword kw">end</span></pre>
|
|
1333
1533
|
</div>
|
|
1334
1534
|
|
|
1335
1535
|
</div>
|
|
@@ -1353,88 +1553,87 @@ the wrapper function that sets up the stack.
|
|
|
1353
1553
|
|
|
1354
1554
|
<div class="method-description">
|
|
1355
1555
|
|
|
1356
|
-
|
|
1556
|
+
<p>
|
|
1557
|
+
Generate a syntax description for this pattern.
|
|
1558
|
+
</p>
|
|
1357
1559
|
|
|
1358
1560
|
|
|
1359
1561
|
|
|
1360
1562
|
<div class="method-source-code"
|
|
1361
1563
|
id="to-syntax-r-source">
|
|
1362
1564
|
<pre>
|
|
1363
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
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
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
247: <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-keyword kw">self</span>)
|
|
1436
|
-
248: <span class="ruby-identifier">str</span>
|
|
1437
|
-
249: <span class="ruby-keyword kw">end</span></pre>
|
|
1565
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 280</span>
|
|
1566
|
+
280: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_syntax_r</span>(<span class="ruby-identifier">stack</span>, <span class="ruby-identifier">argDocs</span>, <span class="ruby-identifier">rules</span>, <span class="ruby-identifier">skip</span>)
|
|
1567
|
+
281: <span class="ruby-comment cmt"># If we find ourself on the stack we hit a recursive pattern. This is used</span>
|
|
1568
|
+
282: <span class="ruby-comment cmt"># in repetitions.</span>
|
|
1569
|
+
283: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stack</span>[<span class="ruby-keyword kw">self</span>]
|
|
1570
|
+
284: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'[, ... ]'</span>
|
|
1571
|
+
285: <span class="ruby-keyword kw">end</span>
|
|
1572
|
+
286:
|
|
1573
|
+
287: <span class="ruby-comment cmt"># "Push" us on the stack.</span>
|
|
1574
|
+
288: <span class="ruby-identifier">stack</span>[<span class="ruby-keyword kw">self</span>] = <span class="ruby-keyword kw">true</span>
|
|
1575
|
+
289:
|
|
1576
|
+
290: <span class="ruby-identifier">str</span> = <span class="ruby-value str">''</span>
|
|
1577
|
+
291: <span class="ruby-identifier">first</span> = <span class="ruby-keyword kw">true</span>
|
|
1578
|
+
292: <span class="ruby-comment cmt"># Analyze the tokens of the pattern skipping the first 'skip' tokens.</span>
|
|
1579
|
+
293: <span class="ruby-identifier">skip</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-ivar">@lastSyntaxToken</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
|
1580
|
+
294: <span class="ruby-identifier">type</span>, <span class="ruby-identifier">name</span> = <span class="ruby-ivar">@tokens</span>[<span class="ruby-identifier">i</span>]
|
|
1581
|
+
295: <span class="ruby-comment cmt"># If the first token is a _{ the pattern describes optional attributes.</span>
|
|
1582
|
+
296: <span class="ruby-comment cmt"># They are represented by a standard idiom.</span>
|
|
1583
|
+
297: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">first</span>
|
|
1584
|
+
298: <span class="ruby-identifier">first</span> = <span class="ruby-keyword kw">false</span>
|
|
1585
|
+
299: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'{ <attributes> }'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'{'</span>
|
|
1586
|
+
300: <span class="ruby-keyword kw">else</span>
|
|
1587
|
+
301: <span class="ruby-comment cmt"># Separate the syntax elemens by a whitespace.</span>
|
|
1588
|
+
302: <span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">' '</span>
|
|
1589
|
+
303: <span class="ruby-keyword kw">end</span>
|
|
1590
|
+
304:
|
|
1591
|
+
305: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@args</span>[<span class="ruby-identifier">i</span>]
|
|
1592
|
+
306: <span class="ruby-comment cmt"># The argument is documented in the syntax definition. We copy the</span>
|
|
1593
|
+
307: <span class="ruby-comment cmt"># entry as we need to modify it.</span>
|
|
1594
|
+
308: <span class="ruby-identifier">argDoc</span> = <span class="ruby-ivar">@args</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">dup</span>
|
|
1595
|
+
309:
|
|
1596
|
+
310: <span class="ruby-comment cmt"># A documented argument without a name is a terminal token. We use the</span>
|
|
1597
|
+
311: <span class="ruby-comment cmt"># terminal symbol as name.</span>
|
|
1598
|
+
312: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@args</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">name</span>.<span class="ruby-identifier">nil?</span>
|
|
1599
|
+
313: <span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{name}"</span>
|
|
1600
|
+
314: <span class="ruby-identifier">argDoc</span>.<span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>
|
|
1601
|
+
315: <span class="ruby-keyword kw">else</span>
|
|
1602
|
+
316: <span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<#{@args[i].name}>"</span>
|
|
1603
|
+
317: <span class="ruby-keyword kw">end</span>
|
|
1604
|
+
318: <span class="ruby-identifier">addArgDoc</span>(<span class="ruby-identifier">argDocs</span>, <span class="ruby-identifier">argDoc</span>)
|
|
1605
|
+
319:
|
|
1606
|
+
320: <span class="ruby-comment cmt"># Documented arguments don't have the type set yet. Use the token</span>
|
|
1607
|
+
321: <span class="ruby-comment cmt"># value for that.</span>
|
|
1608
|
+
322: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:variable</span>
|
|
1609
|
+
323: <span class="ruby-identifier">argDoc</span>.<span class="ruby-identifier">typeSpec</span> = <span class="ruby-node">"<#{name}>"</span>
|
|
1610
|
+
324: <span class="ruby-keyword kw">end</span>
|
|
1611
|
+
325: <span class="ruby-keyword kw">else</span>
|
|
1612
|
+
326: <span class="ruby-comment cmt"># Undocumented tokens are recursively expanded.</span>
|
|
1613
|
+
327: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">type</span>
|
|
1614
|
+
328: <span class="ruby-keyword kw">when</span> <span class="ruby-value">:literal</span>
|
|
1615
|
+
329: <span class="ruby-comment cmt"># Literals are shown as such.</span>
|
|
1616
|
+
330: <span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>
|
|
1617
|
+
331: <span class="ruby-keyword kw">when</span> <span class="ruby-value">:variable</span>
|
|
1618
|
+
332: <span class="ruby-comment cmt"># Variables are enclosed by angle brackets.</span>
|
|
1619
|
+
333: <span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<#{name}>"</span>
|
|
1620
|
+
334: <span class="ruby-keyword kw">when</span> <span class="ruby-value">:reference</span>
|
|
1621
|
+
335: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rules</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&&</span>
|
|
1622
|
+
336: <span class="ruby-operator">!</span><span class="ruby-identifier">rules</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">patterns</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">nil?</span>
|
|
1623
|
+
337: <span class="ruby-identifier">addArgDoc</span>(<span class="ruby-identifier">argDocs</span>, <span class="ruby-constant">TokenDoc</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rules</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">patterns</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">keyword</span>,
|
|
1624
|
+
338: <span class="ruby-identifier">rules</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">patterns</span>[<span class="ruby-value">0</span>]))
|
|
1625
|
+
339: <span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">'<'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">rules</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">patterns</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">keyword</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'>'</span>
|
|
1626
|
+
340: <span class="ruby-keyword kw">else</span>
|
|
1627
|
+
341: <span class="ruby-comment cmt"># References are followed recursively.</span>
|
|
1628
|
+
342: <span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">rules</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">to_syntax</span>(<span class="ruby-identifier">stack</span>, <span class="ruby-identifier">argDocs</span>, <span class="ruby-identifier">rules</span>, <span class="ruby-value">0</span>)
|
|
1629
|
+
343: <span class="ruby-keyword kw">end</span>
|
|
1630
|
+
344: <span class="ruby-keyword kw">end</span>
|
|
1631
|
+
345: <span class="ruby-keyword kw">end</span>
|
|
1632
|
+
346: <span class="ruby-keyword kw">end</span>
|
|
1633
|
+
347: <span class="ruby-comment cmt"># Remove us from the "stack" again.</span>
|
|
1634
|
+
348: <span class="ruby-identifier">stack</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-keyword kw">self</span>)
|
|
1635
|
+
349: <span class="ruby-identifier">str</span>
|
|
1636
|
+
350: <span class="ruby-keyword kw">end</span></pre>
|
|
1438
1637
|
</div>
|
|
1439
1638
|
|
|
1440
1639
|
</div>
|
|
@@ -1471,14 +1670,14 @@ the wrapper function that sets up the stack.
|
|
|
1471
1670
|
<div class="method-source-code"
|
|
1472
1671
|
id="add-rg-oc-source">
|
|
1473
1672
|
<pre>
|
|
1474
|
-
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1673
|
+
<span class="ruby-comment cmt"># File lib/TextParser/Pattern.rb, line 376</span>
|
|
1674
|
+
376: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">addArgDoc</span>(<span class="ruby-identifier">argDocs</span>, <span class="ruby-identifier">argDoc</span>)
|
|
1675
|
+
377: <span class="ruby-identifier">raise</span> <span class="ruby-value str">'Error'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">argDoc</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">nil?</span>
|
|
1676
|
+
378: <span class="ruby-identifier">argDocs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ad</span><span class="ruby-operator">|</span>
|
|
1677
|
+
379: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ad</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">argDoc</span>.<span class="ruby-identifier">name</span>
|
|
1678
|
+
380: <span class="ruby-keyword kw">end</span>
|
|
1679
|
+
381: <span class="ruby-identifier">argDocs</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">argDoc</span>
|
|
1680
|
+
382: <span class="ruby-keyword kw">end</span></pre>
|
|
1482
1681
|
</div>
|
|
1483
1682
|
|
|
1484
1683
|
</div>
|