Skip to content

Esprima

Sameeri Pavan Kumar Marryboyina edited this page May 5, 2017 · 3 revisions

Saibaba Vinayakaya Namaha! Saraswati devi

This morning, I wrote a program.

A pretty simple one in fact.

All it does is take in 2 arguments(parameters) and add them up.

And it returns the result.

function sum(a,b){
  return a + b;
}

Why did i write such a simple program?

Well, i was thinking of code and how we can represent code as data.

Can we think of code as data?

And why should we think of code as data?

These thoughts led me to meditate a little.

What is Source code?

Code or Source code is just text.

You have a problem.

You have a language.

You use the language constructs that the language has provided you with to solve the problem.

You express the solution for the problem in a simple text file.

Anyone who understands the language can look at your program, read it and may be understand it.

If someone who does not understand the problem, the context or the language and look at the contents of the file, they are probably not going to understand whats happening.

Also your work is just an implementation of a solution for the problem.

This can be changed by you in the future or someone else.

For you, it is a program.

For someone else, it is text.

For the Operating system it is just a file. A text file.

It all depends on what perspective you are looking at.

Syntax

Syntax Analysis

Syntax Tree

Syntax Tree Specification

Clone this wiki locally