Class: OCCIANTLR::Parser
- Inherits:
-
ANTLR3::Parser
- Object
- ANTLR3::Parser
- OCCIANTLR::Parser
- Includes:
- TokenData
- Defined in:
- lib/occiantlr/OCCIANTLRParser.rb
Defined Under Namespace
Constant Summary collapse
- RULE_METHODS =
[ :category, :category_value, :category_term, :category_scheme, :category_class, :category_title, :category_rel, :category_location, :category_attributes, :category_actions, :link, :link_value, :link_target, :link_rel, :link_self, :link_category, :link_attributes, :x_occi_attribute, :x_occi_location, :uri, :term, :scheme, :class_type, :title, :attribute, :attribute_name, :attribute_component, :attribute_value, :number, :reserved_words, :quoted_string, :string, :digits ].freeze
- UriReturnValue =
define_return_scope
- TermReturnValue =
define_return_scope
- SchemeReturnValue =
define_return_scope
- ClassTypeReturnValue =
define_return_scope
- TitleReturnValue =
define_return_scope
- AttributeComponentReturnValue =
define_return_scope
- NumberReturnValue =
define_return_scope
- StringReturnValue =
define_return_scope
- TOKENS_FOLLOWING_CATEGORY_KEY_IN_category_39 =
- TOKENS_FOLLOWING_COLON_IN_category_41 =
- TOKENS_FOLLOWING_category_value_IN_category_43 =
- TOKENS_FOLLOWING_category_term_IN_category_value_75 =
- TOKENS_FOLLOWING_category_scheme_IN_category_value_77 =
- TOKENS_FOLLOWING_category_class_IN_category_value_79 =
- TOKENS_FOLLOWING_category_title_IN_category_value_81 =
- TOKENS_FOLLOWING_category_rel_IN_category_value_84 =
- TOKENS_FOLLOWING_category_location_IN_category_value_87 =
- TOKENS_FOLLOWING_category_attributes_IN_category_value_90 =
- TOKENS_FOLLOWING_category_actions_IN_category_value_93 =
- TOKENS_FOLLOWING_SEMICOLON_IN_category_value_96 =
- TOKENS_FOLLOWING_WS_IN_category_term_128 =
- TOKENS_FOLLOWING_term_IN_category_term_131 =
- TOKENS_FOLLOWING_SEMICOLON_IN_category_scheme_157 =
- TOKENS_FOLLOWING_WS_IN_category_scheme_159 =
- TOKENS_FOLLOWING_SCHEME_IN_category_scheme_162 =
- TOKENS_FOLLOWING_EQUALS_IN_category_scheme_164 =
- TOKENS_FOLLOWING_QUOTE_IN_category_scheme_166 =
- TOKENS_FOLLOWING_scheme_IN_category_scheme_168 =
- TOKENS_FOLLOWING_QUOTE_IN_category_scheme_170 =
- TOKENS_FOLLOWING_SEMICOLON_IN_category_class_199 =
- TOKENS_FOLLOWING_WS_IN_category_class_201 =
- TOKENS_FOLLOWING_CLASS_IN_category_class_204 =
- TOKENS_FOLLOWING_EQUALS_IN_category_class_206 =
- TOKENS_FOLLOWING_QUOTE_IN_category_class_208 =
- TOKENS_FOLLOWING_class_type_IN_category_class_210 =
- TOKENS_FOLLOWING_QUOTE_IN_category_class_212 =
- TOKENS_FOLLOWING_SEMICOLON_IN_category_title_237 =
- TOKENS_FOLLOWING_WS_IN_category_title_239 =
- TOKENS_FOLLOWING_TITLE_IN_category_title_242 =
- TOKENS_FOLLOWING_EQUALS_IN_category_title_244 =
- TOKENS_FOLLOWING_QUOTE_IN_category_title_246 =
- TOKENS_FOLLOWING_title_IN_category_title_248 =
- TOKENS_FOLLOWING_QUOTE_IN_category_title_250 =
- TOKENS_FOLLOWING_SEMICOLON_IN_category_rel_277 =
- TOKENS_FOLLOWING_WS_IN_category_rel_279 =
- TOKENS_FOLLOWING_REL_IN_category_rel_282 =
- TOKENS_FOLLOWING_EQUALS_IN_category_rel_284 =
- TOKENS_FOLLOWING_QUOTE_IN_category_rel_286 =
- TOKENS_FOLLOWING_uri_IN_category_rel_288 =
- TOKENS_FOLLOWING_QUOTE_IN_category_rel_290 =
- TOKENS_FOLLOWING_SEMICOLON_IN_category_location_315 =
- TOKENS_FOLLOWING_WS_IN_category_location_317 =
- TOKENS_FOLLOWING_LOCATION_IN_category_location_320 =
- TOKENS_FOLLOWING_EQUALS_IN_category_location_322 =
- TOKENS_FOLLOWING_QUOTE_IN_category_location_324 =
- TOKENS_FOLLOWING_uri_IN_category_location_326 =
- TOKENS_FOLLOWING_QUOTE_IN_category_location_328 =
- TOKENS_FOLLOWING_SEMICOLON_IN_category_attributes_367 =
- TOKENS_FOLLOWING_WS_IN_category_attributes_369 =
- TOKENS_FOLLOWING_ATTRIBUTES_IN_category_attributes_372 =
- TOKENS_FOLLOWING_EQUALS_IN_category_attributes_374 =
- TOKENS_FOLLOWING_QUOTE_IN_category_attributes_376 =
- TOKENS_FOLLOWING_attribute_name_IN_category_attributes_380 =
- TOKENS_FOLLOWING_WS_IN_category_attributes_395 =
- TOKENS_FOLLOWING_attribute_name_IN_category_attributes_399 =
- TOKENS_FOLLOWING_QUOTE_IN_category_attributes_407 =
- TOKENS_FOLLOWING_SEMICOLON_IN_category_actions_437 =
- TOKENS_FOLLOWING_WS_IN_category_actions_439 =
- TOKENS_FOLLOWING_ACTIONS_IN_category_actions_442 =
- TOKENS_FOLLOWING_EQUALS_IN_category_actions_444 =
- TOKENS_FOLLOWING_QUOTE_IN_category_actions_446 =
- TOKENS_FOLLOWING_uri_IN_category_actions_450 =
- TOKENS_FOLLOWING_WS_IN_category_actions_466 =
- TOKENS_FOLLOWING_uri_IN_category_actions_470 =
- TOKENS_FOLLOWING_QUOTE_IN_category_actions_477 =
- TOKENS_FOLLOWING_LINK_KEY_IN_link_494 =
- TOKENS_FOLLOWING_COLON_IN_link_496 =
- TOKENS_FOLLOWING_link_value_IN_link_498 =
- TOKENS_FOLLOWING_link_target_IN_link_value_520 =
- TOKENS_FOLLOWING_link_rel_IN_link_value_529 =
- TOKENS_FOLLOWING_link_self_IN_link_value_538 =
- TOKENS_FOLLOWING_link_category_IN_link_value_548 =
- TOKENS_FOLLOWING_link_attributes_IN_link_value_558 =
- TOKENS_FOLLOWING_SEMICOLON_IN_link_value_567 =
- TOKENS_FOLLOWING_WS_IN_link_target_586 =
- TOKENS_FOLLOWING_LT_IN_link_target_589 =
- TOKENS_FOLLOWING_uri_IN_link_target_591 =
- TOKENS_FOLLOWING_GT_IN_link_target_593 =
- TOKENS_FOLLOWING_SEMICOLON_IN_link_rel_608 =
- TOKENS_FOLLOWING_WS_IN_link_rel_610 =
- TOKENS_FOLLOWING_REL_IN_link_rel_613 =
- TOKENS_FOLLOWING_EQUALS_IN_link_rel_615 =
- TOKENS_FOLLOWING_QUOTE_IN_link_rel_617 =
- TOKENS_FOLLOWING_uri_IN_link_rel_619 =
- TOKENS_FOLLOWING_QUOTE_IN_link_rel_621 =
- TOKENS_FOLLOWING_SEMICOLON_IN_link_self_636 =
- TOKENS_FOLLOWING_WS_IN_link_self_638 =
- TOKENS_FOLLOWING_SELF_IN_link_self_641 =
- TOKENS_FOLLOWING_EQUALS_IN_link_self_643 =
- TOKENS_FOLLOWING_QUOTE_IN_link_self_645 =
- TOKENS_FOLLOWING_uri_IN_link_self_647 =
- TOKENS_FOLLOWING_QUOTE_IN_link_self_649 =
- TOKENS_FOLLOWING_SEMICOLON_IN_link_category_702 =
- TOKENS_FOLLOWING_WS_IN_link_category_704 =
- TOKENS_FOLLOWING_CATEGORY_IN_link_category_707 =
- TOKENS_FOLLOWING_EQUALS_IN_link_category_709 =
- TOKENS_FOLLOWING_QUOTE_IN_link_category_711 =
- TOKENS_FOLLOWING_uri_IN_link_category_715 =
- TOKENS_FOLLOWING_WS_IN_link_category_720 =
- TOKENS_FOLLOWING_uri_IN_link_category_724 =
- TOKENS_FOLLOWING_QUOTE_IN_link_category_730 =
- TOKENS_FOLLOWING_SEMICOLON_IN_link_attributes_753 =
- TOKENS_FOLLOWING_WS_IN_link_attributes_756 =
- TOKENS_FOLLOWING_attribute_IN_link_attributes_759 =
- TOKENS_FOLLOWING_X_OCCI_ATTRIBUTE_KEY_IN_x_occi_attribute_780 =
- TOKENS_FOLLOWING_COLON_IN_x_occi_attribute_782 =
- TOKENS_FOLLOWING_WS_IN_x_occi_attribute_784 =
- TOKENS_FOLLOWING_attribute_IN_x_occi_attribute_787 =
- TOKENS_FOLLOWING_SEMICOLON_IN_x_occi_attribute_789 =
- TOKENS_FOLLOWING_X_OCCI_LOCATION_KEY_IN_x_occi_location_809 =
- TOKENS_FOLLOWING_COLON_IN_x_occi_location_811 =
- TOKENS_FOLLOWING_WS_IN_x_occi_location_813 =
- TOKENS_FOLLOWING_uri_IN_x_occi_location_816 =
- TOKENS_FOLLOWING_SEMICOLON_IN_x_occi_location_818 =
- TOKENS_FOLLOWING_LOALPHA_IN_uri_834 =
- TOKENS_FOLLOWING_UPALPHA_IN_uri_838 =
- TOKENS_FOLLOWING_DIGIT_IN_uri_842 =
- TOKENS_FOLLOWING_AT_IN_uri_846 =
- TOKENS_FOLLOWING_COLON_IN_uri_850 =
- TOKENS_FOLLOWING_PERCENT_IN_uri_854 =
- TOKENS_FOLLOWING_UNDERSCORE_IN_uri_858 =
- TOKENS_FOLLOWING_BACKSLASH_IN_uri_862 =
- TOKENS_FOLLOWING_PLUS_IN_uri_866 =
- TOKENS_FOLLOWING_DOT_IN_uri_870 =
- TOKENS_FOLLOWING_TILDE_IN_uri_874 =
- TOKENS_FOLLOWING_HASH_IN_uri_878 =
- TOKENS_FOLLOWING_QUESTION_IN_uri_882 =
- TOKENS_FOLLOWING_AMPERSAND_IN_uri_886 =
- TOKENS_FOLLOWING_SLASH_IN_uri_890 =
- TOKENS_FOLLOWING_EQUALS_IN_uri_894 =
- TOKENS_FOLLOWING_DASH_IN_uri_898 =
- TOKENS_FOLLOWING_X_OCCI_ATTRIBUTE_KEY_IN_uri_902 =
- TOKENS_FOLLOWING_X_OCCI_LOCATION_KEY_IN_uri_906 =
- TOKENS_FOLLOWING_reserved_words_IN_uri_910 =
- TOKENS_FOLLOWING_LOALPHA_IN_term_923 =
- TOKENS_FOLLOWING_reserved_words_IN_term_927 =
- TOKENS_FOLLOWING_LOALPHA_IN_term_933 =
- TOKENS_FOLLOWING_DIGIT_IN_term_937 =
- TOKENS_FOLLOWING_DASH_IN_term_941 =
- TOKENS_FOLLOWING_UNDERSCORE_IN_term_945 =
- TOKENS_FOLLOWING_DOT_IN_term_949 =
- TOKENS_FOLLOWING_reserved_words_IN_term_953 =
- TOKENS_FOLLOWING_uri_IN_scheme_973 =
- TOKENS_FOLLOWING_set_IN_class_type_982 =
- TOKENS_FOLLOWING_set_IN_title_1003 =
- TOKENS_FOLLOWING_attribute_component_IN_attribute_1050 =
- TOKENS_FOLLOWING_DOT_IN_attribute_1061 =
- TOKENS_FOLLOWING_attribute_component_IN_attribute_1065 =
- TOKENS_FOLLOWING_EQUALS_IN_attribute_1076 =
- TOKENS_FOLLOWING_attribute_value_IN_attribute_1078 =
- TOKENS_FOLLOWING_attribute_component_IN_attribute_name_1122 =
- TOKENS_FOLLOWING_DOT_IN_attribute_name_1133 =
- TOKENS_FOLLOWING_attribute_component_IN_attribute_name_1137 =
- TOKENS_FOLLOWING_T__48_IN_attribute_name_1157 =
- TOKENS_FOLLOWING_T__49_IN_attribute_name_1160 =
- TOKENS_FOLLOWING_T__50_IN_attribute_name_1167 =
- TOKENS_FOLLOWING_T__51_IN_attribute_name_1174 =
- TOKENS_FOLLOWING_T__52_IN_attribute_name_1180 =
- TOKENS_FOLLOWING_LOALPHA_IN_attribute_component_1192 =
- TOKENS_FOLLOWING_reserved_words_IN_attribute_component_1196 =
- TOKENS_FOLLOWING_LOALPHA_IN_attribute_component_1201 =
- TOKENS_FOLLOWING_DIGIT_IN_attribute_component_1205 =
- TOKENS_FOLLOWING_DASH_IN_attribute_component_1209 =
- TOKENS_FOLLOWING_UNDERSCORE_IN_attribute_component_1213 =
- TOKENS_FOLLOWING_reserved_words_IN_attribute_component_1217 =
- TOKENS_FOLLOWING_quoted_string_IN_attribute_value_1234 =
- TOKENS_FOLLOWING_number_IN_attribute_value_1240 =
- TOKENS_FOLLOWING_digits_IN_number_1255 =
- TOKENS_FOLLOWING_DOT_IN_number_1259 =
- TOKENS_FOLLOWING_digits_IN_number_1261 =
- TOKENS_FOLLOWING_set_IN_reserved_words_1274 =
- TOKENS_FOLLOWING_QUOTE_IN_quoted_string_1727 =
- TOKENS_FOLLOWING_string_IN_quoted_string_1729 =
- TOKENS_FOLLOWING_QUOTE_IN_quoted_string_1731 =
- TOKENS_FOLLOWING_set_IN_string_1742 =
- TOKENS_FOLLOWING_DIGIT_IN_digits_1776 =
Instance Method Summary collapse
-
#attribute ⇒ Object
parser rule attribute.
-
#attribute_component ⇒ Object
parser rule attribute_component.
-
#attribute_name ⇒ Object
parser rule attribute_name.
-
#attribute_value ⇒ Object
parser rule attribute_value.
-
#category ⇒ Object
parser rule category.
-
#category_actions ⇒ Object
parser rule category_actions.
-
#category_attributes ⇒ Object
parser rule category_attributes.
-
#category_class ⇒ Object
parser rule category_class.
-
#category_location ⇒ Object
parser rule category_location.
-
#category_rel ⇒ Object
parser rule category_rel.
-
#category_scheme ⇒ Object
parser rule category_scheme.
-
#category_term ⇒ Object
parser rule category_term.
-
#category_title ⇒ Object
parser rule category_title.
-
#category_value ⇒ Object
parser rule category_value.
-
#class_type ⇒ Object
parser rule class_type.
-
#digits ⇒ Object
parser rule digits.
-
#initialize(input, options = {}) ⇒ Parser
constructor
A new instance of Parser.
- #initialize_dfas ⇒ Object private
-
#link ⇒ Object
parser rule link.
-
#link_attributes ⇒ Object
parser rule link_attributes.
-
#link_category ⇒ Object
parser rule link_category.
-
#link_rel ⇒ Object
parser rule link_rel.
-
#link_self ⇒ Object
parser rule link_self.
-
#link_target ⇒ Object
parser rule link_target.
-
#link_value ⇒ Object
parser rule link_value.
-
#number ⇒ Object
parser rule number.
-
#quoted_string ⇒ Object
parser rule quoted_string.
-
#reserved_words ⇒ Object
parser rule reserved_words.
-
#scheme ⇒ Object
parser rule scheme.
-
#string ⇒ Object
parser rule string.
-
#term ⇒ Object
parser rule term.
-
#title ⇒ Object
parser rule title.
-
#uri ⇒ Object
parser rule uri.
-
#x_occi_attribute ⇒ Object
parser rule x_occi_attribute.
-
#x_occi_location ⇒ Object
parser rule x_occi_location.
Constructor Details
#initialize(input, options = {}) ⇒ Parser
Returns a new instance of Parser.
134 135 136 137 138 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 134 def initialize( input, = {} ) super( input, ) end |
Instance Method Details
#attribute ⇒ Object
parser rule attribute
(in OCCIANTLR.g) 115:1: attribute returns [hash] : comp_first= attribute_component ( '.' comp_next= attribute_component )* EQUALS attribute_value ;
1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1802 def attribute # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 25 ) hash = nil comp_first = nil comp_next = nil attribute_value28 = nil # - - - - @init action - - - - hash = Hashie::Mash.new begin # at line 116:6: comp_first= attribute_component ( '.' comp_next= attribute_component )* EQUALS attribute_value @state.following.push( TOKENS_FOLLOWING_attribute_component_IN_attribute_1050 ) comp_first = attribute_component @state.following.pop # --> action cur_hash = hash; comp = ( comp_first && @input.to_s( comp_first.start, comp_first.stop ) ) # <-- action # at line 117:6: ( '.' comp_next= attribute_component )* while true # decision 35 alt_35 = 2 look_35_0 = @input.peek( 1 ) if ( look_35_0 == DOT ) alt_35 = 1 end case alt_35 when 1 # at line 117:8: '.' comp_next= attribute_component match( DOT, TOKENS_FOLLOWING_DOT_IN_attribute_1061 ) @state.following.push( TOKENS_FOLLOWING_attribute_component_IN_attribute_1065 ) comp_next = attribute_component @state.following.pop # --> action cur_hash[comp.to_sym] = Hashie::Mash.new; cur_hash = cur_hash[comp.to_sym]; comp = ( comp_next && @input.to_s( comp_next.start, comp_next.stop ) ) # <-- action else break # out of loop for decision 35 end end # loop for decision 35 match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_attribute_1076 ) @state.following.push( TOKENS_FOLLOWING_attribute_value_IN_attribute_1078 ) attribute_value28 = attribute_value @state.following.pop # --> action cur_hash[comp.to_sym] = attribute_value28 # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 25 ) end return hash end |
#attribute_component ⇒ Object
parser rule attribute_component
(in OCCIANTLR.g) 124:1: attribute_component : ( LOALPHA | reserved_words ) ( LOALPHA | DIGIT | DASH | UNDERSCORE | reserved_words )* ;
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 2000 def attribute_component # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 27 ) return_value = AttributeComponentReturnValue.new # $rule.start = the first token seen before matching return_value.start = @input.look begin # at line 124:23: ( LOALPHA | reserved_words ) ( LOALPHA | DIGIT | DASH | UNDERSCORE | reserved_words )* # at line 124:23: ( LOALPHA | reserved_words ) alt_41 = 2 look_41_0 = @input.peek( 1 ) if ( look_41_0 == LOALPHA ) alt_41 = 1 elsif ( look_41_0 == SCHEME || look_41_0.between?( CLASS, ACTIONS ) || look_41_0.between?( SELF, CATEGORY ) || look_41_0.between?( KIND, ACTION ) || look_41_0.between?( LINK, TERM ) ) alt_41 = 2 else raise NoViableAlternative( "", 41, 0 ) end case alt_41 when 1 # at line 124:25: LOALPHA match( LOALPHA, TOKENS_FOLLOWING_LOALPHA_IN_attribute_component_1192 ) when 2 # at line 124:35: reserved_words @state.following.push( TOKENS_FOLLOWING_reserved_words_IN_attribute_component_1196 ) reserved_words @state.following.pop end # at line 124:51: ( LOALPHA | DIGIT | DASH | UNDERSCORE | reserved_words )* while true # decision 42 alt_42 = 6 case look_42 = @input.peek( 1 ) when LOALPHA then alt_42 = 1 when DIGIT then alt_42 = 2 when DASH then alt_42 = 3 when UNDERSCORE then alt_42 = 4 when SCHEME, CLASS, TITLE, REL, LOCATION, ATTRIBUTES, ACTIONS, SELF, CATEGORY, KIND, MIXIN, ACTION, LINK, TERM then alt_42 = 5 end case alt_42 when 1 # at line 124:53: LOALPHA match( LOALPHA, TOKENS_FOLLOWING_LOALPHA_IN_attribute_component_1201 ) when 2 # at line 124:63: DIGIT match( DIGIT, TOKENS_FOLLOWING_DIGIT_IN_attribute_component_1205 ) when 3 # at line 124:71: DASH match( DASH, TOKENS_FOLLOWING_DASH_IN_attribute_component_1209 ) when 4 # at line 124:78: UNDERSCORE match( UNDERSCORE, TOKENS_FOLLOWING_UNDERSCORE_IN_attribute_component_1213 ) when 5 # at line 124:91: reserved_words @state.following.push( TOKENS_FOLLOWING_reserved_words_IN_attribute_component_1217 ) reserved_words @state.following.pop else break # out of loop for decision 42 end end # loop for decision 42 # - - - - - - - rule clean up - - - - - - - - return_value.stop = @input.look( -1 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 27 ) end return return_value end |
#attribute_name ⇒ Object
parser rule attribute_name
(in OCCIANTLR.g) 119:1: attribute_name returns [hash] : comp_first= attribute_component ( '.' comp_next= attribute_component )* ( '( 'mutable' )? ( 'immutable' )? ( 'required' )? '' )? ;
1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1872 def attribute_name # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 26 ) hash = nil comp_first = nil comp_next = nil # - - - - @init action - - - - hash = Hashie::Mash.new begin # at line 120:27: comp_first= attribute_component ( '.' comp_next= attribute_component )* ( '{' ( 'mutable' )? ( 'immutable' )? ( 'required' )? '}' )? @state.following.push( TOKENS_FOLLOWING_attribute_component_IN_attribute_name_1122 ) comp_first = attribute_component @state.following.pop # --> action cur_hash = hash; comp = ( comp_first && @input.to_s( comp_first.start, comp_first.stop ) ) # <-- action # at line 121:6: ( '.' comp_next= attribute_component )* while true # decision 36 alt_36 = 2 look_36_0 = @input.peek( 1 ) if ( look_36_0 == DOT ) alt_36 = 1 end case alt_36 when 1 # at line 121:8: '.' comp_next= attribute_component match( DOT, TOKENS_FOLLOWING_DOT_IN_attribute_name_1133 ) @state.following.push( TOKENS_FOLLOWING_attribute_component_IN_attribute_name_1137 ) comp_next = attribute_component @state.following.pop # --> action cur_hash[comp.to_sym] = Hashie::Mash.new; cur_hash = cur_hash[comp.to_sym]; comp = ( comp_next && @input.to_s( comp_next.start, comp_next.stop ) ) # <-- action else break # out of loop for decision 36 end end # loop for decision 36 # --> action cur_hash[comp.to_sym] = ATTRIBUTE # <-- action # at line 123:6: ( '{' ( 'mutable' )? ( 'immutable' )? ( 'required' )? '}' )? alt_40 = 2 look_40_0 = @input.peek( 1 ) if ( look_40_0 == T__48 ) alt_40 = 1 end case alt_40 when 1 # at line 123:7: '{' ( 'mutable' )? ( 'immutable' )? ( 'required' )? '}' match( T__48, TOKENS_FOLLOWING_T__48_IN_attribute_name_1157 ) # at line 123:11: ( 'mutable' )? alt_37 = 2 look_37_0 = @input.peek( 1 ) if ( look_37_0 == T__49 ) alt_37 = 1 end case alt_37 when 1 # at line 123:12: 'mutable' match( T__49, TOKENS_FOLLOWING_T__49_IN_attribute_name_1160 ) # --> action cur_hash[comp.to_sym][:mutable] = true # <-- action end # at line 123:67: ( 'immutable' )? alt_38 = 2 look_38_0 = @input.peek( 1 ) if ( look_38_0 == T__50 ) alt_38 = 1 end case alt_38 when 1 # at line 123:68: 'immutable' match( T__50, TOKENS_FOLLOWING_T__50_IN_attribute_name_1167 ) # --> action cur_hash[comp.to_sym][:mutable] = false # <-- action end # at line 123:126: ( 'required' )? alt_39 = 2 look_39_0 = @input.peek( 1 ) if ( look_39_0 == T__51 ) alt_39 = 1 end case alt_39 when 1 # at line 123:127: 'required' match( T__51, TOKENS_FOLLOWING_T__51_IN_attribute_name_1174 ) # --> action cur_hash[comp.to_sym][:required] = true # <-- action end match( T__52, TOKENS_FOLLOWING_T__52_IN_attribute_name_1180 ) end rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 26 ) end return hash end |
#attribute_value ⇒ Object
parser rule attribute_value
(in OCCIANTLR.g) 125:1: attribute_value returns [value] : ( quoted_string | number ) ;
2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 2093 def attribute_value # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 28 ) value = nil quoted_string29 = nil number30 = nil begin # at line 125:35: ( quoted_string | number ) # at line 125:35: ( quoted_string | number ) alt_43 = 2 look_43_0 = @input.peek( 1 ) if ( look_43_0 == QUOTE ) alt_43 = 1 elsif ( look_43_0 == DIGIT ) alt_43 = 2 else raise NoViableAlternative( "", 43, 0 ) end case alt_43 when 1 # at line 125:37: quoted_string @state.following.push( TOKENS_FOLLOWING_quoted_string_IN_attribute_value_1234 ) quoted_string29 = quoted_string @state.following.pop # --> action value = quoted_string29 # <-- action when 2 # at line 125:85: number @state.following.push( TOKENS_FOLLOWING_number_IN_attribute_value_1240 ) number30 = number @state.following.pop # --> action value = ( number30 && @input.to_s( number30.start, number30.stop ) ).to_i # <-- action end rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 28 ) end return value end |
#category ⇒ Object
parser rule category
(in OCCIANTLR.g) 25:1: category returns [hash] : CATEGORY_KEY COLON category_value ;
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 147 def category # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 1 ) hash = nil category_value1 = nil begin # at line 26:4: CATEGORY_KEY COLON category_value match( CATEGORY_KEY, TOKENS_FOLLOWING_CATEGORY_KEY_IN_category_39 ) match( COLON, TOKENS_FOLLOWING_COLON_IN_category_41 ) @state.following.push( TOKENS_FOLLOWING_category_value_IN_category_43 ) category_value1 = category_value @state.following.pop # --> action hash = category_value1 # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 1 ) end return hash end |
#category_actions ⇒ Object
parser rule category_actions
(in OCCIANTLR.g) 56:3: category_actions returns [array] : SEMICOLON ( WS )? ACTIONS EQUALS QUOTE act= uri ( WS next_act= uri )* QUOTE ;
769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 769 def category_actions # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 10 ) array = nil act = nil next_act = nil # - - - - @init action - - - - array = Array.new begin # at line 57:10: SEMICOLON ( WS )? ACTIONS EQUALS QUOTE act= uri ( WS next_act= uri )* QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_category_actions_437 ) # at line 57:20: ( WS )? alt_15 = 2 look_15_0 = @input.peek( 1 ) if ( look_15_0 == WS ) alt_15 = 1 end case alt_15 when 1 # at line 57:20: WS match( WS, TOKENS_FOLLOWING_WS_IN_category_actions_439 ) end match( ACTIONS, TOKENS_FOLLOWING_ACTIONS_IN_category_actions_442 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_category_actions_444 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_actions_446 ) @state.following.push( TOKENS_FOLLOWING_uri_IN_category_actions_450 ) act = uri @state.following.pop # --> action array << ( act && @input.to_s( act.start, act.stop ) ) # <-- action # at line 58:10: ( WS next_act= uri )* while true # decision 16 alt_16 = 2 look_16_0 = @input.peek( 1 ) if ( look_16_0 == WS ) alt_16 = 1 end case alt_16 when 1 # at line 58:12: WS next_act= uri match( WS, TOKENS_FOLLOWING_WS_IN_category_actions_466 ) @state.following.push( TOKENS_FOLLOWING_uri_IN_category_actions_470 ) next_act = uri @state.following.pop # --> action array << ( next_act && @input.to_s( next_act.start, next_act.stop ) ) # <-- action else break # out of loop for decision 16 end end # loop for decision 16 match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_actions_477 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 10 ) end return array end |
#category_attributes ⇒ Object
parser rule category_attributes
(in OCCIANTLR.g) 53:3: category_attributes returns [hash] : SEMICOLON ( WS )? ATTRIBUTES EQUALS QUOTE attr= attribute_name ( WS next_attr= attribute_name )* QUOTE ;
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 689 def category_attributes # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 9 ) hash = nil attr = nil next_attr = nil # - - - - @init action - - - - hash = Hashie::Mash.new begin # at line 54:10: SEMICOLON ( WS )? ATTRIBUTES EQUALS QUOTE attr= attribute_name ( WS next_attr= attribute_name )* QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_category_attributes_367 ) # at line 54:20: ( WS )? alt_13 = 2 look_13_0 = @input.peek( 1 ) if ( look_13_0 == WS ) alt_13 = 1 end case alt_13 when 1 # at line 54:20: WS match( WS, TOKENS_FOLLOWING_WS_IN_category_attributes_369 ) end match( ATTRIBUTES, TOKENS_FOLLOWING_ATTRIBUTES_IN_category_attributes_372 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_category_attributes_374 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_attributes_376 ) @state.following.push( TOKENS_FOLLOWING_attribute_name_IN_category_attributes_380 ) attr = attribute_name @state.following.pop # --> action hash.merge!(attr) # <-- action # at line 55:10: ( WS next_attr= attribute_name )* while true # decision 14 alt_14 = 2 look_14_0 = @input.peek( 1 ) if ( look_14_0 == WS ) alt_14 = 1 end case alt_14 when 1 # at line 55:12: WS next_attr= attribute_name match( WS, TOKENS_FOLLOWING_WS_IN_category_attributes_395 ) @state.following.push( TOKENS_FOLLOWING_attribute_name_IN_category_attributes_399 ) next_attr = attribute_name @state.following.pop # --> action hash.merge!(next_attr) # <-- action else break # out of loop for decision 14 end end # loop for decision 14 match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_attributes_407 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 9 ) end return hash end |
#category_class ⇒ Object
parser rule category_class
(in OCCIANTLR.g) 45:3: category_class returns [value] : SEMICOLON ( WS )? CLASS EQUALS QUOTE class_type QUOTE ;
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 477 def category_class # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 5 ) value = nil class_type12 = nil begin # at line 45:37: SEMICOLON ( WS )? CLASS EQUALS QUOTE class_type QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_category_class_199 ) # at line 45:47: ( WS )? alt_9 = 2 look_9_0 = @input.peek( 1 ) if ( look_9_0 == WS ) alt_9 = 1 end case alt_9 when 1 # at line 45:47: WS match( WS, TOKENS_FOLLOWING_WS_IN_category_class_201 ) end match( CLASS, TOKENS_FOLLOWING_CLASS_IN_category_class_204 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_category_class_206 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_class_208 ) @state.following.push( TOKENS_FOLLOWING_class_type_IN_category_class_210 ) class_type12 = class_type @state.following.pop match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_class_212 ) # --> action value = ( class_type12 && @input.to_s( class_type12.start, class_type12.stop ) ) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 5 ) end return value end |
#category_location ⇒ Object
parser rule category_location
(in OCCIANTLR.g) 51:3: category_location returns [value] : SEMICOLON ( WS )? LOCATION EQUALS QUOTE uri QUOTE ;
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 636 def category_location # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 8 ) value = nil uri15 = nil begin # at line 51:39: SEMICOLON ( WS )? LOCATION EQUALS QUOTE uri QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_category_location_315 ) # at line 51:49: ( WS )? alt_12 = 2 look_12_0 = @input.peek( 1 ) if ( look_12_0 == WS ) alt_12 = 1 end case alt_12 when 1 # at line 51:49: WS match( WS, TOKENS_FOLLOWING_WS_IN_category_location_317 ) end match( LOCATION, TOKENS_FOLLOWING_LOCATION_IN_category_location_320 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_category_location_322 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_location_324 ) @state.following.push( TOKENS_FOLLOWING_uri_IN_category_location_326 ) uri15 = uri @state.following.pop match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_location_328 ) # --> action value = ( uri15 && @input.to_s( uri15.start, uri15.stop ) ) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 8 ) end return value end |
#category_rel ⇒ Object
parser rule category_rel
(in OCCIANTLR.g) 49:3: category_rel returns [value] : SEMICOLON ( WS )? REL EQUALS QUOTE uri QUOTE ;
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 583 def category_rel # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 7 ) value = nil uri14 = nil begin # at line 49:35: SEMICOLON ( WS )? REL EQUALS QUOTE uri QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_category_rel_277 ) # at line 49:45: ( WS )? alt_11 = 2 look_11_0 = @input.peek( 1 ) if ( look_11_0 == WS ) alt_11 = 1 end case alt_11 when 1 # at line 49:45: WS match( WS, TOKENS_FOLLOWING_WS_IN_category_rel_279 ) end match( REL, TOKENS_FOLLOWING_REL_IN_category_rel_282 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_category_rel_284 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_rel_286 ) @state.following.push( TOKENS_FOLLOWING_uri_IN_category_rel_288 ) uri14 = uri @state.following.pop match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_rel_290 ) # --> action value = [( uri14 && @input.to_s( uri14.start, uri14.stop ) )] # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 7 ) end return value end |
#category_scheme ⇒ Object
parser rule category_scheme
(in OCCIANTLR.g) 43:3: category_scheme returns [value] : SEMICOLON ( WS )? SCHEME EQUALS QUOTE scheme QUOTE ;
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 424 def category_scheme # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 4 ) value = nil scheme11 = nil begin # at line 43:37: SEMICOLON ( WS )? SCHEME EQUALS QUOTE scheme QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_category_scheme_157 ) # at line 43:47: ( WS )? alt_8 = 2 look_8_0 = @input.peek( 1 ) if ( look_8_0 == WS ) alt_8 = 1 end case alt_8 when 1 # at line 43:47: WS match( WS, TOKENS_FOLLOWING_WS_IN_category_scheme_159 ) end match( SCHEME, TOKENS_FOLLOWING_SCHEME_IN_category_scheme_162 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_category_scheme_164 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_scheme_166 ) @state.following.push( TOKENS_FOLLOWING_scheme_IN_category_scheme_168 ) scheme11 = scheme @state.following.pop match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_scheme_170 ) # --> action value = ( scheme11 && @input.to_s( scheme11.start, scheme11.stop ) ) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 4 ) end return value end |
#category_term ⇒ Object
parser rule category_term
(in OCCIANTLR.g) 41:3: category_term returns [value] : ( WS )? term ;
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 376 def category_term # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 3 ) value = nil term10 = nil begin # at line 41:37: ( WS )? term # at line 41:37: ( WS )? alt_7 = 2 look_7_0 = @input.peek( 1 ) if ( look_7_0 == WS ) alt_7 = 1 end case alt_7 when 1 # at line 41:37: WS match( WS, TOKENS_FOLLOWING_WS_IN_category_term_128 ) end @state.following.push( TOKENS_FOLLOWING_term_IN_category_term_131 ) term10 = term @state.following.pop # --> action value = ( term10 && @input.to_s( term10.start, term10.stop ) ) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 3 ) end return value end |
#category_title ⇒ Object
parser rule category_title
(in OCCIANTLR.g) 47:3: category_title returns [value] : SEMICOLON ( WS )? TITLE EQUALS QUOTE title QUOTE ;
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 530 def category_title # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 6 ) value = nil title13 = nil begin # at line 47:37: SEMICOLON ( WS )? TITLE EQUALS QUOTE title QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_category_title_237 ) # at line 47:47: ( WS )? alt_10 = 2 look_10_0 = @input.peek( 1 ) if ( look_10_0 == WS ) alt_10 = 1 end case alt_10 when 1 # at line 47:47: WS match( WS, TOKENS_FOLLOWING_WS_IN_category_title_239 ) end match( TITLE, TOKENS_FOLLOWING_TITLE_IN_category_title_242 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_category_title_244 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_title_246 ) @state.following.push( TOKENS_FOLLOWING_title_IN_category_title_248 ) title13 = title @state.following.pop match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_title_250 ) # --> action value = ( title13 && @input.to_s( title13.start, title13.stop ) ) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 6 ) end return value end |
#category_value ⇒ Object
parser rule category_value
(in OCCIANTLR.g) 27:3: category_value returns [hash] : category_term category_scheme category_class ( category_title )? ( category_rel )? ( category_location )? ( category_attributes )? ( category_actions )? ( SEMICOLON )? ;
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 184 def category_value # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 2 ) hash = nil category_class2 = nil category_term3 = nil category_scheme4 = nil category_title5 = nil category_rel6 = nil category_location7 = nil category_attributes8 = nil category_actions9 = nil # - - - - @init action - - - - hash = Hashie::Mash.new( {:kinds=>[],:mixins=>[],:actions=>[] } ) begin # at line 29:15: category_term category_scheme category_class ( category_title )? ( category_rel )? ( category_location )? ( category_attributes )? ( category_actions )? ( SEMICOLON )? @state.following.push( TOKENS_FOLLOWING_category_term_IN_category_value_75 ) category_term3 = category_term @state.following.pop @state.following.push( TOKENS_FOLLOWING_category_scheme_IN_category_value_77 ) category_scheme4 = category_scheme @state.following.pop @state.following.push( TOKENS_FOLLOWING_category_class_IN_category_value_79 ) category_class2 = category_class @state.following.pop # at line 29:60: ( category_title )? alt_1 = 2 look_1_0 = @input.peek( 1 ) if ( look_1_0 == SEMICOLON ) look_1_1 = @input.peek( 2 ) if ( look_1_1 == WS ) look_1_3 = @input.peek( 3 ) if ( look_1_3 == TITLE ) alt_1 = 1 end elsif ( look_1_1 == TITLE ) alt_1 = 1 end end case alt_1 when 1 # at line 29:60: category_title @state.following.push( TOKENS_FOLLOWING_category_title_IN_category_value_81 ) category_title5 = category_title @state.following.pop end # at line 29:76: ( category_rel )? alt_2 = 2 look_2_0 = @input.peek( 1 ) if ( look_2_0 == SEMICOLON ) look_2_1 = @input.peek( 2 ) if ( look_2_1 == WS ) look_2_3 = @input.peek( 3 ) if ( look_2_3 == REL ) alt_2 = 1 end elsif ( look_2_1 == REL ) alt_2 = 1 end end case alt_2 when 1 # at line 29:76: category_rel @state.following.push( TOKENS_FOLLOWING_category_rel_IN_category_value_84 ) category_rel6 = category_rel @state.following.pop end # at line 29:90: ( category_location )? alt_3 = 2 look_3_0 = @input.peek( 1 ) if ( look_3_0 == SEMICOLON ) look_3_1 = @input.peek( 2 ) if ( look_3_1 == WS ) look_3_3 = @input.peek( 3 ) if ( look_3_3 == LOCATION ) alt_3 = 1 end elsif ( look_3_1 == LOCATION ) alt_3 = 1 end end case alt_3 when 1 # at line 29:90: category_location @state.following.push( TOKENS_FOLLOWING_category_location_IN_category_value_87 ) category_location7 = category_location @state.following.pop end # at line 29:109: ( category_attributes )? alt_4 = 2 look_4_0 = @input.peek( 1 ) if ( look_4_0 == SEMICOLON ) look_4_1 = @input.peek( 2 ) if ( look_4_1 == WS ) look_4_3 = @input.peek( 3 ) if ( look_4_3 == ATTRIBUTES ) alt_4 = 1 end elsif ( look_4_1 == ATTRIBUTES ) alt_4 = 1 end end case alt_4 when 1 # at line 29:109: category_attributes @state.following.push( TOKENS_FOLLOWING_category_attributes_IN_category_value_90 ) category_attributes8 = category_attributes @state.following.pop end # at line 29:130: ( category_actions )? alt_5 = 2 look_5_0 = @input.peek( 1 ) if ( look_5_0 == SEMICOLON ) look_5_1 = @input.peek( 2 ) if ( look_5_1 == WS || look_5_1 == ACTIONS ) alt_5 = 1 end end case alt_5 when 1 # at line 29:130: category_actions @state.following.push( TOKENS_FOLLOWING_category_actions_IN_category_value_93 ) category_actions9 = category_actions @state.following.pop end # at line 29:148: ( SEMICOLON )? alt_6 = 2 look_6_0 = @input.peek( 1 ) if ( look_6_0 == SEMICOLON ) alt_6 = 1 end case alt_6 when 1 # at line 29:148: SEMICOLON match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_category_value_96 ) end # --> action type = category_class2 cat = Hashie::Mash.new cat.term = category_term3 cat.scheme = category_scheme4 cat.title = category_title5 cat. = category_rel6 cat.location = category_location7 cat.attributes = category_attributes8 cat.actions = category_actions9 hash[(type+'s').to_sym] << cat # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 2 ) end return hash end |
#class_type ⇒ Object
parser rule class_type
(in OCCIANTLR.g) 113:1: class_type : ( KIND | MIXIN | ACTION ) ;
1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1700 def class_type # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 23 ) return_value = ClassTypeReturnValue.new # $rule.start = the first token seen before matching return_value.start = @input.look begin # at line 113:15: ( KIND | MIXIN | ACTION ) if @input.peek( 1 ).between?( KIND, ACTION ) @input.consume @state.error_recovery = false else mse = MismatchedSet( nil ) raise mse end # - - - - - - - rule clean up - - - - - - - - return_value.stop = @input.look( -1 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 23 ) end return return_value end |
#digits ⇒ Object
parser rule digits
(in OCCIANTLR.g) 191:1: digits : ( DIGIT )+ ;
2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 2343 def digits # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 33 ) begin # at line 191:10: ( DIGIT )+ # at file 191:10: ( DIGIT )+ match_count_46 = 0 while true alt_46 = 2 look_46_0 = @input.peek( 1 ) if ( look_46_0 == DIGIT ) alt_46 = 1 end case alt_46 when 1 # at line 191:10: DIGIT match( DIGIT, TOKENS_FOLLOWING_DIGIT_IN_digits_1776 ) else match_count_46 > 0 and break eee = EarlyExit(46) raise eee end match_count_46 += 1 end rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 33 ) end return end |
#initialize_dfas ⇒ Object (private)
2717 2718 2719 2720 2721 2722 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 2717 def initialize_dfas super rescue nil @dfa17 = DFA17.new( self, 17 ) @dfa18 = DFA18.new( self, 18 ) end |
#link ⇒ Object
parser rule link
(in OCCIANTLR.g) 69:1: link returns [hash] : LINK_KEY COLON link_value ;
849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 849 def link # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 11 ) hash = nil link_value16 = nil begin # at line 70:4: LINK_KEY COLON link_value match( LINK_KEY, TOKENS_FOLLOWING_LINK_KEY_IN_link_494 ) match( COLON, TOKENS_FOLLOWING_COLON_IN_link_496 ) @state.following.push( TOKENS_FOLLOWING_link_value_IN_link_498 ) link_value16 = link_value @state.following.pop # --> action hash = link_value16 # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 11 ) end return hash end |
#link_attributes ⇒ Object
parser rule link_attributes
(in OCCIANTLR.g) 85:2: link_attributes returns [hash] : SEMICOLON ( ( WS )? attribute )* ;
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1216 def link_attributes # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 17 ) hash = nil attribute25 = nil # - - - - @init action - - - - hash = Hashie::Mash.new begin # at line 86:8: SEMICOLON ( ( WS )? attribute )* match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_link_attributes_753 ) # at line 86:18: ( ( WS )? attribute )* while true # decision 26 alt_26 = 2 look_26_0 = @input.peek( 1 ) if ( look_26_0.between?( WS, SCHEME ) || look_26_0.between?( CLASS, ACTIONS ) || look_26_0.between?( SELF, CATEGORY ) || look_26_0 == LOALPHA || look_26_0.between?( KIND, ACTION ) || look_26_0.between?( LINK, TERM ) ) alt_26 = 1 end case alt_26 when 1 # at line 86:19: ( WS )? attribute # at line 86:19: ( WS )? alt_25 = 2 look_25_0 = @input.peek( 1 ) if ( look_25_0 == WS ) alt_25 = 1 end case alt_25 when 1 # at line 86:19: WS match( WS, TOKENS_FOLLOWING_WS_IN_link_attributes_756 ) end @state.following.push( TOKENS_FOLLOWING_attribute_IN_link_attributes_759 ) attribute25 = attribute @state.following.pop # --> action hash.merge!(attribute25) # <-- action else break # out of loop for decision 26 end end # loop for decision 26 rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 17 ) end return hash end |
#link_category ⇒ Object
parser rule link_category
(in OCCIANTLR.g) 83:2: link_category returns [array] : SEMICOLON ( WS )? CATEGORY EQUALS QUOTE kind= uri ( WS mixin= uri )* QUOTE ;
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1136 def link_category # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 16 ) array = nil kind = nil mixin = nil # - - - - @init action - - - - array = Array.new begin # at line 84:36: SEMICOLON ( WS )? CATEGORY EQUALS QUOTE kind= uri ( WS mixin= uri )* QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_link_category_702 ) # at line 84:46: ( WS )? alt_23 = 2 look_23_0 = @input.peek( 1 ) if ( look_23_0 == WS ) alt_23 = 1 end case alt_23 when 1 # at line 84:46: WS match( WS, TOKENS_FOLLOWING_WS_IN_link_category_704 ) end match( CATEGORY, TOKENS_FOLLOWING_CATEGORY_IN_link_category_707 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_link_category_709 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_link_category_711 ) @state.following.push( TOKENS_FOLLOWING_uri_IN_link_category_715 ) kind = uri @state.following.pop # --> action array << ( kind && @input.to_s( kind.start, kind.stop ) ) # <-- action # at line 84:105: ( WS mixin= uri )* while true # decision 24 alt_24 = 2 look_24_0 = @input.peek( 1 ) if ( look_24_0 == WS ) alt_24 = 1 end case alt_24 when 1 # at line 84:106: WS mixin= uri match( WS, TOKENS_FOLLOWING_WS_IN_link_category_720 ) @state.following.push( TOKENS_FOLLOWING_uri_IN_link_category_724 ) mixin = uri @state.following.pop # --> action array << ( mixin && @input.to_s( mixin.start, mixin.stop ) ) # <-- action else break # out of loop for decision 24 end end # loop for decision 24 match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_link_category_730 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 16 ) end return array end |
#link_rel ⇒ Object
parser rule link_rel
(in OCCIANTLR.g) 81:2: link_rel returns [value] : SEMICOLON ( WS )? REL EQUALS QUOTE uri QUOTE ;
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1030 def link_rel # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 14 ) value = nil uri23 = nil begin # at line 81:30: SEMICOLON ( WS )? REL EQUALS QUOTE uri QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_link_rel_608 ) # at line 81:40: ( WS )? alt_21 = 2 look_21_0 = @input.peek( 1 ) if ( look_21_0 == WS ) alt_21 = 1 end case alt_21 when 1 # at line 81:40: WS match( WS, TOKENS_FOLLOWING_WS_IN_link_rel_610 ) end match( REL, TOKENS_FOLLOWING_REL_IN_link_rel_613 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_link_rel_615 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_link_rel_617 ) @state.following.push( TOKENS_FOLLOWING_uri_IN_link_rel_619 ) uri23 = uri @state.following.pop match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_link_rel_621 ) # --> action value = ( uri23 && @input.to_s( uri23.start, uri23.stop ) ) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 14 ) end return value end |
#link_self ⇒ Object
parser rule link_self
(in OCCIANTLR.g) 82:2: link_self returns [value] : SEMICOLON ( WS )? SELF EQUALS QUOTE uri QUOTE ;
1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1083 def link_self # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 15 ) value = nil uri24 = nil begin # at line 82:31: SEMICOLON ( WS )? SELF EQUALS QUOTE uri QUOTE match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_link_self_636 ) # at line 82:41: ( WS )? alt_22 = 2 look_22_0 = @input.peek( 1 ) if ( look_22_0 == WS ) alt_22 = 1 end case alt_22 when 1 # at line 82:41: WS match( WS, TOKENS_FOLLOWING_WS_IN_link_self_638 ) end match( SELF, TOKENS_FOLLOWING_SELF_IN_link_self_641 ) match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_link_self_643 ) match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_link_self_645 ) @state.following.push( TOKENS_FOLLOWING_uri_IN_link_self_647 ) uri24 = uri @state.following.pop match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_link_self_649 ) # --> action value = ( uri24 && @input.to_s( uri24.start, uri24.stop ) ) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 15 ) end return value end |
#link_target ⇒ Object
parser rule link_target
(in OCCIANTLR.g) 80:2: link_target returns [value] : ( WS )? LT uri GT ;
980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 980 def link_target # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 13 ) value = nil uri22 = nil begin # at line 80:32: ( WS )? LT uri GT # at line 80:32: ( WS )? alt_20 = 2 look_20_0 = @input.peek( 1 ) if ( look_20_0 == WS ) alt_20 = 1 end case alt_20 when 1 # at line 80:32: WS match( WS, TOKENS_FOLLOWING_WS_IN_link_target_586 ) end match( LT, TOKENS_FOLLOWING_LT_IN_link_target_589 ) @state.following.push( TOKENS_FOLLOWING_uri_IN_link_target_591 ) uri22 = uri @state.following.pop match( GT, TOKENS_FOLLOWING_GT_IN_link_target_593 ) # --> action value = ( uri22 && @input.to_s( uri22.start, uri22.stop ) ) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 13 ) end return value end |
#link_value ⇒ Object
parser rule link_value
(in OCCIANTLR.g) 71:2: link_value returns [hash] : link_target link_rel ( link_self )? ( link_category )? link_attributes ( SEMICOLON )? ;
886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 886 def link_value # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 12 ) hash = nil link_target17 = nil link_rel18 = nil link_self19 = nil link_category20 = nil link_attributes21 = nil # - - - - @init action - - - - hash = Hashie::Mash.new begin # at line 73:6: link_target link_rel ( link_self )? ( link_category )? link_attributes ( SEMICOLON )? @state.following.push( TOKENS_FOLLOWING_link_target_IN_link_value_520 ) link_target17 = link_target @state.following.pop # --> action hash[:target] = link_target17 # <-- action @state.following.push( TOKENS_FOLLOWING_link_rel_IN_link_value_529 ) link_rel18 = link_rel @state.following.pop # --> action hash[:rel] = link_rel18 # <-- action # at line 75:6: ( link_self )? alt_17 = 2 alt_17 = @dfa17.predict( @input ) case alt_17 when 1 # at line 75:6: link_self @state.following.push( TOKENS_FOLLOWING_link_self_IN_link_value_538 ) link_self19 = link_self @state.following.pop end # --> action hash[:self] = link_self19 # <-- action # at line 76:6: ( link_category )? alt_18 = 2 alt_18 = @dfa18.predict( @input ) case alt_18 when 1 # at line 76:6: link_category @state.following.push( TOKENS_FOLLOWING_link_category_IN_link_value_548 ) link_category20 = link_category @state.following.pop end # --> action hash[:categories] = link_category20 # <-- action @state.following.push( TOKENS_FOLLOWING_link_attributes_IN_link_value_558 ) link_attributes21 = link_attributes @state.following.pop # --> action hash[:attributes] = link_attributes21 # <-- action # at line 78:6: ( SEMICOLON )? alt_19 = 2 look_19_0 = @input.peek( 1 ) if ( look_19_0 == SEMICOLON ) alt_19 = 1 end case alt_19 when 1 # at line 78:6: SEMICOLON match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_link_value_567 ) end rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 12 ) end return hash end |
#number ⇒ Object
parser rule number
(in OCCIANTLR.g) 126:1: number : ( digits ( DOT digits )? ) ;
2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 2155 def number # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 29 ) return_value = NumberReturnValue.new # $rule.start = the first token seen before matching return_value.start = @input.look begin # at line 126:12: ( digits ( DOT digits )? ) # at line 126:12: ( digits ( DOT digits )? ) # at line 126:14: digits ( DOT digits )? @state.following.push( TOKENS_FOLLOWING_digits_IN_number_1255 ) digits @state.following.pop # at line 126:21: ( DOT digits )? alt_44 = 2 look_44_0 = @input.peek( 1 ) if ( look_44_0 == DOT ) alt_44 = 1 end case alt_44 when 1 # at line 126:23: DOT digits match( DOT, TOKENS_FOLLOWING_DOT_IN_number_1259 ) @state.following.push( TOKENS_FOLLOWING_digits_IN_number_1261 ) digits @state.following.pop end # - - - - - - - rule clean up - - - - - - - - return_value.stop = @input.look( -1 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 29 ) end return return_value end |
#quoted_string ⇒ Object
parser rule quoted_string
(in OCCIANTLR.g) 188:1: quoted_string returns [text] : QUOTE string QUOTE ;
2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 2246 def quoted_string # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 31 ) text = nil string31 = nil begin # at line 189:4: QUOTE string QUOTE match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_quoted_string_1727 ) @state.following.push( TOKENS_FOLLOWING_string_IN_quoted_string_1729 ) string31 = string @state.following.pop match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_quoted_string_1731 ) # --> action text = ( string31 && @input.to_s( string31.start, string31.stop ) ) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 31 ) end return text end |
#reserved_words ⇒ Object
parser rule reserved_words
(in OCCIANTLR.g) 127:1: reserved_words : ( ACTION | ACTIONS | ATTRIBUTES | CATEGORY | CLASS | KIND | LINK | LOCATION | MIXIN | REL | SCHEME | SELF | TERM | TITLE ) ;
2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 2210 def reserved_words # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 30 ) begin # at line 128:4: ( ACTION | ACTIONS | ATTRIBUTES | CATEGORY | CLASS | KIND | LINK | LOCATION | MIXIN | REL | SCHEME | SELF | TERM | TITLE ) if @input.peek(1) == SCHEME || @input.peek( 1 ).between?( CLASS, ACTIONS ) || @input.peek( 1 ).between?( SELF, CATEGORY ) || @input.peek( 1 ).between?( KIND, ACTION ) || @input.peek( 1 ).between?( LINK, TERM ) @input.consume @state.error_recovery = false else mse = MismatchedSet( nil ) raise mse end rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 30 ) end return end |
#scheme ⇒ Object
parser rule scheme
(in OCCIANTLR.g) 112:1: scheme : uri ;
1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1663 def scheme # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 22 ) return_value = SchemeReturnValue.new # $rule.start = the first token seen before matching return_value.start = @input.look begin # at line 112:20: uri @state.following.push( TOKENS_FOLLOWING_uri_IN_scheme_973 ) uri @state.following.pop # - - - - - - - rule clean up - - - - - - - - return_value.stop = @input.look( -1 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 22 ) end return return_value end |
#string ⇒ Object
parser rule string
(in OCCIANTLR.g) 190:1: string : ( ESC | ~ ( '\\' | QUOTE | '\'' ) | '\'' )* ;
2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 2284 def string # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 32 ) return_value = StringReturnValue.new # $rule.start = the first token seen before matching return_value.start = @input.look begin # at line 190:11: ( ESC | ~ ( '\\\\' | QUOTE | '\\'' ) | '\\'' )* # at line 190:11: ( ESC | ~ ( '\\\\' | QUOTE | '\\'' ) | '\\'' )* while true # decision 45 alt_45 = 2 look_45_0 = @input.peek( 1 ) if ( look_45_0.between?( CATEGORY_KEY, EQUALS ) || look_45_0.between?( CLASS, UNDERSCORE ) || look_45_0.between?( PLUS, T__52 ) ) alt_45 = 1 end case alt_45 when 1 # at line if @input.peek( 1 ).between?( CATEGORY_KEY, EQUALS ) || @input.peek( 1 ).between?( CLASS, UNDERSCORE ) || @input.peek( 1 ).between?( PLUS, T__52 ) @input.consume @state.error_recovery = false else mse = MismatchedSet( nil ) raise mse end else break # out of loop for decision 45 end end # loop for decision 45 # - - - - - - - rule clean up - - - - - - - - return_value.stop = @input.look( -1 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 32 ) end return return_value end |
#term ⇒ Object
parser rule term
(in OCCIANTLR.g) 111:1: term : ( LOALPHA | reserved_words ) ( LOALPHA | DIGIT | DASH | UNDERSCORE | DOT | reserved_words )* ;
1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1564 def term # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 21 ) return_value = TermReturnValue.new # $rule.start = the first token seen before matching return_value.start = @input.look begin # at line 111:10: ( LOALPHA | reserved_words ) ( LOALPHA | DIGIT | DASH | UNDERSCORE | DOT | reserved_words )* # at line 111:10: ( LOALPHA | reserved_words ) alt_32 = 2 look_32_0 = @input.peek( 1 ) if ( look_32_0 == LOALPHA ) alt_32 = 1 elsif ( look_32_0 == SCHEME || look_32_0.between?( CLASS, ACTIONS ) || look_32_0.between?( SELF, CATEGORY ) || look_32_0.between?( KIND, ACTION ) || look_32_0.between?( LINK, TERM ) ) alt_32 = 2 else raise NoViableAlternative( "", 32, 0 ) end case alt_32 when 1 # at line 111:12: LOALPHA match( LOALPHA, TOKENS_FOLLOWING_LOALPHA_IN_term_923 ) when 2 # at line 111:22: reserved_words @state.following.push( TOKENS_FOLLOWING_reserved_words_IN_term_927 ) reserved_words @state.following.pop end # at line 111:39: ( LOALPHA | DIGIT | DASH | UNDERSCORE | DOT | reserved_words )* while true # decision 33 alt_33 = 7 case look_33 = @input.peek( 1 ) when LOALPHA then alt_33 = 1 when DIGIT then alt_33 = 2 when DASH then alt_33 = 3 when UNDERSCORE then alt_33 = 4 when DOT then alt_33 = 5 when SCHEME, CLASS, TITLE, REL, LOCATION, ATTRIBUTES, ACTIONS, SELF, CATEGORY, KIND, MIXIN, ACTION, LINK, TERM then alt_33 = 6 end case alt_33 when 1 # at line 111:41: LOALPHA match( LOALPHA, TOKENS_FOLLOWING_LOALPHA_IN_term_933 ) when 2 # at line 111:51: DIGIT match( DIGIT, TOKENS_FOLLOWING_DIGIT_IN_term_937 ) when 3 # at line 111:59: DASH match( DASH, TOKENS_FOLLOWING_DASH_IN_term_941 ) when 4 # at line 111:66: UNDERSCORE match( UNDERSCORE, TOKENS_FOLLOWING_UNDERSCORE_IN_term_945 ) when 5 # at line 111:79: DOT match( DOT, TOKENS_FOLLOWING_DOT_IN_term_949 ) when 6 # at line 111:85: reserved_words @state.following.push( TOKENS_FOLLOWING_reserved_words_IN_term_953 ) reserved_words @state.following.pop else break # out of loop for decision 33 end end # loop for decision 33 # - - - - - - - rule clean up - - - - - - - - return_value.stop = @input.look( -1 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 21 ) end return return_value end |
#title ⇒ Object
parser rule title
(in OCCIANTLR.g) 114:1: title : ( ESC | ~ ( BACKSLASH | QUOTE | SQUOTE ) | SQUOTE )* ;
1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1743 def title # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 24 ) return_value = TitleReturnValue.new # $rule.start = the first token seen before matching return_value.start = @input.look begin # at line 114:11: ( ESC | ~ ( BACKSLASH | QUOTE | SQUOTE ) | SQUOTE )* # at line 114:11: ( ESC | ~ ( BACKSLASH | QUOTE | SQUOTE ) | SQUOTE )* while true # decision 34 alt_34 = 2 look_34_0 = @input.peek( 1 ) if ( look_34_0.between?( CATEGORY_KEY, EQUALS ) || look_34_0.between?( CLASS, UNDERSCORE ) || look_34_0.between?( PLUS, T__52 ) ) alt_34 = 1 end case alt_34 when 1 # at line if @input.peek( 1 ).between?( CATEGORY_KEY, EQUALS ) || @input.peek( 1 ).between?( CLASS, UNDERSCORE ) || @input.peek( 1 ).between?( PLUS, T__52 ) @input.consume @state.error_recovery = false else mse = MismatchedSet( nil ) raise mse end else break # out of loop for decision 34 end end # loop for decision 34 # - - - - - - - rule clean up - - - - - - - - return_value.stop = @input.look( -1 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 24 ) end return return_value end |
#uri ⇒ Object
parser rule uri
(in OCCIANTLR.g) 110:1: uri : ( LOALPHA | UPALPHA | DIGIT | AT | COLON | PERCENT | UNDERSCORE | BACKSLASH | PLUS | DOT | TILDE | HASH | QUESTION | AMPERSAND | SLASH | EQUALS | DASH | X_OCCI_ATTRIBUTE_KEY | X_OCCI_LOCATION_KEY | reserved_words )+ ;
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 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1411 def uri # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 20 ) return_value = UriReturnValue.new # $rule.start = the first token seen before matching return_value.start = @input.look begin # at line 110:9: ( LOALPHA | UPALPHA | DIGIT | AT | COLON | PERCENT | UNDERSCORE | BACKSLASH | PLUS | DOT | TILDE | HASH | QUESTION | AMPERSAND | SLASH | EQUALS | DASH | X_OCCI_ATTRIBUTE_KEY | X_OCCI_LOCATION_KEY | reserved_words )+ # at file 110:9: ( LOALPHA | UPALPHA | DIGIT | AT | COLON | PERCENT | UNDERSCORE | BACKSLASH | PLUS | DOT | TILDE | HASH | QUESTION | AMPERSAND | SLASH | EQUALS | DASH | X_OCCI_ATTRIBUTE_KEY | X_OCCI_LOCATION_KEY | reserved_words )+ match_count_31 = 0 while true alt_31 = 21 case look_31 = @input.peek( 1 ) when LOALPHA then alt_31 = 1 when UPALPHA then alt_31 = 2 when DIGIT then alt_31 = 3 when AT then alt_31 = 4 when COLON then alt_31 = 5 when PERCENT then alt_31 = 6 when UNDERSCORE then alt_31 = 7 when BACKSLASH then alt_31 = 8 when PLUS then alt_31 = 9 when DOT then alt_31 = 10 when TILDE then alt_31 = 11 when HASH then alt_31 = 12 when QUESTION then alt_31 = 13 when AMPERSAND then alt_31 = 14 when SLASH then alt_31 = 15 when EQUALS then alt_31 = 16 when DASH then alt_31 = 17 when X_OCCI_ATTRIBUTE_KEY then alt_31 = 18 when X_OCCI_LOCATION_KEY then alt_31 = 19 when SCHEME, CLASS, TITLE, REL, LOCATION, ATTRIBUTES, ACTIONS, SELF, CATEGORY, KIND, MIXIN, ACTION, LINK, TERM then alt_31 = 20 end case alt_31 when 1 # at line 110:11: LOALPHA match( LOALPHA, TOKENS_FOLLOWING_LOALPHA_IN_uri_834 ) when 2 # at line 110:21: UPALPHA match( UPALPHA, TOKENS_FOLLOWING_UPALPHA_IN_uri_838 ) when 3 # at line 110:31: DIGIT match( DIGIT, TOKENS_FOLLOWING_DIGIT_IN_uri_842 ) when 4 # at line 110:39: AT match( AT, TOKENS_FOLLOWING_AT_IN_uri_846 ) when 5 # at line 110:44: COLON match( COLON, TOKENS_FOLLOWING_COLON_IN_uri_850 ) when 6 # at line 110:52: PERCENT match( PERCENT, TOKENS_FOLLOWING_PERCENT_IN_uri_854 ) when 7 # at line 110:62: UNDERSCORE match( UNDERSCORE, TOKENS_FOLLOWING_UNDERSCORE_IN_uri_858 ) when 8 # at line 110:75: BACKSLASH match( BACKSLASH, TOKENS_FOLLOWING_BACKSLASH_IN_uri_862 ) when 9 # at line 110:87: PLUS match( PLUS, TOKENS_FOLLOWING_PLUS_IN_uri_866 ) when 10 # at line 110:94: DOT match( DOT, TOKENS_FOLLOWING_DOT_IN_uri_870 ) when 11 # at line 110:100: TILDE match( TILDE, TOKENS_FOLLOWING_TILDE_IN_uri_874 ) when 12 # at line 110:108: HASH match( HASH, TOKENS_FOLLOWING_HASH_IN_uri_878 ) when 13 # at line 110:115: QUESTION match( QUESTION, TOKENS_FOLLOWING_QUESTION_IN_uri_882 ) when 14 # at line 110:126: AMPERSAND match( AMPERSAND, TOKENS_FOLLOWING_AMPERSAND_IN_uri_886 ) when 15 # at line 110:138: SLASH match( SLASH, TOKENS_FOLLOWING_SLASH_IN_uri_890 ) when 16 # at line 110:146: EQUALS match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_uri_894 ) when 17 # at line 110:155: DASH match( DASH, TOKENS_FOLLOWING_DASH_IN_uri_898 ) when 18 # at line 110:162: X_OCCI_ATTRIBUTE_KEY match( X_OCCI_ATTRIBUTE_KEY, TOKENS_FOLLOWING_X_OCCI_ATTRIBUTE_KEY_IN_uri_902 ) when 19 # at line 110:185: X_OCCI_LOCATION_KEY match( X_OCCI_LOCATION_KEY, TOKENS_FOLLOWING_X_OCCI_LOCATION_KEY_IN_uri_906 ) when 20 # at line 110:207: reserved_words @state.following.push( TOKENS_FOLLOWING_reserved_words_IN_uri_910 ) reserved_words @state.following.pop else match_count_31 > 0 and break eee = EarlyExit(31) raise eee end match_count_31 += 1 end # - - - - - - - rule clean up - - - - - - - - return_value.stop = @input.look( -1 ) rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 20 ) end return return_value end |
#x_occi_attribute ⇒ Object
parser rule x_occi_attribute
(in OCCIANTLR.g) 98:1: x_occi_attribute returns [hash] : X_OCCI_ATTRIBUTE_KEY COLON ( WS )? attribute ( SEMICOLON )? ;
1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1284 def x_occi_attribute # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 18 ) hash = nil attribute26 = nil begin # at line 99:4: X_OCCI_ATTRIBUTE_KEY COLON ( WS )? attribute ( SEMICOLON )? match( X_OCCI_ATTRIBUTE_KEY, TOKENS_FOLLOWING_X_OCCI_ATTRIBUTE_KEY_IN_x_occi_attribute_780 ) match( COLON, TOKENS_FOLLOWING_COLON_IN_x_occi_attribute_782 ) # at line 99:31: ( WS )? alt_27 = 2 look_27_0 = @input.peek( 1 ) if ( look_27_0 == WS ) alt_27 = 1 end case alt_27 when 1 # at line 99:31: WS match( WS, TOKENS_FOLLOWING_WS_IN_x_occi_attribute_784 ) end @state.following.push( TOKENS_FOLLOWING_attribute_IN_x_occi_attribute_787 ) attribute26 = attribute @state.following.pop # at line 99:45: ( SEMICOLON )? alt_28 = 2 look_28_0 = @input.peek( 1 ) if ( look_28_0 == SEMICOLON ) alt_28 = 1 end case alt_28 when 1 # at line 99:45: SEMICOLON match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_x_occi_attribute_789 ) end # --> action hash = attribute26 # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 18 ) end return hash end |
#x_occi_location ⇒ Object
parser rule x_occi_location
(in OCCIANTLR.g) 107:1: x_occi_location returns [location] : X_OCCI_LOCATION_KEY COLON ( WS )? uri ( SEMICOLON )? ;
1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 |
# File 'lib/occiantlr/OCCIANTLRParser.rb', line 1347 def x_occi_location # -> uncomment the next line to manually enable rule tracing # trace_in( __method__, 19 ) location = nil uri27 = nil begin # at line 108:4: X_OCCI_LOCATION_KEY COLON ( WS )? uri ( SEMICOLON )? match( X_OCCI_LOCATION_KEY, TOKENS_FOLLOWING_X_OCCI_LOCATION_KEY_IN_x_occi_location_809 ) match( COLON, TOKENS_FOLLOWING_COLON_IN_x_occi_location_811 ) # at line 108:30: ( WS )? alt_29 = 2 look_29_0 = @input.peek( 1 ) if ( look_29_0 == WS ) alt_29 = 1 end case alt_29 when 1 # at line 108:30: WS match( WS, TOKENS_FOLLOWING_WS_IN_x_occi_location_813 ) end @state.following.push( TOKENS_FOLLOWING_uri_IN_x_occi_location_816 ) uri27 = uri @state.following.pop # at line 108:38: ( SEMICOLON )? alt_30 = 2 look_30_0 = @input.peek( 1 ) if ( look_30_0 == SEMICOLON ) alt_30 = 1 end case alt_30 when 1 # at line 108:38: SEMICOLON match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_x_occi_location_818 ) end # --> action location = URI.parse(( uri27 && @input.to_s( uri27.start, uri27.stop ) )) # <-- action rescue ANTLR3::Error::RecognitionError => re report_error(re) recover(re) ensure # -> uncomment the next line to manually enable rule tracing # trace_out( __method__, 19 ) end return location end |