Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 847
Lukeg101 Avatar asked Dec 17 '12 23:12

Lukeg101


People also ask

What does parsing a text file mean?

Parse essentially means to ''resolve (a sentence) into its component parts and describe their syntactic roles''. In computing, parsing is 'an act of parsing a string or a text'. [Google Dictionary]File parsing in computer language means to give a meaning to the characters of a text file as per the formal grammar.

What does it mean to parse a file in Python?

In this article, parsing is defined as the processing of a piece of python program and converting these codes into machine language. In general, we can say parse is a command for dividing the given program code into a small piece of code for analyzing the correct syntax.

What is parse used for?

To parse is to break up a sentence or group of words into separate components, including the definition of each part's function or form. The technical definition implies the same concept. Parsing is used in all high-level programming languages.

What is parsing input data?

Data parsing is the process of taking data in one format and transforming it to another format. You'll find parsers used everywhere. They are commonly used in compilers when we need to parse computer code and generate machine code. This happens all the time when developers write code that gets run on hardware.


1 Answers

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.
like image 166
Jim Garrison Avatar answered Oct 23 '22 11:10

Jim Garrison