In computer science, the syntax of a programming language is the set of rules that define the combinations of symbols that are considered to be correctly structured programs in that language.

learn more… | top users | synonyms

1
vote
2answers
34 views

What do you think about this custom syntax? [closed]

I'm making a programming language and I've got the basis of a virtual machine working. The next step to is design the actual syntax for the language. I'd just like to know if whether the example ...
0
votes
1answer
64 views

What are the drawbacks of DRY input validation configuration?

I have designed the following input validation implementation with one goal: DRY. I'd like to know whether it is intuitive and what are the possible shortcomings. ...
9
votes
2answers
417 views

C-style language lexer for a syntax highlighter

I'm working on implementing a syntax highlighter for a simple text editor I've been working on. To do this, I need a simple lexer for various languages (I don't need a full one - I'm only interested ...
1
vote
2answers
112 views

Python array literal syntax sugar similar to Perl and Ruby

Background Python (version 2.7.2) Problem You want to specify an array in your code. You want to use the 'syntax sugar' available in Ruby and Perl. You are a fanatic about readable code but also ...
1
vote
1answer
70 views

Manage Case Statement with (Int, long, short, double…)

I have the following case statements that has to be modified to fit these cases: Dec, Double, ...
1
vote
1answer
107 views

Color fading function

I found this old color fading function in my snippets folder and would like to implement it to one of my projects. It can be used to fade one color to another. It's a very long one-liner: ...
7
votes
1answer
536 views

A C++ PEG parser generator

I wrote a C++ PEG packrat parser generator and would love to get some feedback on the code and/or syntax. I currently use the << operator for defining grammar ...
6
votes
1answer
195 views

Improve my little syntactic hack

Current best practice for using a lock_guard looks like this: ...
1
vote
2answers
234 views

My language, gecho [closed]

I wrote a language in C, dubbed gecho. The code can be found at http://github.com/tekknolagi/gecho/tree/testing I'm writing this for a purely educational reason ...
6
votes
6answers
316 views

Explicit Function Notation in Perl

I've gone back and forth a few times recently on my Perl coding style when it comes to module subroutines. If you have an object and you want to call the method bar ...