blob: a15676dd1bfb01a674d04624071dd9f40c7a8976 [file] [log] [blame]
import java_cup.runtime.*;
import javax.swing.*;
import java.util.*;
import java.io.*;
/*
OUTPUT FORMAT:____________________________________________________________
1NSERCH= 0
more text
SCF Done: E(RHF) = -7.85284496695 A.U. after 8 cycles
more text
Maximum Force 0.000000 0.000450 YES
RMS Force 0.000000 0.000300 YES
more text
TO MONITOR:____________________________________________________________
iteration, energy
MANUALLY ADD TO CUP-GENERATED CLASS IN SCFaParser.java:________________
//add to CUP$SCFaParser$actions
public ParseSCF2 parseSCF;
//add to the constructor of CUP$SCFaParser$actions
parseSCF = new ParseSCF2();
*/
action code {:
//__________________________________
public static boolean DEBUG = true;
private static JTable table;
private static final String tableLabel = "SCF Intermediate Results:";
// private static String cycle = "0";
public static JTable getTable() {
return table;
}
public static String getTableLabel() {
return tableLabel;
}
// }
:}
terminal FOUNDITER, SCFDONE, NSearch, Energ, MaxGrad, RmsGrad;
terminal Integer ITERATION;
terminal Float ENERGY, MGRAD, RGRAD;
non terminal startpt, scfintro, scfpat, scfcycle, cycle, grad1, grad2;
/* ___________
The grammer */
startpt ::= scfintro
scfpat
SCFDONE
{: if (DEBUG) System.out.println("CUP:gopt: end of parse tree ");
table = new JTable();
// table = parseSCF.getTable();
:}
;
scfintro ::=
FOUNDITER
{: if (DEBUG) System.out.println("CUP:gopt: found the start of Iteration"); :}
;
scfpat ::= scfpat scfcycle
{: if (DEBUG) System.out.println("CUP:gopt: in scfpat"); :}
|
scfcycle
;
scfcycle ::= Energ ENERGY:e
{: //___________________________________________________________________
if (DEBUG) System.out.println("CUP:gopt: ENERGY "+e);
:}
cycle
;
cycle ::= NSearch ITERATION:c
{: //___________________________________________________________________
if (DEBUG) System.out.println("CUP:gopt: ITERATION "+c);
:}
grad1
grad2
;
grad1 ::= MaxGrad MGRAD:mg
{: //___________________________________________________________________
if (DEBUG) System.out.println("CUP:gopt: Maximum Force "+mg);
:}
;
grad2 ::= RmsGrad RGRAD:rg
{: //___________________________________________________________________
if (DEBUG) System.out.println("CUP:gopt: RMS Force "+rg);
:}
;