FAQ Database Discussion Community

What is the difference between Lexical grammar and Syntactic grammar?

I am reading The Java Language Specification 8. I am trying to understand Chapter 2. Grammars. Here's what I have already learned: Semantics: Semantics is the study of meaning. Meaning: Meaning, in semantics, is defined as being Extension: The thing in the world that the word/phrase refers to, plus Intention:...

Why is a defined token not recognized during syntax analysis in C using Bison?

I'm currently working on a simple infix-to-postfix compiler for a given grammar. I'm currently at the stage of syntax analysis. I have already written a lexical analyzer, using Flex library, however I'm stuck on a seemingly simple problem. The information below might seem like a lot to process, but I...

One all-encompassing definition of JavaScript closure

I have read 10s of SO references on closures, MDN references and other blog articles. They all seem to define closures in their own ways. For example, From MDN documentation: function makeFunc() { var name = "Mozilla"; function displayName() { alert(name); } return displayName; } var myFunc = makeFunc(); myFunc();...