Google Groups Home
Help | Sign in
Token: line and column indexes: 1 based ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Cesare Zecca  
View profile
 More options Apr 24, 8:29 am
Newsgroups: comp.compilers.tools.javacc
From: Cesare Zecca <Cesare.Zecca.p...@gmail.com>
Date: Thu, 24 Apr 2008 05:29:15 -0700 (PDT)
Local: Thurs, Apr 24 2008 8:29 am
Subject: Token: line and column indexes: 1 based ?
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
reported 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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google