Esempio n. 1
0
 public Expression parseAsExpression(String string) {
   File fileAst = getFileAst(getPartString(string));
   if (fileAst == null) {
     return null;
   }
   final Assignment[] result = new Assignment[1];
   fileAst.accept(
       new AbstractASTVisitor() {
         public boolean visit(Assignment assignment) {
           result[0] = assignment;
           return false;
         }
       });
   if (result[0] == null) {
     return null;
   }
   return result[0].getRightHandSide();
 }
Esempio n. 2
0
 public PageDataModel create(File file, EGLEditor editor) {
   PageDataModel model = new PageDataModel();
   List<Part> parts = file.getParts();
   for (Part part : parts) {
     if (part instanceof Handler) {
       fillPageDataModel(editor, model);
     }
   }
   return model;
 }