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 definite integral
8 *
9 * @author © 2000 DIRAT Laurent
10 * @version 1.0 23/02/2000
11 */
12 public class DefiniteIntegral extends Function {
13 /***
14 * The constructor.
15 */
16 public DefiniteIntegral() {
17 super("defint");
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 linearParserEvent.setToken(opening, param);
29 fireLinearParserEvent(linearParserEvent);
30
31
32 AbstractMathTreeObject interval = (AbstractMathTreeObject) getChild(0);
33 AbstractMathTreeObject lambda = (AbstractMathTreeObject) getChild(1);
34
35
36 int nbChildren = lambda.getNbChildren();
37 int count = nbChildren - 1;
38 flushChild(lambda.getChild(count), count);
39 linearParserEvent.setToken(token, null);
40 fireLinearParserEvent(linearParserEvent);
41
42
43 flushChild(lambda.getChild(0), 0);
44 linearParserEvent.setToken(token, null);
45 fireLinearParserEvent(linearParserEvent);
46
47
48 flushChild(interval.getChild(0), 0);
49 linearParserEvent.setToken(token, null);
50 fireLinearParserEvent(linearParserEvent);
51 flushChild(interval.getChild(1), 1);
52
53
54 linearParserEvent.setToken(closing, null);
55 fireLinearParserEvent(linearParserEvent);
56 }
57 }