Changeset 128 for branches/generator
- Timestamp:
- Nov 30, 2017, 6:33:17 PM (7 years ago)
- Location:
- branches/generator
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/Forms/UFormMain.lfm
r127 r128 81 81 Top = 0 82 82 Width = 8 83 Caption = 'ToolButton6'84 83 Style = tbsSeparator 85 84 end -
branches/generator/Forms/UFormRuleItems.lfm
r122 r128 4 4 Top = 316 5 5 Width = 636 6 Caption = ' FormRuleItems'6 Caption = 'Rule items' 7 7 ClientHeight = 467 8 8 ClientWidth = 636 … … 39 39 Width = 636 40 40 Align = alBottom 41 Caption = 'ToolBar1'42 41 Images = Core.ImageList1 43 42 ParentShowHint = False -
branches/generator/Forms/UFormRuleItems.pas
r126 r128 111 111 procedure TFormRuleItems.AMoveDownExecute(Sender: TObject); 112 112 begin 113 RuleItems.ParentRule.Items.Move(ListView1.Selected.Index, ListView1.Selected.Index + 1); 114 ListView1.ItemIndex := ListView1.Selected.Index + 1; 115 ReloadList; 113 if Assigned(ListView1.Selected) then begin 114 RuleItems.Move(ListView1.Selected.Index, ListView1.Selected.Index + 1); 115 ListView1.ItemIndex := ListView1.Selected.Index + 1; 116 ReloadList; 117 end; 116 118 end; 117 119 118 120 procedure TFormRuleItems.AMoveUpExecute(Sender: TObject); 119 121 begin 120 RuleItems.ParentRule.Items.Move(ListView1.Selected.Index, ListView1.Selected.Index - 1); 121 ListView1.ItemIndex := ListView1.Selected.Index - 1; 122 ReloadList; 122 if Assigned(ListView1.Selected) then begin 123 RuleItems.Move(ListView1.Selected.Index, ListView1.Selected.Index - 1); 124 ListView1.ItemIndex := ListView1.Selected.Index - 1; 125 ReloadList; 126 end; 123 127 end; 124 128 … … 131 135 for I := ListView1.Items.Count - 1 downto 0 do 132 136 if ListView1.Items[I].Selected then begin 133 RuleItems. ParentRule.Items.Remove(TRuleItem(ListView1.Items[I].Data));137 RuleItems.Remove(TRuleItem(ListView1.Items[I].Data)); 134 138 RuleItems.Grammer.Modified := True; 135 139 end; -
branches/generator/Forms/UFormRules.lfm
r122 r128 34 34 BorderSpacing.Left = 22 35 35 BorderSpacing.Top = 3 36 Caption = 'ToolBar1'37 36 EdgeInner = esNone 38 37 EdgeOuter = esNone … … 78 77 Caption = 'Items' 79 78 Width = 500 79 end 80 item 81 Caption = 'Char length' 82 Width = 80 80 83 end> 81 84 MultiSelect = True -
branches/generator/Forms/UFormRules.pas
r126 r128 146 146 Item.SubItems.Add(BooleanText[CreateSourceNode]); 147 147 Item.SubItems.Add(Items.GetString); 148 Item.SubItems.Add(IntToStr(Items.GetCharLength)); 148 149 end; 149 150 end; -
branches/generator/Languages/generator.cs.po
r127 r128 92 92 msgstr "Nástroje" 93 93 94 #: tformmain.toolbutton6.caption 95 msgid "ToolButton6" 96 msgstr "" 94 #: tformruleitems.aadd.caption 95 msgctxt "tformruleitems.aadd.caption" 96 msgid "Add" 97 msgstr "PÅidat" 98 99 #: tformruleitems.amodify.caption 100 msgctxt "tformruleitems.amodify.caption" 101 msgid "Modify" 102 msgstr "Upravit" 103 104 #: tformruleitems.amovedown.caption 105 msgid "Move down" 106 msgstr "Posunout dolů" 107 108 #: tformruleitems.amoveup.caption 109 msgid "Move up" 110 msgstr "Posunout nahoru" 111 112 #: tformruleitems.aremove.caption 113 msgctxt "tformruleitems.aremove.caption" 114 msgid "Remove" 115 msgstr "Odstranit" 116 117 #: tformruleitems.caption 118 msgid "Rule items" 119 msgstr "PoloÅŸky pravidla" 120 121 #: tformruleitems.label1.caption 122 msgid "Operator:" 123 msgstr "Operátor:" 124 125 #: tformruleitems.listview1.columns[0].caption 126 msgctxt "tformruleitems.listview1.columns[0].caption" 127 msgid "Name" 128 msgstr "Název" 129 130 #: tformrules.aadd.caption 131 msgctxt "tformrules.aadd.caption" 132 msgid "Add" 133 msgstr "PÅidat" 134 135 #: tformrules.aadd.hint 136 msgctxt "tformrules.aadd.hint" 137 msgid "Add" 138 msgstr "PÅidat" 139 140 #: tformrules.amodify.caption 141 msgctxt "tformrules.amodify.caption" 142 msgid "Modify" 143 msgstr "Upravit" 144 145 #: tformrules.amodify.hint 146 msgctxt "tformrules.amodify.hint" 147 msgid "Modify" 148 msgstr "Upravit" 149 150 #: tformrules.aremove.caption 151 msgctxt "tformrules.aremove.caption" 152 msgid "Remove" 153 msgstr "Odstranit" 154 155 #: tformrules.aremove.hint 156 msgctxt "tformrules.aremove.hint" 157 msgid "Remove" 158 msgstr "Odstranit" 159 160 #: tformrules.caption 161 msgctxt "tformrules.caption" 162 msgid "Rules" 163 msgstr "Pravidla" 164 165 #: tformrules.listview1.columns[0].caption 166 msgctxt "tformrules.listview1.columns[0].caption" 167 msgid "Name" 168 msgstr "Název" 169 170 #: tformrules.listview1.columns[1].caption 171 msgid "Node" 172 msgstr "Uzel" 173 174 #: tformrules.listview1.columns[2].caption 175 msgid "Items" 176 msgstr "PoloÅŸky" 177 178 #: tformrules.listview1.columns[3].caption 179 msgid "Char length" 180 msgstr "Znaková délka" 97 181 98 182 #: uformmain.sdoyouwanttosaveproject -
branches/generator/Languages/generator.po
r127 r128 82 82 msgstr "" 83 83 84 #: tformmain.toolbutton6.caption 85 msgid "ToolButton6" 84 #: tformruleitems.aadd.caption 85 msgctxt "TFORMRULEITEMS.AADD.CAPTION" 86 msgid "Add" 87 msgstr "" 88 89 #: tformruleitems.amodify.caption 90 msgctxt "TFORMRULEITEMS.AMODIFY.CAPTION" 91 msgid "Modify" 92 msgstr "" 93 94 #: tformruleitems.amovedown.caption 95 msgid "Move down" 96 msgstr "" 97 98 #: tformruleitems.amoveup.caption 99 msgid "Move up" 100 msgstr "" 101 102 #: tformruleitems.aremove.caption 103 msgctxt "TFORMRULEITEMS.AREMOVE.CAPTION" 104 msgid "Remove" 105 msgstr "" 106 107 #: tformruleitems.caption 108 msgid "Rule items" 109 msgstr "" 110 111 #: tformruleitems.label1.caption 112 msgid "Operator:" 113 msgstr "" 114 115 #: tformruleitems.listview1.columns[0].caption 116 msgctxt "TFORMRULEITEMS.LISTVIEW1.COLUMNS[0].CAPTION" 117 msgid "Name" 118 msgstr "" 119 120 #: tformrules.aadd.caption 121 msgctxt "tformrules.aadd.caption" 122 msgid "Add" 123 msgstr "" 124 125 #: tformrules.aadd.hint 126 msgctxt "TFORMRULES.AADD.HINT" 127 msgid "Add" 128 msgstr "" 129 130 #: tformrules.amodify.caption 131 msgctxt "tformrules.amodify.caption" 132 msgid "Modify" 133 msgstr "" 134 135 #: tformrules.amodify.hint 136 msgctxt "TFORMRULES.AMODIFY.HINT" 137 msgid "Modify" 138 msgstr "" 139 140 #: tformrules.aremove.caption 141 msgctxt "tformrules.aremove.caption" 142 msgid "Remove" 143 msgstr "" 144 145 #: tformrules.aremove.hint 146 msgctxt "TFORMRULES.AREMOVE.HINT" 147 msgid "Remove" 148 msgstr "" 149 150 #: tformrules.caption 151 msgctxt "TFORMRULES.CAPTION" 152 msgid "Rules" 153 msgstr "" 154 155 #: tformrules.listview1.columns[0].caption 156 msgctxt "tformrules.listview1.columns[0].caption" 157 msgid "Name" 158 msgstr "" 159 160 #: tformrules.listview1.columns[1].caption 161 msgid "Node" 162 msgstr "" 163 164 #: tformrules.listview1.columns[2].caption 165 msgid "Items" 166 msgstr "" 167 168 #: tformrules.listview1.columns[3].caption 169 msgid "Char length" 86 170 msgstr "" 87 171 -
branches/generator/URules.pas
r127 r128 537 537 function TRuleItem.GetCharLength: Integer; 538 538 begin 539 Result := 0; 540 if not Optional then 539 541 case RuleItemType of 540 542 ritTerminal: Result := Length(Terminal); 541 ritNonTerminal: Result := Length(NonTerminal.Name);543 //ritNonTerminal: Result := NonTerminal.Items.GetCharLength; 542 544 ritSubItems: Result := SubItems.GetCharLength; 543 545 ritTerminalRange: Result := Max(Length(TerminalFrom), Length(TerminalTo)) -
branches/generator/pascal.grm
r127 r128 532 532 </RuleItem> 533 533 <RuleItem> 534 <Type>0</Type> 535 <Optional>0</Optional> 536 <Repetitive>0</Repetitive> 537 <AnyExcept>0</AnyExcept> 538 <Terminal>,</Terminal> 534 <Type>2</Type> 535 <Optional>-1</Optional> 536 <Repetitive>-1</Repetitive> 537 <AnyExcept>0</AnyExcept> 538 <SubItems> 539 <Type>0</Type> 540 <RuleItem> 541 <Type>0</Type> 542 <Optional>0</Optional> 543 <Repetitive>0</Repetitive> 544 <AnyExcept>0</AnyExcept> 545 <Terminal>,</Terminal> 546 </RuleItem> 547 <RuleItem> 548 <Type>1</Type> 549 <Optional>0</Optional> 550 <Repetitive>0</Repetitive> 551 <AnyExcept>0</AnyExcept> 552 <NonTerminal>UnitReference</NonTerminal> 553 </RuleItem> 554 </SubItems> 555 </RuleItem> 556 <RuleItem> 557 <Type>0</Type> 558 <Optional>0</Optional> 559 <Repetitive>0</Repetitive> 560 <AnyExcept>0</AnyExcept> 561 <Terminal>;</Terminal> 539 562 </RuleItem> 540 563 </RuleItems> … … 1809 1832 <Repetitive>0</Repetitive> 1810 1833 <AnyExcept>0</AnyExcept> 1811 <NonTerminal>Type Reference</NonTerminal>1834 <NonTerminal>Type</NonTerminal> 1812 1835 </RuleItem> 1813 1836 <RuleItem> … … 1963 1986 <Repetitive>0</Repetitive> 1964 1987 <AnyExcept>0</AnyExcept> 1965 <Terminal > </Terminal>1988 <Terminal/> 1966 1989 </RuleItem> 1967 1990 <RuleItem> … … 1999 2022 <AnyExcept>0</AnyExcept> 2000 2023 <NonTerminal>WhiteSpace</NonTerminal> 2024 </RuleItem> 2025 </RuleItems> 2026 </Rule> 2027 <Rule> 2028 <Name>Range</Name> 2029 <CreateSourceNode>0</CreateSourceNode> 2030 <RuleItems> 2031 <Type>0</Type> 2032 <RuleItem> 2033 <Type>1</Type> 2034 <Optional>0</Optional> 2035 <Repetitive>0</Repetitive> 2036 <AnyExcept>0</AnyExcept> 2037 <NonTerminal>Number</NonTerminal> 2038 </RuleItem> 2039 <RuleItem> 2040 <Type>0</Type> 2041 <Optional>0</Optional> 2042 <Repetitive>0</Repetitive> 2043 <AnyExcept>0</AnyExcept> 2044 <Terminal>..</Terminal> 2045 </RuleItem> 2046 <RuleItem> 2047 <Type>1</Type> 2048 <Optional>0</Optional> 2049 <Repetitive>0</Repetitive> 2050 <AnyExcept>0</AnyExcept> 2051 <NonTerminal>Number</NonTerminal> 2052 </RuleItem> 2053 </RuleItems> 2054 </Rule> 2055 <Rule> 2056 <Name>TypeArray</Name> 2057 <CreateSourceNode>0</CreateSourceNode> 2058 <RuleItems> 2059 <Type>0</Type> 2060 <RuleItem> 2061 <Type>0</Type> 2062 <Optional>0</Optional> 2063 <Repetitive>0</Repetitive> 2064 <AnyExcept>0</AnyExcept> 2065 <Terminal>array</Terminal> 2066 </RuleItem> 2067 <RuleItem> 2068 <Type>2</Type> 2069 <Optional>-1</Optional> 2070 <Repetitive>0</Repetitive> 2071 <AnyExcept>0</AnyExcept> 2072 <SubItems> 2073 <Type>0</Type> 2074 <RuleItem> 2075 <Type>0</Type> 2076 <Optional>0</Optional> 2077 <Repetitive>0</Repetitive> 2078 <AnyExcept>0</AnyExcept> 2079 <Terminal>[</Terminal> 2080 </RuleItem> 2081 <RuleItem> 2082 <Type>1</Type> 2083 <Optional>0</Optional> 2084 <Repetitive>0</Repetitive> 2085 <AnyExcept>0</AnyExcept> 2086 <NonTerminal>Range</NonTerminal> 2087 </RuleItem> 2088 <RuleItem> 2089 <Type>0</Type> 2090 <Optional>0</Optional> 2091 <Repetitive>0</Repetitive> 2092 <AnyExcept>0</AnyExcept> 2093 <Terminal>]</Terminal> 2094 </RuleItem> 2095 </SubItems> 2096 </RuleItem> 2097 <RuleItem> 2098 <Type>0</Type> 2099 <Optional>0</Optional> 2100 <Repetitive>0</Repetitive> 2101 <AnyExcept>0</AnyExcept> 2102 <Terminal>of</Terminal> 2103 </RuleItem> 2104 <RuleItem> 2105 <Type>1</Type> 2106 <Optional>0</Optional> 2107 <Repetitive>0</Repetitive> 2108 <AnyExcept>0</AnyExcept> 2109 <NonTerminal>TypeReference</NonTerminal> 2110 </RuleItem> 2111 <RuleItem> 2112 <Type>0</Type> 2113 <Optional>0</Optional> 2114 <Repetitive>0</Repetitive> 2115 <AnyExcept>0</AnyExcept> 2116 <Terminal>;</Terminal> 2117 </RuleItem> 2118 </RuleItems> 2119 </Rule> 2120 <Rule> 2121 <Name>TypeSet</Name> 2122 <CreateSourceNode>0</CreateSourceNode> 2123 <RuleItems> 2124 <Type>0</Type> 2125 <RuleItem> 2126 <Type>0</Type> 2127 <Optional>0</Optional> 2128 <Repetitive>0</Repetitive> 2129 <AnyExcept>0</AnyExcept> 2130 <Terminal>set</Terminal> 2131 </RuleItem> 2132 <RuleItem> 2133 <Type>0</Type> 2134 <Optional>0</Optional> 2135 <Repetitive>0</Repetitive> 2136 <AnyExcept>0</AnyExcept> 2137 <Terminal>of</Terminal> 2138 </RuleItem> 2139 <RuleItem> 2140 <Type>1</Type> 2141 <Optional>0</Optional> 2142 <Repetitive>0</Repetitive> 2143 <AnyExcept>0</AnyExcept> 2144 <NonTerminal>TypeReference</NonTerminal> 2145 </RuleItem> 2146 </RuleItems> 2147 </Rule> 2148 <Rule> 2149 <Name>TypeEnumeration</Name> 2150 <CreateSourceNode>0</CreateSourceNode> 2151 <RuleItems> 2152 <Type>0</Type> 2153 <RuleItem> 2154 <Type>0</Type> 2155 <Optional>0</Optional> 2156 <Repetitive>0</Repetitive> 2157 <AnyExcept>0</AnyExcept> 2158 <Terminal>(</Terminal> 2159 </RuleItem> 2160 <RuleItem> 2161 <Type>1</Type> 2162 <Optional>0</Optional> 2163 <Repetitive>0</Repetitive> 2164 <AnyExcept>0</AnyExcept> 2165 <NonTerminal>IdentifierList</NonTerminal> 2166 </RuleItem> 2167 <RuleItem> 2168 <Type>0</Type> 2169 <Optional>0</Optional> 2170 <Repetitive>0</Repetitive> 2171 <AnyExcept>0</AnyExcept> 2172 <Terminal>)</Terminal> 2173 </RuleItem> 2174 </RuleItems> 2175 </Rule> 2176 <Rule> 2177 <Name>IdentifierList</Name> 2178 <CreateSourceNode>0</CreateSourceNode> 2179 <RuleItems> 2180 <Type>0</Type> 2181 <RuleItem> 2182 <Type>1</Type> 2183 <Optional>0</Optional> 2184 <Repetitive>0</Repetitive> 2185 <AnyExcept>0</AnyExcept> 2186 <NonTerminal>Identifier</NonTerminal> 2187 </RuleItem> 2188 <RuleItem> 2189 <Type>2</Type> 2190 <Optional>-1</Optional> 2191 <Repetitive>-1</Repetitive> 2192 <AnyExcept>0</AnyExcept> 2193 <SubItems> 2194 <Type>0</Type> 2195 <RuleItem> 2196 <Type>0</Type> 2197 <Optional>0</Optional> 2198 <Repetitive>0</Repetitive> 2199 <AnyExcept>0</AnyExcept> 2200 <Terminal>,</Terminal> 2201 </RuleItem> 2202 <RuleItem> 2203 <Type>1</Type> 2204 <Optional>0</Optional> 2205 <Repetitive>0</Repetitive> 2206 <AnyExcept>0</AnyExcept> 2207 <NonTerminal>Identifier</NonTerminal> 2208 </RuleItem> 2209 </SubItems> 2210 </RuleItem> 2211 </RuleItems> 2212 </Rule> 2213 <Rule> 2214 <Name>Type</Name> 2215 <CreateSourceNode>0</CreateSourceNode> 2216 <RuleItems> 2217 <Type>1</Type> 2218 <RuleItem> 2219 <Type>1</Type> 2220 <Optional>0</Optional> 2221 <Repetitive>0</Repetitive> 2222 <AnyExcept>0</AnyExcept> 2223 <NonTerminal>TypeArray</NonTerminal> 2224 </RuleItem> 2225 <RuleItem> 2226 <Type>1</Type> 2227 <Optional>0</Optional> 2228 <Repetitive>0</Repetitive> 2229 <AnyExcept>0</AnyExcept> 2230 <NonTerminal>TypeEnumeration</NonTerminal> 2231 </RuleItem> 2232 <RuleItem> 2233 <Type>1</Type> 2234 <Optional>0</Optional> 2235 <Repetitive>0</Repetitive> 2236 <AnyExcept>0</AnyExcept> 2237 <NonTerminal>TypeRecord</NonTerminal> 2238 </RuleItem> 2239 <RuleItem> 2240 <Type>1</Type> 2241 <Optional>0</Optional> 2242 <Repetitive>0</Repetitive> 2243 <AnyExcept>0</AnyExcept> 2244 <NonTerminal>TypeReference</NonTerminal> 2245 </RuleItem> 2246 <RuleItem> 2247 <Type>1</Type> 2248 <Optional>0</Optional> 2249 <Repetitive>0</Repetitive> 2250 <AnyExcept>0</AnyExcept> 2251 <NonTerminal>TypeSet</NonTerminal> 2252 </RuleItem> 2253 <RuleItem> 2254 <Type>1</Type> 2255 <Optional>0</Optional> 2256 <Repetitive>0</Repetitive> 2257 <AnyExcept>0</AnyExcept> 2258 <NonTerminal>TypePointer</NonTerminal> 2259 </RuleItem> 2260 </RuleItems> 2261 </Rule> 2262 <Rule> 2263 <Name>TypePointer</Name> 2264 <CreateSourceNode>0</CreateSourceNode> 2265 <RuleItems> 2266 <Type>0</Type> 2267 <RuleItem> 2268 <Type>0</Type> 2269 <Optional>0</Optional> 2270 <Repetitive>0</Repetitive> 2271 <AnyExcept>0</AnyExcept> 2272 <Terminal>^</Terminal> 2273 </RuleItem> 2274 <RuleItem> 2275 <Type>1</Type> 2276 <Optional>0</Optional> 2277 <Repetitive>0</Repetitive> 2278 <AnyExcept>0</AnyExcept> 2279 <NonTerminal>TypeReference</NonTerminal> 2001 2280 </RuleItem> 2002 2281 </RuleItems>
Note:
See TracChangeset
for help on using the changeset viewer.