ps9base - import mit16_410_13.*; import...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import mit16_410_13.*; import java.util.LinkedList; import java.io.*; class PS9base { public PS9base () { ; } // reads the HMM description as XML invoking addTransition as necessary. public void readHMM (String pathname) throws java.io.FileNotFoundException { XMLStream strm; FileInputStream istrm=null; boolean inhmm=false, instate=false, intransition=false; String state=null; try { istrm=new FileInputStream(pathname); strm=new XMLStream(istrm, System.out); System.out.println("Reading from "+pathname); String txt=strm.readText(); // Read any preceding text for (XMLTag atag=strm.readNextTag(); atag!=null; atag=strm.readNextTag()) { String tagid=atag.getTagID(); if (tagid.equals("HMM")) { if (inhmm) System.out.println("Nested HMM not allowed\n"); inhmm=true; } else if (tagid.equals("/HMM")) { if (instate||intransition||(!inhmm)) System.out.println("/HMM nesting error"); inhmm=false; } else if (tagid.equals("STATE")) { if (instate) System.out.println("Nested states not allowed\n"); else if (intransition||(!inhmm)) System.out.println("STATE
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/07/2011 for the course AERO 16.410 taught by Professor Brianwilliams during the Fall '05 term at MIT.

Page1 / 2

ps9base - import mit16_410_13.*; import...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online