[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
snmpconf some language issues
There has been some language issues discussion among a few people
that needs to be forwarded to the list. Here it is.
- Steve
---
Steve,
A quick read of the comments suggests that we should post to the main
list. I do not agree with all the proposed changes, but they indicate at
least one engineers questions on reading the current draft. If ray has a
question, then others might. Even if we choose not to include goto (and
for now I would probably come down on the side of not including int), we
can answer the question.
I do not see any show stoppers here though.
/jon
>
> Ray is working his way through the language in building a compiler,
> and the following issues have come up in the -05 draft in the
> repository.
>
> - Steve
>
>
> ------- Forwarded Message
>
> From: Ray Byler <ray@snmp.com>
> Message-Id: <200103162037.PAA20909@mudlark.snmp.com>
> To: moulton@snmp.com
>
> The policy language document doesn't define what
> "break" and "continue" do. Are
> their actions the same as in C i.e. break causes
> the innermost enclosing loop to be exited immediately.
>
> If this is the case then you might want to consider
> adding goto to the jump statements (and a label to go
> with it). This would allow you to jump out of all
> enclosing loops to a label for some sort of special
> handling.
>
> ========================================================
>
> Also the language as written allows us to do things we
> probably don't want to do with string_literals and
> char_constants. For example,
>
> string_literal --> primary_expression -->
> postfix_expression --> unary_expression
>
> char_constant --> primary_expression -->
> postfix_expression --> unary_expression
>
> allows us to write things like:
>
> "abc" = 99;
> 'c' = 4;
>
> Many C language definitions allow this too,
> leaving it to C type-checking to catch. Is each
> developer on his own to figure out what is allowed
> for LHV and RHV?
>
> ========================================================
>
> Since all variables are in the same scope, I'm assuming
> that once declared, variables stay around and are not
> discarded on leaving a block.
>
> Having all variables in a single scope and allowing them to
> be declared anywhere presents a problem.
>
> var a = 5;
>
> var a;
>
> Does the value of a remain 5, or is it reinitialized? The
> simplest solution, of course, is simply not to allow it
> i.e. redefinition of a variable should be a semantic error.
>
> ========================================================
>
> Do we want to allow variables to have the same names as
> library functions e.g. "var writeVar = 5;" ?
> It greatly simplifies things if we don't allow this.
>
> ========================================================
>
> If the use of a reserved word such as "auto" must cause
> a RTE, then the lexer has to be expanded to check for all
> these reserved words. That greatly expands the size of
> the lexer in a limited-memory environment. It would be
> better to make this a recommendation and not a requirement.
>
> ========================================================
>
>
> ------- End of Forwarded Message
>
>
>
>
Thanks,
/jon
--
Jon Saperia saperia@jdscons.com
Phone: 617-744-1079
Fax: 617-249-0874
http://www.jdscons.com/
------- End of Forwarded Message