John McCall
6b935588e5
On second thought, components need to be known in the AST.
...
Swift SVN r918
2011-12-07 03:57:41 +00:00
Chris Lattner
212b56afec
actually, the ASTStage should be on Translation unit. There can be multiple modules in a context and they can all be in different phases of translation.
...
Swift SVN r902
2011-12-06 00:51:56 +00:00
Chris Lattner
eaa6fcb12a
move prototype for the verifier into Subsystems.
...
Swift SVN r901
2011-12-06 00:34:16 +00:00
Chris Lattner
02c9d9a3f1
Make the AST "phase" part of ASTContext, this is generally useful for assertions.
...
Swift SVN r900
2011-12-06 00:32:00 +00:00
Doug Gregor
fc183b9cc3
Decouple the lexer from the ASTContext and specific BufferID. They
...
aren't needed for the lexer proper (which just needs a buffer to dig
through). Also, make it possible to suppress lexer diagnostics merely
by not giving it a diagnostic engine to work with.
Swift SVN r852
2011-11-09 21:49:40 +00:00
Doug Gregor
d0dd4d44bc
Surface the Token and Lexer headers as public headers, since we're
...
going to need to be able to use the lexer from the 'swift' tool itself.
Swift SVN r851
2011-11-09 21:09:49 +00:00
Chris Lattner
9e783adda1
introduce and use a new parseMatchingToken method.
...
Swift SVN r841
2011-11-09 01:09:07 +00:00
Chris Lattner
f02dc055d3
introduce a form of parseToken that returns the location of the parsed token
...
on success, allowing simplifications in clients.
Swift SVN r840
2011-11-09 00:56:52 +00:00
Chris Lattner
c872bb4782
improve error recovery in {}'s by using less hacky recovery.
...
Swift SVN r836
2011-11-08 21:09:28 +00:00
Chris Lattner
b5c6fa8e21
split error recovery behavior out of parseDecl, making it more
...
conventional and allowing more appropriate recovery in various
caller's contexts.
Swift SVN r835
2011-11-08 21:05:10 +00:00
Chris Lattner
af0d4a6cdf
use Diagnostic class to simplify parseIdentifier.
...
Swift SVN r785
2011-10-22 06:04:56 +00:00
Chris Lattner
9298082ebb
move Diagnostics header to include/swift/AST to match .cpp files.
...
Swift SVN r782
2011-10-22 00:47:35 +00:00
Chris Lattner
dfd529ce3a
rename diags::foo to diag::foo
...
Swift SVN r779
2011-10-22 00:36:19 +00:00
Chris Lattner
a1781fed38
switch expr parsing to the new diagnostics subsystem
...
Swift SVN r766
2011-10-20 20:41:48 +00:00
Chris Lattner
d8343e9a42
convert parseToken to new diagnostic api
...
Swift SVN r763
2011-10-20 20:09:04 +00:00
Chris Lattner
96f732b6a2
convert parseType to take a DiagID.
...
Swift SVN r762
2011-10-20 19:53:00 +00:00
Chris Lattner
fcc547d000
switch parseIdentifier and all its uses to the new diagnostics machinery.
...
Swift SVN r759
2011-10-19 00:57:50 +00:00
Chris Lattner
a7c7d64fa0
Switch swift to use SourceLoc instead of SMLoc.
...
Also use the new getAdvancedLoc() method instead of hacking
on SMLoc directly.
Also fix the warning/note/error methods to forward through ASTContext
instead of being replicated everywhere.
Swift SVN r750
2011-10-18 01:22:29 +00:00
Chris Lattner
2d43b8812f
update for mainline API changes.
...
Swift SVN r745
2011-10-16 06:17:27 +00:00
Doug Gregor
3d15bf3d55
Introduce a diagnostic-formatting engine and port most of the parser's
...
diagnostics over to it.
There are a few differences between this diagnostic engine and Clang's
engine:
- Diagnostics are specified by a .def file (Diagnostics.def), rather
than via tblgen, which drastically simplifies the build and makes
code completion work when you add a new diagnostic.
- Calls to the "diagnose()" method are safely typed based on the
argument types specified in the .def file, so it's harder to write a
diagnostic whose expected arguments (in the string) and whose actual
arguments (in the code) don't match.
- It uses variadic templates, so it hangs with the cool kids.
Swift SVN r734
2011-09-26 23:46:28 +00:00
John McCall
b6f312aea0
Verification should clearly follow each phase rather than coming
...
at the start of the next phase.
Swift SVN r731
2011-09-24 09:32:18 +00:00
John McCall
54ff2ccf4a
Lop the last word off ModuleDecl and TranslationUnitDecl.
...
Swift SVN r693
2011-09-06 21:43:46 +00:00
Chris Lattner
b04c19e647
introduce a enw AST/AST.h umbrella header and use it to
...
simplify #includes.
Swift SVN r578
2011-08-22 21:02:44 +00:00
Chris Lattner
88964126fe
remove the old SemaDecl and Sema classes.
...
Swift SVN r563
2011-08-14 00:33:00 +00:00
Chris Lattner
cb18028c45
rework all of the scope and name lookup logic, introducing a new ScopeInfo class
...
and moving a bunch more stuff out of SemaDecl.
Swift SVN r561
2011-08-14 00:27:24 +00:00
Chris Lattner
75033678d0
split decl parsing logic out to ParseDecl.cpp
...
Swift SVN r558
2011-08-13 22:56:16 +00:00
Chris Lattner
26f66a8b24
move all the parser headers into lib/Parse since they are now all private.
...
I chose to just delete the -lex action in swift, since it was only useful for
about 10 minutes during bringup and probably never will be again.
Swift SVN r557
2011-08-13 22:51:04 +00:00
Chris Lattner
92051fd98e
add a new Subsystems.h file to hold the entrypoints for various subsystems,
...
instead of smashing them into Parser.h, resolving some FIXME's.
Swift SVN r556
2011-08-13 22:43:17 +00:00
Chris Lattner
73a3f9d888
fix clients to not poke the Parser class directly.
...
Swift SVN r555
2011-08-13 22:38:20 +00:00
Chris Lattner
c863bea58d
merge SemaExpr into ParseExpr.cpp
...
Swift SVN r554
2011-08-13 22:33:33 +00:00
Chris Lattner
047ecf3b27
split expr parsing out to its own file.
...
Swift SVN r553
2011-08-13 22:17:50 +00:00
Chris Lattner
f6ff397ab7
zap some more S.Context's now that Parser has its own context member.
...
Swift SVN r551
2011-08-13 22:14:40 +00:00
Chris Lattner
dab303a541
move statement parsing out to its own file.
...
Swift SVN r550
2011-08-13 22:13:33 +00:00
Chris Lattner
e5c5dab2df
give parser its own ASTContext member instead of having to indirect through Sema.
...
Swift SVN r549
2011-08-13 22:09:49 +00:00
Chris Lattner
c86d4a5853
Split parsing for types out to its own ParseType.cpp file, and
...
merge SemaType into it.
Swift SVN r547
2011-08-13 22:06:33 +00:00
Chris Lattner
6009504ae6
split ParseResult out to its own file.
...
Swift SVN r545
2011-08-13 21:35:37 +00:00
Chris Lattner
5d9e2e4a8d
now that the Sema code is in the parse library, the Sema headers are all private, make it so.
...
Swift SVN r544
2011-08-13 21:15:17 +00:00
Chris Lattner
33f774f9b7
Rearrange a bunch of code for better layering: instead of Parser depending on Sema,
...
just move the Sema code into the Parser library. There is no way to use one without
the other. The library formerly known as Sema will get renamed.
Swift SVN r542
2011-08-13 21:06:10 +00:00
Chris Lattner
b40d2ce29e
fix naming convention violations.
...
Swift SVN r536
2011-08-12 22:52:33 +00:00
Chris Lattner
b8fd157450
rip out the dead "isPrecededByIdentifier" logic from the AST and Lexer.
...
Swift SVN r529
2011-08-12 21:36:25 +00:00
John McCall
ddd134854e
Rename ApplyExpr to CallExpr and change the signature of SemaCallExpr.
...
Swift SVN r523
2011-08-12 17:31:14 +00:00
Chris Lattner
3ce8ca094e
don't promote a sema error to a parse error.
...
Swift SVN r518
2011-08-12 06:13:49 +00:00
Chris Lattner
096c203901
oneof element names can't be operators.
...
Swift SVN r517
2011-08-12 06:02:06 +00:00
John McCall
9f2ca5e4cc
Remove juxtaposition handling from the type-checker and put it
...
in the parser. Implement the grammar which permits this.
Enforce that binary operators have to, well, operators.
Swift SVN r515
2011-08-12 05:49:30 +00:00
Chris Lattner
10f5c2fc66
remove the UnresolvedType, representing it with a null Type() instead. There is no need to
...
have two different ways to represent the same thing. This has the pleasant bonus that stuff
crashes when you do things with unresolved types.
Swift SVN r513
2011-08-12 05:19:52 +00:00
John McCall
4eb22011b6
Make the lexer just determine whether an LP is spaced or not; the
...
parser can consume this as appropriate. For now it isn't, but that
will change.
Swift SVN r509
2011-08-12 02:12:48 +00:00
Chris Lattner
36f5427de3
Make the lexer disambiguate between a ( that is the start of an expression and a ( that is the start of
...
a call argument list.
Swift SVN r508
2011-08-12 01:46:39 +00:00
Chris Lattner
abe344bef2
switch statements to use ParseResult, enhance ParseResult to map ParseResult<BraceStmt>
...
convertible to ParseResult<Stmt>.
Swift SVN r505
2011-08-12 00:16:41 +00:00
Chris Lattner
7a5e383c0b
some localized cleanups for diagnostics.
...
Swift SVN r504
2011-08-11 23:38:30 +00:00
Chris Lattner
0e8a66ec9d
Introduce a new ParseResult<T> helper class, which is effectively
...
oneof { T*, Absent, ParseError, SemaError }.
This replaces the former convention used by the expression parsing
logic that used NullablePtr + bool to indicate all of these states,
in a way that I could never keep straight.
This should lead to better error recovery, but needs to be adopted by
more parts of the parser. Sema still uses NullablePtr because it
either returns a valid AST node or has a semantic error, there is no
parse error possible in Sema.
Swift SVN r503
2011-08-11 23:35:27 +00:00