Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compiler Tools JavaCC > Token: line and...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 531 of 540
Post > Topic >>

Token: line and column indexes: 1 based ?

by Cesare Zecca <Cesare.Zecca.prof@[EMAIL PROTECTED] > Apr 24, 2008 at 05:29 AM

Hi all
I gave a look to the official doc  
https://javacc.dev.java.net/doc/apiroutines.html
and elsewhere in the web.
I did not find any mention about the base of the line and column
indexes i.e. the

int beginLine, beginColumn, endLine, endColumn

data members of the Token class. Are they either 0 (zero) or 1 based?

The comment in the class

  /**
   * beginLine and beginColumn describe the position of the first
character
   * of this token; endLine and endColumn describe the position of the
   * last character of this token.
   */

does not mention the base for the indexes, too.
Sperimentally I noted that a token on the first line of the input is
re****ted with beginLine that holds value 1.
So I guess that those indexes are 1-based.
Is it right?
If so, a couple of words more in the doc to tell that indexes are 1-
based would not be bad.

ciao
Cesare
 




 1 Posts in Topic:
Token: line and column indexes: 1 based ?
Cesare Zecca <Cesare.Z  2008-04-24 05:29:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 19:03:13 CDT 2008.