forked from kframework/k-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
66 lines (49 loc) · 2.42 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
K tool, version 3.0
K is a framework for programming language design and executable semantics.
This distribution contains a tool prototype which implements many of K's
features. For more on the K framework and how to use the current tool,
go to k/tutorial (start with the README file there).
NOTE: This README file contains information regarding the stable release of
the K tool indicated in the title above, regardless of whether it came with
the release itself or with subsequent nightly/latest builds. This file is
updated only when new stable versions are officially released.
WARNING: The command line options for kompile, krun, kast and ktest have
recently (starting with version 'jenkins-k-framework-git-359') changed!
Type --help with any of these to see the new options. A list of changes is
here: https://github.com/kframework/k/wiki/Command-Line-Option-Changes.
What is new (from v2.7)
-----------------------
* The front-end is now implemented completely in Java (previously it was
implemented in a combination of Perl and Maude), making use of SDF (as
distributed with the Spoofax system).
Because the parser has changed, the syntax of K definitions has changed, too:
1. Modules and files:
require "filename.k" // require the contents of another file found in the
// current directory, or the 'include' directory.
module MODULE-NAME
imports INCLUDED-MODULE
endmodule // in one word
2. Use priorities instead of precedence:
| Exp "*" Exp
> Exp "+" Exp
3. Binary mixfix operators can be disambiguated with associativity attributes:
syntax Exp ::= Exp "*" Exp [left]
> left:
Exp "+" Exp [left]
| Exp "-" Exp [left]
> non-assoc:
Exp "=" Exp [right]
4. You can use bracket productions to override priorities:
| "(" Exp ")" [bracket]
5. The scope of a variable in k3 is restricted to each rule. In k2 it was the
module. As a result, the sort of each variable should be specified in each
rule in which it is used. If not specified, it is automatically assumed K.
6. The only accepted comments are // ... for one line comments and /* ... */
for multiline ones. Latex comments remain the same:
//@ ...
/*@ ... */
//! ...
/*! ... */
Developers
----------
See src/README