The proposal would be to use (LEO) Expression within the GRAPHREP and represent the result of these expressions. A brief example can be seen below, applying the String token functions (see the definition
here) and control logic in GRAPHREP
Assuming the STRING in t1 looks somewhat like this:
"A
AND B
OR C
AND D
XOR F
OR G
AND K..."
you can write the following within the GRAPHREP to retrieve the number of ANDs
1SET t1:"A AND B OR C AND D XOR F OR G AND K"
2SET andCount:0
3FOR word in: (t1) {
4 IF (word = "AND") {
5 SET andCount: (andCount+1)
6 }
7}
8TEXT (STR andCount) x:-1.5cm y:0.01cm w:c h:c
A similar logic can be applied for OR, XORs by extending the IF condition within the loop and adding to the counter.