Package org.eclipse.jst.jsp.core.internal.java.jspel

Examples of org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression


    final java.io.StringReader reader = new java.io.StringReader(elText);
        final JSPELParser  parser = new JSPELParser(reader);
       
        try
        {
            final ASTExpression expr = parser.Expression();
            final PrefixVisitor visitor = new PrefixVisitor(relativePosition, elText);
            expr.jjtAccept(visitor, null);
            return visitor;
        }
        catch (ParseException pe)
        {
            // TODO: handle parser by using current and expected tokens
View Full Code Here


    final java.io.StringReader reader = new java.io.StringReader(elText);
        final JSPELParser  parser = new JSPELParser(reader);
       
        try
        {
            final ASTExpression expr = parser.Expression();
            final PrefixVisitor visitor = new PrefixVisitor(relativePosition, elText);
            expr.jjtAccept(visitor, null);
            return visitor;
        }
        catch (ParseException pe)
        {
            // TODO: handle parser by using current and expected tokens
View Full Code Here

            final char nextChar = (char) nextCharacter;

            if (nextChar == '\n')
            {
                final JSPELParser parser = JSPELParser.createParser(elText);
                final ASTExpression expr = parser.Expression();
                expr.dump(""); //$NON-NLS-1$

                elText = ""; //$NON-NLS-1$
            }
            else
            {
View Full Code Here

    {
        JSPELParser elParser = JSPELParser.createParser(_elText);
        // =
        try {
            //final long startParsing = System.currentTimeMillis();
            final ASTExpression expr =  elParser.Expression();
            //final long endParsing = System.currentTimeMillis();
            //final long startSemantics = System.currentTimeMillis();
            validateSemantics(expr, _context);
            //final long endSemantics = System.currentTimeMillis();

            //System.out.println("Time to parse '"+elText+"' = "+(endParsing-startParsing));
            //System.out.println("Time to semantic checking '"+elText+"' = "+(endSemantics-startSemantics));
           
            // if the parser bailed before parsing the whole
            // expression, raise a warning that there is probably
            // some syntatical issue
            if (expr.getLastToken().endColumn < _elText.trim().length()-1)
            {
                final int offset = _context.getDocumentPosition() + expr.getLastToken().endColumn;
                final int length = _elText.trim().length() - expr.getLastToken().endColumn;
                final Diagnostic diagnostic =
                    _diagnosticFactory.create_GENERAL_SYNTAX_ERROR();
               
                _reporter.report(diagnostic, offset, length);
            }
View Full Code Here

  protected ASTFunctionInvocation getInvocation(int relativePosition, String elText) {
    FindFunctionInvocationVisitor visitor = new FindFunctionInvocationVisitor(relativePosition);
    JSPELParser parser = JSPELParser.createParser(elText);
    try {
      ASTExpression expression = parser.Expression();
      return (ASTFunctionInvocation) expression.jjtAccept(visitor, null);
    }
    catch (ParseException e) { /* parse exception = no completion */
    }
    return (null);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.