Exemple #1
0
 public final java_cup.runtime.Symbol do_action(
     int CUP$parser$act_num,
     java_cup.runtime.lr_parser CUP$parser$parser,
     java.util.Stack CUP$parser$stack,
     int CUP$parser$top,
     parser parser)
     throws java.lang.Exception {
   java_cup.runtime.Symbol CUP$parser$result;
   // c_declaration_specifiers_notp_tn_nosc_rg ::= c_declaration_specifiers_notp_tn_nosc_rg
   // c_storage_class_specifier_rg
   {
     DeclarationSpecifierList RESULT = null;
     DeclarationSpecifierList d =
         (DeclarationSpecifierList)
             ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)).value;
     StorageClass e = (StorageClass) ((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
     RESULT = d.add(e);
     CUP$parser$result =
         parser
             .getSymbolFactory()
             .newSymbol(
                 "c_declaration_specifiers_notp_tn_nosc_rg",
                 74,
                 ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top - 1)),
                 ((java_cup.runtime.Symbol) CUP$parser$stack.peek()),
                 RESULT);
   }
   return CUP$parser$result;
 }
  @Override
  public void check(
      AnalyzeStack stack, DeclarationSpecifierList specifiers, InitDeclarator declaration) {
    if (specifiers == null) return;

    Type type = specifiers.resolveType();
    if (type != null) type = declaration.resolveType(type, stack);

    if (type != null || type.asFunctionType() != null) {
      // a forward declaration of an event or command function
      specifiers.checkModifiers(
          stack,
          new int[] {Modifiers.COMMAND | Modifiers.EVENT | Modifiers.TYPEDEF},
          Modifiers.ALL_TYPE_QUALIFIER | Modifiers.INLINE | Modifiers.ASYNC,
          Modifiers.TASK
              | Modifiers.DEFAULT
              | Modifiers.NORACE
              | Modifiers.AUTO
              | Modifiers.REGISTER,
          null,
          new FunctionMessanger(true, declaration.resolveName()));
    }
  }