View Javadoc

1   package fr.ove.openmath.jome.ctrl.amto;
2   
3   import fr.ove.openmath.jome.ctrl.linear.events.LinearParserEvent;
4   import fr.ove.openmath.jome.ctrl.amto.Function;
5   
6   /***
7   * The abstract math tree object of the limit operator.
8   *
9   * @author © 2000 DIRAT Laurent
10  * @version 1.0  25/02/2000
11  */
12  public class Limit extends Function {
13      /***
14      * The constructor.
15      */
16      public Limit() {
17          super("limit");
18      }
19      
20      /***
21      * "Flushes" the object as a sequence of events for the building of the model
22      */
23      public void flush() {
24          LinearParserEvent linearParserEvent = new LinearParserEvent(getEventSource());
25          // Le format est la borne, suivit du tye de la limite, suivie de la lambda expression
26          // Le type dÈtermine le paramËtre ? envoyer avec l'opening
27          
28          // The opening
29          linearParserEvent.setToken(opening, (String) ((AbstractMathTreeObject) getChild(1)).getParameter());
30          fireLinearParserEvent(linearParserEvent);
31          
32          // On envoie l'objet de la lambda expression, i.e. ce qu'on fait tendre vers la borne
33          AbstractMathTreeObject lambda = (AbstractMathTreeObject) getChild(2);
34          int index = lambda.getNbChildren() - 1;
35          flushChild(lambda.getChild(index), index);
36          
37          // Un sÈparateur
38          linearParserEvent.setToken(token, null);
39          fireLinearParserEvent(linearParserEvent);
40          
41          // La viariable liÈe, i.e. la variable que l'on fait tendre vers la borne
42          flushChild(lambda.getChild(0), 0);
43                  
44          // Un sÈparateur
45          linearParserEvent.setToken(token, null);
46          fireLinearParserEvent(linearParserEvent);
47          
48          // La borne
49          flushChild(getChild(0), 0);
50  
51          // The closing
52          linearParserEvent.setToken(closing, null);
53          fireLinearParserEvent(linearParserEvent);
54      }
55  }