Skip to content
Snippets Groups Projects
Select Git revision
  • 50a7915eaf644760e26eceea7fc250f325988606
  • master default
  • labcomm2014
  • labcomm2006
  • python_sig_hash
  • typedefs
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.6
  • v2015.0
  • v2014.5
  • v2014.4
  • v2006.0
  • v2014.3
  • v2014.2
  • v2014.1
  • v2014.0
  • v2013.0
21 results

Java_CodeGen.jrag

Blame
  • ErrorCheck.jrag 722 B
    import java.util.Collection;
    
    aspect ErrorCheck {
    
        syn int ASTNode.lineNumber() = getLine(getStart());
    
        protected String ASTNode.errors = null;
    
        protected void ASTNode.error(String s) {
            s = "Error at " + lineNumber() + ": " + s;
            if(errors == null) {
              errors = s;
            } else {
              errors = errors + "\n" + s;
            }
        }
    
        protected boolean ASTNode.hasErrors() {
            return errors != null;
        }
        public void ASTNode.errorCheck(Collection collection) {
            nameCheck();
            typeCheck();
            if(hasErrors())
            collection.add(errors);
            for(int i = 0; i < getNumChild(); i++) {
            getChild(i).errorCheck(collection);
            }
        }
    }