예제 #1
0
  /**
   * Class constructor.
   *
   * @param returns the number of values to return
   */
  public StrCpyInstruction(int returns) {
    if (PageExInfo.in())
      throw new NslContextException(
          EnumSet.of(NslContext.Section, NslContext.Function, NslContext.Global), name);
    if (returns != 1) throw new NslReturnValueException(name, 1);

    ArrayList<Expression> paramsList = Expression.matchList();
    int paramsCount = paramsList.size();
    if (paramsCount < 1 || paramsCount > 3) throw new NslArgumentException(name, 1, 3);

    this.string = paramsList.get(0);

    if (paramsCount > 1) {
      this.maxLen = paramsList.get(1);

      if (paramsCount > 2) {
        this.startOffset = paramsList.get(2);
      } else {
        this.startOffset = null;
      }
    } else {
      this.maxLen = null;
      this.startOffset = null;
    }
  }
  /**
   * Class constructor.
   *
   * @param returns the number of values to return
   */
  public GetErrorLevelInstruction(int returns) {
    if (!SectionInfo.in() && !FunctionInfo.in())
      throw new NslContextException(EnumSet.of(NslContext.Section, NslContext.Function), name);
    if (returns != 1) throw new NslReturnValueException(name, 1);

    ArrayList<Expression> paramsList = Expression.matchList();
    if (!paramsList.isEmpty()) throw new NslArgumentException(name, 0);
  }
  /**
   * Class constructor.
   *
   * @param returns the number of values to return
   */
  public FlushINIInstruction(int returns) {
    if (!SectionInfo.in() && !FunctionInfo.in())
      throw new NslContextException(EnumSet.of(NslContext.Section, NslContext.Function), name);
    if (returns > 0) throw new NslReturnValueException(name);

    ArrayList<Expression> paramsList = Expression.matchList();
    if (paramsList.size() != 1) throw new NslArgumentException(name, 1);

    this.iniFile = paramsList.get(0);
  }
  /**
   * Class constructor.
   *
   * @param returns the number of values to return
   */
  public LockWindowInstruction(int returns) {
    if (!SectionInfo.in() && !FunctionInfo.in())
      throw new NslContextException(EnumSet.of(NslContext.Section, NslContext.Function), name);
    if (returns > 0) throw new NslReturnValueException(name);

    ArrayList<Expression> paramsList = Expression.matchList();
    if (paramsList.size() != 1) throw new NslArgumentException(name, 1);

    this.value = paramsList.get(0);
    if (!ExpressionType.isString(this.value))
      throw new NslArgumentException(name, 1, ExpressionType.String);
  }
  /**
   * Class constructor.
   *
   * @param returns the number of values to return
   */
  public CreateFontInstruction(int returns) {
    if (PageExInfo.in())
      throw new NslContextException(
          EnumSet.of(NslContext.Section, NslContext.Function, NslContext.Global), name);
    if (returns != 1) throw new NslReturnValueException(name);

    ArrayList<Expression> paramsList = Expression.matchList();
    int paramsCount = paramsList.size();
    if (paramsCount < 1 || paramsCount > 6) throw new NslArgumentException(name, 1, 6);

    this.fontFace = paramsList.get(0);
    if (!ExpressionType.isString(this.fontFace))
      throw new NslArgumentException(name, 1, ExpressionType.String);

    if (paramsCount > 1) {
      this.height = paramsList.get(1);
      if (!ExpressionType.isInteger(this.height))
        throw new NslArgumentException(name, 2, ExpressionType.Integer);

      if (paramsCount > 2) {
        this.weight = paramsList.get(2);
        if (!ExpressionType.isInteger(this.weight))
          throw new NslArgumentException(name, 3, ExpressionType.Integer);

        if (paramsCount > 3) {
          this.italic = paramsList.get(3);
          if (!ExpressionType.isBoolean(this.italic))
            throw new NslArgumentException(name, 4, ExpressionType.Boolean);

          if (paramsCount > 4) {
            this.underline = paramsList.get(4);
            if (!ExpressionType.isBoolean(this.underline))
              throw new NslArgumentException(name, 5, ExpressionType.Boolean);

            if (paramsCount > 5) {
              this.strike = paramsList.get(5);
              if (!ExpressionType.isBoolean(this.strike))
                throw new NslArgumentException(name, 6, ExpressionType.Boolean);
            } else {
              this.strike = null;
            }
          } else {
            this.underline = null;
            this.strike = null;
          }
        } else {
          this.italic = null;
          this.underline = null;
          this.strike = null;
        }
      } else {
        this.weight = null;
        this.italic = null;
        this.underline = null;
        this.strike = null;
      }
    } else {
      this.height = null;
      this.weight = null;
      this.italic = null;
      this.underline = null;
      this.strike = null;
    }
  }