5

This is my second post and I am getting used to the function of things on here now! this is more of a theory question for computer science but, my question is what does this mean?

'Parsing a text file or data stream'

This is an assignment and the books and web sources I have consulted are old or vague. I have implemented a serializable interface on a SinglyLinkedList which saves/loads the file to/from the disk so it can be transferred/edited and accessed later on. Does this qualify for a sufficient achievement of the rather vague requirement?

things to note when considering this question:

  • this requirement is one of many for a project I am doing
  • the Singly Linked List I am using is custom made - I know, the premade Java one is better, but I must show my skills
  • all the methods work - I have tested them - its just a matter of documentation
  • I am using ObjectOutputStream, FileOutputStream, ObjectInputStream and FileInputStream and the respective methods to read/write the Singly linked list object

I would appreciate the feedback

Lukeg101
  • 141
  • 1
  • 2
  • 7
  • I would say that it qualifies, but shouldn't you ask your teacher about what s/he meant? Maybe you are required to do it at a lower level. – SJuan76 Dec 17 '12 at 23:51
  • Parsing would suggest reading in data and processing it to another form...not necessarily converting per say, as it may suggest simply cherry picking parts of the incoming data. – MadProgrammer Dec 17 '12 at 23:52

1 Answers1

6

The process of "parsing" can be described as reading in a data stream of some sort and building an in-memory model or representation of the semantic content of that data, in order to facilitate performing some kind of transformation on the data.

Some examples:

  1. A compiler parses your source code to (usually) build an abstract syntax tree of the code, with the objective of generating object- (or byte-) code for execution by a machine.
  2. An interpreter does the same thing but the syntax tree is then directly used to control execution (some interpreters are a mashup of byte-code generators and virtual machines and may generate intermediate byte-code).
  3. A CSV parser reads a stream structured according to the rules of CSV (commas, quoting, etc) to extract the data items represented by each line in the file.
  4. A JSON or XML parser does a similar operation for JSON- or XML-encoded data, building an in-memory representation of the semantic values of the data items and their hierarchical inter-relationships.
Jim Garrison
  • 81,234
  • 19
  • 144
  • 183