Questions tagged [grammar]
The grammar tag has no summary.
64 questions
3 votes
2 answers
747 views
Why don't modern programming languages enforce whitespace around identifiers?
I recently fell in love with Factor , a programming language in the Forth family that enforces use of whitespace around identifiers, this allows creation of "functions" with extremely terse ...
-1 votes
1 answer
188 views
Is it a good idea to let keywords have different lexical rules from names of types, variables, functions, etc? [closed]
For example, keywords have a special prefix. Objective-C has @interface, @implementation, but that's for compatibility with C. It inherits all the C keywords of course, with no @. How about a language ...
-1 votes
2 answers
96 views
Methods to model mutations performed by functions
Given a set of interfaces, objects implementing those interfaces, and functions that use those objects, what methods exist to model mutations performed by the functions? For example, given: A Pet ...
0 votes
4 answers
287 views
Language design : use equals symbol = both for affectation and comparison, like in MySQL
I'm currently designing a database query language and I came to wonder what should be the best syntax for the comparison operator. Most modern languages use ==, but amongst the database languages ...
-5 votes
1 answer
867 views
LL(K) grammer generation for postfix expressions [closed]
I have a problem in formulating LL(K) grammar for this postfix expression problem, given (4 3 / 2 * 4 5 / +) as an input must output 52/12
3 votes
2 answers
554 views
How to say the statement "List<string>" correctly?
When reading code, how do you say the following statement? (It was taken from some C# code, could be many languages, though). List<string> Do you say: List of type string? or List of string ...
0 votes
2 answers
445 views
Do any programming languages let you use other languages without restriction within them?
This may be a stupid question, and it would certainly take one Hell of a lexer, but do any extant programming languages allow you to do something like: c# (1.2) { // c# code } Perl (5) { # ...
0 votes
1 answer
602 views
Grammar by example
Is there an automated approach to generate a grammar (which could be used later in a compiler tool such as ANTLR or similar) from given examples of a language? With more detail: assumed a technical ...