Package java_cup.runtime

Examples of java_cup.runtime.Symbol


       type as the type Symbol. */
    if (info instanceof Symbol) {
      /* Declare a Symbol object 's' with the
         information in the object info that is being typecasted
         as a Symbol object. */
      Symbol s = ((Symbol) info);
  
      /* Check if the line number in the input is greater or
         equal to zero. */
      if (s.left >= 0) {               
        /* Add to the end of the StringBuffer error message
View Full Code Here


       type as the type Symbol. */
    if (info instanceof Symbol) {
      /* Declare a Symbol object 's' with the
         information in the object info that is being typecasted
         as a Symbol object. */
      Symbol s = ((Symbol) info);
  
      /* Check if the line number in the input is greater or
         equal to zero. */
      if (s.left >= 0) {               
        /* Add to the end of the StringBuffer error message
View Full Code Here

    private Symbol makeSymbol(int id, Object o) {
        int iPrevPrevChar = iPrevChar;
        this.iPrevChar = iChar;
        this.previousSymbol = id;
        return new Symbol(id, iPrevPrevChar, iChar, o);
    }
View Full Code Here

    private static String getExt(String fileName) throws Exception {
        String extension = "html";
        File f = new File(fileName);
        Lexer lex = new Lexer(new FileReader(f));
        boolean foundDoc = false;
        Symbol s;
        while (!foundDoc && (s = lex.next_token()).sym != sym.EOF){
      Token t = (Token)(s.value);
            switch (t.getID()){
                case sym.WHITESPACE:{
                } break;
View Full Code Here

  public void setFile(File file) {
    this.file = file;
  }

  private Symbol symbol(int type, Object value) {
    return new Symbol(type, yyline, yycolumn, value);
  }
View Full Code Here

  private Symbol symbol(int type, Object value) {
    return new Symbol(type, yyline, yycolumn, value);
  }

  private Symbol symbol(int type) {
    return new Symbol(type, yyline, yycolumn);
  }
View Full Code Here

     for (int i=0; i < text.length(); i++) {
      char c = text.charAt(i);

      if (c != '\n' && c != '\r' && c != ' ' && c != '\t' )
        return new Symbol(type, lc, cc, value);

      if (c == '\n') {
        lc++;
        cc = 0;
      }
      else
        cc++;
    }
  
    return new Symbol(type, yyline, yycolumn, value);
  }
View Full Code Here

  int line = 0;
  if (_locator != null) line = _locator.getLineNumber();

  try {
      _xpathParser.setScanner(new XPathLexer(new StringReader(text)));
      Symbol result = _xpathParser.parse(expression, line);
      if (result != null) {
    final SyntaxTreeNode node = (SyntaxTreeNode)result.value;
    if (node != null) {
        node.setParser(this);
        node.setParent(parent);
View Full Code Here

           String expression) {
  int line = getLineNumber();

  try {
      _xpathParser.setScanner(new XPathLexer(new StringReader(text)));
      Symbol result = _xpathParser.parse(expression, line);
      if (result != null) {
    final SyntaxTreeNode node = (SyntaxTreeNode)result.value;
    if (node != null) {
        node.setParser(this);
        node.setParent(parent);
View Full Code Here

                index++;
            }
            // If end of buffer, can't disambiguate :(
            if (index >= yy_buffer_read) {
                // Can't disambiguate, so return as symbol
                return new Symbol(ss);
            }
            // Return symbol if next token is '::' or '('
            return (yy_buffer[index] == ':' && yy_buffer[index+1] == ':' ||
                    yy_buffer[index] == '(') ?
                    newSymbol(ss) : newSymbol(sym.QNAME, yytext());
View Full Code Here

TOP

Related Classes of java_cup.runtime.Symbol

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.