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
26
27
28
29 linearParserEvent.setToken(opening, (String) ((AbstractMathTreeObject) getChild(1)).getParameter());
30 fireLinearParserEvent(linearParserEvent);
31
32
33 AbstractMathTreeObject lambda = (AbstractMathTreeObject) getChild(2);
34 int index = lambda.getNbChildren() - 1;
35 flushChild(lambda.getChild(index), index);
36
37
38 linearParserEvent.setToken(token, null);
39 fireLinearParserEvent(linearParserEvent);
40
41
42 flushChild(lambda.getChild(0), 0);
43
44
45 linearParserEvent.setToken(token, null);
46 fireLinearParserEvent(linearParserEvent);
47
48
49 flushChild(getChild(0), 0);
50
51
52 linearParserEvent.setToken(closing, null);
53 fireLinearParserEvent(linearParserEvent);
54 }
55 }