com.clarkparsia.sparqlowl.parser
Class ParserUtilities

java.lang.Object
  extended by com.clarkparsia.sparqlowl.parser.ParserUtilities

public class ParserUtilities
extends java.lang.Object

Title: Parser Utilities

Description: Static utility methods and fields used by the ANTLR generated parser sources. This code is in a separate Java file rather than in the ANTLR sources to make it easier to maintain with comfortable Java tools (e.g., Eclipse).

Copyright: Copyright (c) 2009

Company: Clark & Parsia, LLC.

Author:
Mike Smith msmith@clarkparsia.com

Constructor Summary
ParserUtilities()
           
 
Method Summary
static java.lang.String dropFirstAndLast(java.lang.String s)
          Trim first and last character from s.
static java.lang.String dropFirstAndLast3(java.lang.String s)
          Trim first and last character from s.
static java.lang.String sparqlUnescape(java.lang.String s)
          Reverse character escaping in a string literal consistent with SPARQL A.7, A.8[91]
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserUtilities

public ParserUtilities()
Method Detail

dropFirstAndLast

public static java.lang.String dropFirstAndLast(java.lang.String s)
Trim first and last character from s. Used when the parser matches STRING_LITERAL1 or STRING_LITERAL2 (SPARQL A.8[87]-[88])

Parameters:
s - The string to be trimmed
Returns:
The string without its first and last character

dropFirstAndLast3

public static java.lang.String dropFirstAndLast3(java.lang.String s)
Trim first and last character from s. Used when the parser matches STRING_LITERAL_LONG1 or STRING_LITERAL_LONG2 (SPARQL A.8[89]-[90])

Parameters:
s - The string to be trimmed
Returns:
The string without its first and last character

sparqlUnescape

public static java.lang.String sparqlUnescape(java.lang.String s)
Reverse character escaping in a string literal consistent with SPARQL A.7, A.8[91]



Copyright © 2004 Evren Sirin. All Rights Reserved.