ConstantSortExpression.java

// FILE. . . . . /home/hak/hlt/src/hlt/osfv3/base/ConstantSortExpression.java
// EDIT BY . . . Hassan Ait-Kaci
// ON MACHINE. . Hak-Laptop
// STARTED ON. . Mon Sep 09 09:15:40 2013



This is the class of built-in atomic sort symbols carrying a constant value.

Copyright:  © by the author
Author:  Hassan Aït-Kaci
Version:  Last modified on Fri Apr 03 14:10:52 2015 by hak



package hlt.osf.base;

import hlt.osf.exec.Context;



This is the class of constants of built-in sorts.


public class ConstantSortExpression extends SortExpression
  {
    

Constructs a symbol sort expression with the given name.


    public ConstantSortExpression (Constant constant)
    {
      _constant = constant;
    }

    private Constant _constant;

    public Constant constant ()
    {
      return _constant;
    }

    public Sort sort ()
    {
      return _constant.sort();
    }

    public byte type ()
    {
      return _context.CON();
    }

    // public String displayForm ()
    // {
    //   return sort()+"("+_constant.displayForm()+")";
    // }    

    public String displayForm ()
    {
      return _constant.displayForm();
    }    

    public String toString ()
    {
      return _constant.toString();
    }

    public boolean equals (Object other)
    {
      if (!(other instanceof ConstantSortExpression))
	return false;

      ConstantSortExpression c = (ConstantSortExpression)other;

      return type() == c.type() && _constant.equals(c.constant());
    }
  }


This file was generated on Mon Sep 09 09:17:59 PDT 2019 from file ConstantSortExpression.java
by the hlt.language.tools.Hilite Java tool written by Hassan Aït-Kaci