Logo Search packages:      
Sourcecode: jasmin-sable version File versions  Download package

String java_cup::production::declare_labels ( production_part  rhs[],
int  rhs_len,
String  final_action 
) [inline, protected]

Declare label names as valid variables within the action string

Parameters:
rhs array of RHS parts.
rhs_len how much of rhs to consider valid.
final_action the final action string of the production.
lhs_type the object type associated with the LHS symbol.

Definition at line 415 of file production.java.

References java_cup::production_part::label(), make_declaration(), java_cup::symbol::stack_type(), and java_cup::symbol_part::the_symbol().

Referenced by production(), and remove_embedded_actions().

    {
      String declaration = "";

      symbol_part part;
      action_part act_part;
      int         pos;

      /* walk down the parts and extract the labels */
      for (pos = 0; pos < rhs_len; pos++)
      {
        if (!rhs[pos].is_action())
          {
            part = (symbol_part)rhs[pos];

            /* if it has a label, make declaration! */
            if (part.label() != null)
            {
              declaration = declaration + 
                make_declaration(part.label(), part.the_symbol().stack_type(), 
                             rhs_len-pos-1);
            }
          }
      }
      return declaration;
    }


Generated by  Doxygen 1.6.0   Back to index