### ----------------------------------------------------
### -- Marpa
### -- Licenses: Artistic-2.0
### -- Authors: 
### -- File: lib/Marpa.rakumod
### ----------------------------------------------------
### -- Chunk 4 of 4
pa_g_zwa_new
         ( g $g, Int $default_value )
         returns Marpa-Assertion-ID
         is native( LIB ) { * }
  method g-zwa-new
         ( g $g, Int $default-value )
         returns Marpa-Assertion-ID {
           marpa_g_zwa_new( $g, $default-value ) }
  my sub marpa_g_zwa_place
         ( g $g, Marpa-Assertion-ID $zwaid, Marpa-Rule-ID $xrl_id, Int $rhs_ix )
         returns Int
         is native( LIB ) { * }
  method g-zwa-place
         ( g $g, Marpa-Assertion-ID $zwaid, Marpa-Rule-ID $xrl-id, Int $rhs-ix )
         returns Int {
            marpa_g_zwa_place( $g, $zwaid, $xrl-id, $rhs-ix ) }
  my sub marpa_r_zwa_default
         ( Marpa-Recognizer $r, Marpa-Assertion-ID $zwaid )
         returns Int
         is native( LIB ) { * }
  method r-zwa-default
         ( Marpa-Recognizer $r, Marpa-Assertion-ID $zwaid )
         returns Int {
           marpa_r_zwa_default( $r, $zwaid ) }

  #|{ Changes default value to default_value. On success, returns previous default value of the assertion. 
    }
  my sub marpa_r_zwa_default_set
         ( Marpa-Recognizer $r, Marpa-Assertion-ID $zwaid, Int $default_value )
         returns Int
         is native( LIB ) { * }
  method r-zwa-default-set
         ( Marpa-Recognizer $r, Marpa-Assertion-ID $zwaid, Int $default-value )
         returns Int {
           marpa_r_zwa_default_set( $r, $zwaid, $default-value ) }

  my sub marpa_g_highest_zwa_id
         ( g $g )
         returns Marpa-Assertion-ID
         is native( LIB ) { * }
  method g-highest-zwa-id
         ( g $g )
         returns Marpa-Assertion-ID {
           marpa_g_highest_zwa_id( $g ) }

  my sub marpa_r_clean
         ( Marpa-Recognizer $r )
         returns Marpa-Earleme
         is native( LIB ) { * }
  method r-clean
         ( Marpa-Recognizer $r )
         returns Marpa-Earleme {
           marpa_r_clean( $r ) }

  #|{ These methods, respectively, set and query the “valued status” of a symbol. Once set to a value with the marpa_g_symbol_is_valued_set() method, the valued status of a symbol is “locked” at that value. It cannot thereafter be changed. Subsequent calls to marpa_g_symbol_is_valued_set() for the same sym_id will fail, leaving sym_id's valued status unchanged, unless value is the same as the locked-in value.

      Success value: 1 if the symbol symbol_id is valued after the call, 0 if not. If the valued status is locked and value is different from the current status, −2. If value is not 0 or 1; or on other failure, −2. 
      Failure value: −2. 
    }
  my sub marpa_g_symbol_is_valued_set
         ( g $g, Marpa-Symbol-ID $symbol_id, Int $value )
         returns Int
         is native( LIB ) { * }
  method g-symbol-is-valued-set
         ( g $g, Marpa-Symbol-ID $symbol-id, Int $value )
         returns Int {
           marpa_g_symbol_is_valued_set( $g, $symbol-id, $value ) }
  my sub marpa_g_symbol_is_valued
         ( g $g, Marpa-Symbol-ID $symbol_id )
         returns Int
         is native( LIB ) { * }
  method g-symbol-is-valued
         ( g $g, Marpa-Symbol-ID $symbol-id )
         returns Int {
           marpa_g_symbol_is_valued( $g, $symbol-id ) }

  #|{ These methods, respectively, set and query the valued status of symbol sym_id. marpa_v_symbol_is_valued_set() will set the valued status to the value of its status argument. A valued status of 1 indicates that the symbol is valued. A valued status of 0 indicates that the symbol is unvalued. If the valued status is locked, an attempt to change to a status different from the current one will fail (error code MARPA-ERR-VALUED-IS-LOCKED).

      Success value: The valued status after the call. If value is not either 0 or 1, or on other failure, −2. 
      Failure value: −2. 
    }
  my sub marpa_v_symbol_is_valued_set
         ( Marpa-Value $v, Marpa-Symbol-ID $sym_id, Int $status )
         returns Int
         is native( LIB ) { * }
  method v-symbol-is-valued-set
         ( Marpa-Value $v, Marpa-Symbol-ID $sym-id, Int $status )
         returns Int {
           marpa_v_symbol_is_valued_set( $v, $sym-id, $status ) }
  my sub marpa_v_symbol_is_valued
         ( Marpa-Value $v, Marpa-Symbol-ID $sym_id )
         returns Int
         is native( LIB ) { * }
  method v-symbol-is-valued
         ( Marpa-Value $v, Marpa-Symbol-ID $sym-id )
         returns Int {
           marpa_v_symbol_is_valued( $v, $sym-id ) }

  #|{ These methods, respectively, set and query the valued status for the LHS symbol of rule rule_id. marpa_v_rule_is_valued_set() sets the valued status to the value of its status argument.

      A valued status of 1 indicates that the symbol is valued. A valued status of 0 indicates that the symbol is unvalued. If the valued status is locked, an attempt to change to a status different from the current one will fail (error code MARPA-ERR-VALUED-IS-LOCKED).

      Rules have no valued status of their own. The valued status of a rule is always that of its LHS symbol. These methods are conveniences — they save the application the trouble of looking up the rule's LHS.

      Success value: The valued status of the rule rule_id's LHS symbol after the call. If value is not either 0 or 1, or on other failure, −2. 
      Failure value: −2. 
    }
  my sub marpa_v_rule_is_valued_set
         ( Marpa-Value $v, Marpa-Rule-ID $rule_id, Int $status )
         returns Int
         is native( LIB ) { * }
  method v-rule-is-valued-set
         ( Marpa-Value $v, Marpa-Rule-ID $rule-id, Int $status )
         returns Int {
           marpa_v_rule_is_valued_set( $v, $rule-id, $status ) }
  my sub marpa_v_rule_is_valued
         ( Marpa-Value $v, Marpa-Rule-ID $rule_id )
         returns Int
         is native( LIB ) { * }
  method v-rule-is-valued
         ( Marpa-Value $v, Marpa-Rule-ID $rule-id )
         returns Int {
           marpa_v_rule_is_valued( $v, $rule-id ) }

  #|{ This methods locks the valued status of all symbols to 1, indicated that the symbol is valued. If this is not possible, for example because one of the grammar's symbols already is locked at a valued status of 0, failure is returned.

      Success value: A non-negative number.
      Failure value: −2, and sets the error code to an appropriate value, which will never be MARPA-ERR-NONE. 
    }
  my sub marpa_v_valued_force
         ( Marpa-Value $v )
         returns Int
         is native( LIB ) { * }
  method v-valued-force
         ( Marpa-Value $v )
         returns Int {
           marpa_v_valued_force( $v ) }
}

# vim: expandtab shiftwidth=4


