Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
63ed2b71
Commit
63ed2b71
authored
Oct 24, 2008
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- missing file
R=r OCL=17813 CL=17813
parent
ad863046
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
compilation.go
usr/gri/pretty/compilation.go
+46
-0
No files found.
usr/gri/pretty/compilation.go
0 → 100644
View file @
63ed2b71
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
Compilation
import
Scanner
"scanner"
import
Parser
"parser"
import
AST
"ast"
export
type
Flags
struct
{
verbose
bool
;
sixg
bool
;
deps
bool
;
columns
bool
;
testmode
bool
;
tokenchan
bool
;
}
type
Compilation
struct
{
prog
*
AST
.
Program
;
nerrors
int
;
}
export
func
Compile
(
src_file
,
src
string
,
flags
*
Flags
)
*
Compilation
{
var
scanner
Scanner
.
Scanner
;
scanner
.
Open
(
src_file
,
src
,
flags
.
columns
,
flags
.
testmode
);
var
tstream
*<-
chan
*
Scanner
.
Token
;
if
flags
.
tokenchan
{
tstream
=
scanner
.
TokenStream
();
}
var
parser
Parser
.
Parser
;
parser
.
Open
(
flags
.
verbose
,
flags
.
sixg
,
&
scanner
,
tstream
);
C
:=
new
(
Compilation
);
C
.
prog
=
parser
.
ParseProgram
();
C
.
nerrors
=
scanner
.
nerrors
;
return
C
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment