what does this mean 'Parsing a text file or data stream' and does it apply with serializables

Lukeg101 picture Lukeg101 · Dec 18, 2012 · Viewed 17.1k times · Source

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

Answer

Jim Garrison picture Jim Garrison · Dec 18, 2012

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.