Пример #1
0
  /** Parses the arguments of the command, producing a new command instance */
  public static /*@Nullable*/ C_declare_const parse(Parser p) throws ParserException {
    /*@Nullable*/ ISymbol symbol = p.parseSymbol();
    if (symbol == null) return null;

    /*@Nullable*/ ISort result = p.parseSort(null);
    if (result == null) return null;
    String v = symbol.value();
    if (v.length() > 0 && (v.charAt(0) == '@' || v.charAt(0) == '.')) {
      error(p.smt(), "User-defined symbols may not begin with . or @", symbol.pos());
      return null;
    }
    return new C_declare_const(symbol, result);
  }