Package nexj.core.scripting

Examples of nexj.core.scripting.Symbol


    *    dispatch characteristics (e.g. name and argument count),
    *    false to throw an exception instead.
    */
   public void addMethod(MethodObject method, boolean bReplace)
   {
      Symbol symbol = method.getSymbol();
      int nOrdinal = findMethodOrdinal(symbol, method.getMinArgCount());

      if ((nOrdinal >= 0) ? !bReplace :
         method.getMinArgCount() <= 1 && findAttributeOrdinal(symbol) >= 0)
      {
         throw new DeclarationException("err.scripting.methodDup",
            new Object[]{symbol.getName(),
               Primitive.createInteger(method.getArgCount()),
               getName()});
      }

      if (method.getHolder() != null && method.getHolder() != this)
      {
         throw new DeclarationException("err.scripting.methodReuse",
            new Object[]{symbol.getName(),
               Primitive.createInteger(method.getArgCount()),
               method.getHolder().getName(),
               getName()});
      }

View Full Code Here


         int nDirectCount = 0;

         for (int i = 0; i < nCount; ++i)
         {
            AttributeObject attribute = base.m_attributeArray[i];
            Symbol symbol = attribute.getSymbol();

            Object old = m_offsetMap.put(symbol, Primitive.createInteger(m_offsetMap.size()));

            if (old == null)
            {
View Full Code Here

      classObject.addMethod(":add-method", 4, false, new Function()
      {
         public boolean invoke(int nArgCount, Machine machine)
         {
            ClassObject classObject = (ClassObject)machine.getArg(0, nArgCount);
            Symbol symbol = (Symbol)machine.getArg(1, nArgCount);

            MethodObject methodObject = classObject.createMethod(symbol,
               (PCodeFunction)classObject.compile(machine.getArg(3, nArgCount),
                  symbol.getName(), null, machine));

            machine.invoke(methodObject, ADD_OPTIONS_SYMBOL,
               new Pair(machine.getArg(2, nArgCount)));

            classObject.addMethod(
View Full Code Here

      if (classObject.isForward())
      {
         classObject.setForward(false);
         classObject.getMetaclass().addBase(this);

         Symbol baseSymbol = getObjectBaseClassSymbol();

         if (baseSymbol != null)
         {
            classObject.addBase(env.findClass(baseSymbol));
         }
View Full Code Here

      if (expr instanceof Pair)
      {
         Pair adep = dep;
         Pair pair = (Pair)expr;
         Object obj = pair.getHead();
         Symbol sym = null;
         boolean bGlobal = false;

         // Extract the function name for simple function calls
         if (obj instanceof Symbol)
         {
View Full Code Here

TOP

Related Classes of nexj.core.scripting.Symbol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.