Forgive me if I have the incorrect terminology; perhaps just getting the "right" words to describe what I want is enough for me to find the answer on my own.

I am working on a parser for ODL (Object Description Language), an arcane language that as far as I can tell is now used only by NASA PDS (Planetary Data Systems; it's how NASA makes its data available to the public). Fortunately, PDS is finally moving to XML, but I still have to write software for a mission that fell just before the cutoff.

ODL defines objects in something like the following manner:

```
OBJECT              = TABLE
  ROWS              = 128
  ROW_BYTES         = 512 
END_OBJECT          = TABLE

```

I am attempting to write a parser with `pyparsing`, and I was doing fine right up until I came to the above construction.

I have to create some rule that is able to ensure that the right-hand-value of the OBJECT line is identical to the RHV of END\_OBJECT. But I can't seem to put that into a `pyparsing` rule. I can ensure that both are syntactically valid values, but I can't go the extra step and ensure that the values are identical.

1. Am I correct in my intuition that this is a context-sensitive grammar? Is that the phrase I should be using to describe this problem?
2. Whatever kind of grammar this is in the theoretical sense, is `pyparsing` able to handle this kind of construction?
3. If `pyparsing` is not able to handle it, is there another Python tool capable of doing so? How about `ply` (the Python implementation of `lex`/`yacc`)?