Commit cb0aa7df authored by gourne_o's avatar gourne_o
Browse files

from Olivier Gournet <gourne_o@lrde.epita.fr>

	* src/disamb/sslext/ScopedFiniteMap.str: New file.
	* src/disamb/specifier/Makefile.am: Add path in include.
	* src/disamb/specifier/afcxx-specifier.str,
	* src/disamb/namespace/afcxx-namespace.str,
	* src/disamb/disambiguate/afcxx-disambiguate.str: 
	Save and reload symbol tables.
	* src/disamb/disambiguate/ClassDefinition.str,
	* src/disamb/disambiguate/BaseTraverse.str,
	* src/disamb/disambiguate/NamespaceDefinition.str,
	* src/disamb/disambiguate/LocalOrGlobal.str,
	* src/disamb/disambiguate/EnumDefinition.str,
	* src/disamb/disambiguate/ClassTraverse.str,
	* src/disamb/disambiguate/VariableDeclarator.str,
	* src/disamb/disambiguate/TemplateClassDefinition.str,
	* src/disamb/disambiguate/TypeDeclarator.str,
	* src/disamb/disambiguate/TemplateFunctionDefinition.str,
	* src/disamb/disambiguate/Lookup.str,
	* src/disamb/disambiguate/TemplateTraverse.str,
	* src/disamb/disambiguate/GetKey.str,
	* src/disamb/disambiguate/NamespaceTraverse.str,
	* src/disamb/disambiguate/TemplateClassTraverse.str,
	* src/disamb/disambiguate/TemplateFunctionTraverse.str,
	* src/disamb/disambiguate/ClassOrNamespaceTraverse.str,
	* src/disamb/disambiguate/TemplateDefinition.str: Use map wrapper strategies.
	* src/parser/ParsePPDirective.str,
	* src/parser/parse-cxx.str: Rewrite with context dump and less temporary files.

2004-05-14  Olivier Gournet  <gourne_o@lrde.epita.fr>
parent 3947519c
2004-05-14 Olivier Gournet <gourne_o@lrde.epita.fr>
* src/disamb/sslext/ScopedFiniteMap.str: New file.
* src/disamb/specifier/Makefile.am: Add path in include.
* src/disamb/specifier/afcxx-specifier.str,
* src/disamb/namespace/afcxx-namespace.str,
* src/disamb/disambiguate/afcxx-disambiguate.str:
Save and reload symbol tables.
* src/disamb/disambiguate/ClassDefinition.str,
* src/disamb/disambiguate/BaseTraverse.str,
* src/disamb/disambiguate/NamespaceDefinition.str,
* src/disamb/disambiguate/LocalOrGlobal.str,
* src/disamb/disambiguate/EnumDefinition.str,
* src/disamb/disambiguate/ClassTraverse.str,
* src/disamb/disambiguate/VariableDeclarator.str,
* src/disamb/disambiguate/TemplateClassDefinition.str,
* src/disamb/disambiguate/TypeDeclarator.str,
* src/disamb/disambiguate/TemplateFunctionDefinition.str,
* src/disamb/disambiguate/Lookup.str,
* src/disamb/disambiguate/TemplateTraverse.str,
* src/disamb/disambiguate/GetKey.str,
* src/disamb/disambiguate/NamespaceTraverse.str,
* src/disamb/disambiguate/TemplateClassTraverse.str,
* src/disamb/disambiguate/TemplateFunctionTraverse.str,
* src/disamb/disambiguate/ClassOrNamespaceTraverse.str,
* src/disamb/disambiguate/TemplateDefinition.str: Use map wrapper strategies.
* src/parser/ParsePPDirective.str,
* src/parser/parse-cxx.str: Rewrite with context dump and less temporary files.
2004-05-14 Olivier Gournet <gourne_o@lrde.epita.fr> 2004-05-14 Olivier Gournet <gourne_o@lrde.epita.fr>
* src/syn/ThrowExpressions.sdf, * src/syn/ThrowExpressions.sdf,
......
...@@ -83,7 +83,7 @@ rules ...@@ -83,7 +83,7 @@ rules
; < conc; ?x; !list-key (x) > (base', [string-key (ID')]) => inherit ; < conc; ?x; !list-key (x) > (base', [string-key (ID')]) => inherit
; < rewrite (!local) <+ (!Nil) > "$inherit" => inherits ; < rewrite (!local) <+ (!Nil) > "$inherit" => inherits
; < conc > (inherits, [inherit]) => inherits' ; < conc > (inherits, [inherit]) => inherits'
; < assert (!local) > ("$inherit", inherits') ; < my-assert (!local) > ("$inherit", inherits')
strategies strategies
......
...@@ -41,14 +41,14 @@ rules ...@@ -41,14 +41,14 @@ rules
ClassDefinition : a@|ClassSpecifier[ ClassKey la1 ID la2 BaseClause-opt la3 { la4 MemberSpecification-opt la5 } ]| -> |ClassSpecifier[ ClassKey la1 ID la2 BaseClause-opt la3 { la4 MemberSpecification-opt' la5 } ]| ClassDefinition : a@|ClassSpecifier[ ClassKey la1 ID la2 BaseClause-opt la3 { la4 MemberSpecification-opt la5 } ]| -> |ClassSpecifier[ ClassKey la1 ID la2 BaseClause-opt la3 { la4 MemberSpecification-opt' la5 } ]|
where < identifier > ID => c // Read identifier (name of C). where < identifier > ID => c // Read identifier (name of C).
; < rewrite (!"$namespace") > "$value" => d // Get current namespace name. ; < rewrite (!"$namespace") > "$value" => d // Get current namespace name.
; < assert (!d) > (c, class-kind) // In N, mark C as being a class. ; < my-assert (!d) > (c, class-kind) // In N, mark C as being a class.
; < ?list-key (as); !as > d => d' // Extract the list of nested namespace names. ; < ?list-key (as); !as > d => d' // Extract the list of nested namespace names.
; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e // Append the new namespace name to the current list. ; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e // Append the new namespace name to the current list.
; < print-key > e => e' // Print the current list (this is for debugging only). ; < print-key > e => e' // Print the current list (this is for debugging only).
; < concat-strings; ifdebug (debug) > ["+ Definition of class", " ", e'] ; < concat-strings; ifdebug (debug) > ["+ Definition of class", " ", e']
; < init-name-space (!e) > a // Initialize symbol table for N. ; < my-init-name-space (!e) > a // Initialize symbol table for N.
; < begin-scope (!"$namespace") > a // Save old current namespace name. ; < begin-scope (!"$namespace") > a // Save old current namespace name.
; < assert (!"$namespace") > ("$value", e) // Set new current namespace name. ; < my-assert (!"$namespace") > ("$value", e) // Set new current namespace name.
; < definition > MemberSpecification-opt => MemberSpecification-opt' // Process the class definition body. ; < definition > MemberSpecification-opt => MemberSpecification-opt' // Process the class definition body.
; < end-scope (!"$namespace") > a // Restore old current namespace name. ; < end-scope (!"$namespace") > a // Restore old current namespace name.
; < concat-strings; ifdebug (debug) > ["- Definition of class", " ", e'] ; < concat-strings; ifdebug (debug) > ["- Definition of class", " ", e']
...@@ -63,7 +63,7 @@ rules ...@@ -63,7 +63,7 @@ rules
> NestedNameSpecifier-opt > NestedNameSpecifier-opt
; < identifier > ID => c ; < identifier > ID => c
; < rewrite (!"$namespace") > "$value" => d ; < rewrite (!"$namespace") > "$value" => d
; < assert (!d) > (c, class-kind) ; < my-assert (!d) > (c, class-kind)
; < ?list-key (as); !as > d => d' ; < ?list-key (as); !as > d => d'
; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e ; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e
; < print-key > e => e' ; < print-key > e => e'
......
...@@ -42,7 +42,7 @@ rules ...@@ -42,7 +42,7 @@ rules
; try(get-alias) ; try(get-alias)
; list-key(at-last([string-key(?name)]; ![])) => path ; list-key(at-last([string-key(?name)]; ![])) => path
; scope(!"$namespace", ; scope(!"$namespace",
< assert (!"$namespace") > < my-assert (!"$namespace") >
("$value", path) ("$value", path)
; <lookup> name ; <lookup> name
; (namespace-kind <+ alias-kind) ; (namespace-kind <+ alias-kind)
...@@ -50,7 +50,7 @@ rules ...@@ -50,7 +50,7 @@ rules
; list-key(<concat> [<id>, [string-key(name)]]) => e) ; list-key(<concat> [<id>, [string-key(name)]]) => e)
; print-key ; print-key
; < concat-strings ; ifdebug (debug) > ["Following nested name resolution to namespace", " ", <id>] ; < concat-strings ; ifdebug (debug) > ["Following nested name resolution to namespace", " ", <id>]
; < assert (!"$namespace") > ("$value", e) ; < my-assert (!"$namespace") > ("$value", e)
ClassOrNamespaceTraverse-1 : a@|ClassOrNamespaceName[ ClassOrNamespaceTraverse-1 : a@|ClassOrNamespaceName[
~ClassName: |ClassName[ ID ]|~ ]| -> a ~ClassName: |ClassName[ ID ]|~ ]| -> a
...@@ -61,7 +61,7 @@ rules ...@@ -61,7 +61,7 @@ rules
; try(get-alias) => e ; try(get-alias) => e
; list-key(at-last([string-key(?name)]; ![])) => path ; list-key(at-last([string-key(?name)]; ![])) => path
; scope(!"$namespace", ; scope(!"$namespace",
< assert (!"$namespace") > < my-assert (!"$namespace") >
("$value", path) ("$value", path)
; <lookup> name ; <lookup> name
; class-kind ; class-kind
...@@ -69,7 +69,7 @@ rules ...@@ -69,7 +69,7 @@ rules
; list-key(<concat> [<id>, [string-key(name)]]) => e) ; list-key(<concat> [<id>, [string-key(name)]]) => e)
; print-key ; print-key
; < concat-strings ; ifdebug (debug) > ["Following nested name resolution to class", " ", <id>] ; < concat-strings ; ifdebug (debug) > ["Following nested name resolution to class", " ", <id>]
; < assert (!"$namespace") > ("$value", e) ; < my-assert (!"$namespace") > ("$value", e)
ClassOrNamespaceTraverse-2 : a@|ClassOrNamespaceName[ ClassOrNamespaceTraverse-2 : a@|ClassOrNamespaceName[
~ClassName: |ClassName[ ~ClassName: |ClassName[
...@@ -88,7 +88,7 @@ rules ...@@ -88,7 +88,7 @@ rules
; < conc; ?x; !list-key (x) > (d', [f]) => e ; < conc; ?x; !list-key (x) > (d', [f]) => e
; < print-key > p => e' ; < print-key > p => e'
; < concat-strings ; ifdebug (debug) > ["Following nested name resolution to class-template", " ", e'] ; < concat-strings ; ifdebug (debug) > ["Following nested name resolution to class-template", " ", e']
; < assert (!"$namespace") > ("$value", p) ; < my-assert (!"$namespace") > ("$value", p)
strategies strategies
......
...@@ -51,7 +51,7 @@ rules ...@@ -51,7 +51,7 @@ rules
; < print-key > e => e' ; < print-key > e => e'
; < concat-strings; ifdebug (debug) > ["+ Entering class", " ", e'] ; < concat-strings; ifdebug (debug) > ["+ Entering class", " ", e']
; < begin-scope (!"$namespace") > a ; < begin-scope (!"$namespace") > a
; < assert (!"$namespace") > ("$value", e) ; < my-assert (!"$namespace") > ("$value", e)
; < resolve > BaseClause-opt => BaseClause-opt' ; < resolve > BaseClause-opt => BaseClause-opt'
; < resolve > MemberSpecification-opt => MemberSpecification-opt' ; < resolve > MemberSpecification-opt => MemberSpecification-opt'
; < end-scope (!"$namespace") > a ; < end-scope (!"$namespace") > a
......
...@@ -38,7 +38,7 @@ rules ...@@ -38,7 +38,7 @@ rules
EnumDefinition : a@|EnumSpecifier[ enum ID { EnumeratorList-opt } ]| -> a EnumDefinition : a@|EnumSpecifier[ enum ID { EnumeratorList-opt } ]| -> a
where < identifier > ID => c where < identifier > ID => c
; < rewrite (!"$namespace") > "$value" => d ; < rewrite (!"$namespace") > "$value" => d
; < assert (!d) > (c, enum-kind) ; < my-assert (!d) > (c, enum-kind)
; < ?list-key (as); !as > d => d' ; < ?list-key (as); !as > d => d'
; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e ; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e
; < print-key > e => e' ; < print-key > e => e'
......
...@@ -109,7 +109,7 @@ strategies ...@@ -109,7 +109,7 @@ strategies
follow = rec x(?[e]; ![] <+ [id|x]) => ns follow = rec x(?[e]; ![] <+ [id|x]) => ns
; <rewrite(!"$namespace")> "$value" => list-key(old) ; <rewrite(!"$namespace")> "$value" => list-key(old)
; !list-key(<conc> (old, ns)) ; !list-key(<conc> (old, ns))
; <assert(!"$namespace")> ("$value", <id>) ; <my-assert(!"$namespace")> ("$value", <id>)
; !e ; !e
get-alias = scope(!"$namespace", get-alias = scope(!"$namespace",
......
...@@ -33,7 +33,7 @@ imports ...@@ -33,7 +33,7 @@ imports
rules rules
LocalOrGlobal-0 : a@|Dummy0?[ :: ]| -> a LocalOrGlobal-0 : a@|Dummy0?[ :: ]| -> a
where < assert (!"$namespace") > ("$value", list-key ([])) where < my-assert (!"$namespace") > ("$value", list-key ([]))
; < ifdebug (debug) > "Starting nested name resolution from global namespace" ; < ifdebug (debug) > "Starting nested name resolution from global namespace"
LocalOrGlobal-1 : a@|Dummy0?[ ]| -> a LocalOrGlobal-1 : a@|Dummy0?[ ]| -> a
......
...@@ -64,7 +64,7 @@ rules ...@@ -64,7 +64,7 @@ rules
Lookup-current(table) : (namespace, identifier) -> result Lookup-current(table) : (namespace, identifier) -> result
where < rewrite (!namespace; table) > identifier => result where < rewrite (!namespace; table) > identifier => result
; < assert (!"$namespace") > ("$value", namespace) ; < my-assert (!"$namespace") > ("$value", namespace)
// //
// Recurse the lookup to the outer namespace. // Recurse the lookup to the outer namespace.
......
...@@ -50,14 +50,14 @@ rules ...@@ -50,14 +50,14 @@ rules
where < identifier > ID => c // Read identifier (name of N). where < identifier > ID => c // Read identifier (name of N).
; < rewrite (!"$namespace") > "$value" => d // Get current namespace name. ; < rewrite (!"$namespace") > "$value" => d // Get current namespace name.
; < assert (!d) > (c, namespace-kind) // In N', mark N as being a namespace. ; < my-assert (!d) > (c, namespace-kind) // In N', mark N as being a namespace.
; < ?list-key (as); !as > d => d' // Extract the list of nested namespace names. ; < ?list-key (as); !as > d => d' // Extract the list of nested namespace names.
; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e // Append the new namespace name to the current list. ; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e // Append the new namespace name to the current list.
; < print-key > e => e' // Print the current list (this is for debugging only). ; < print-key > e => e' // Print the current list (this is for debugging only).
; < concat-strings; ifdebug (debug) > ["+ Original definition of namespace", " ", e'] ; < concat-strings; ifdebug (debug) > ["+ Original definition of namespace", " ", e']
; < init-name-space (!e) > a // Initialize symbol table for N. ; < my-init-name-space (!e) > a // Initialize symbol table for N.
; < begin-scope (!"$namespace") > a // Save old current namespace name. ; < begin-scope (!"$namespace") > a // Save old current namespace name.
; < assert (!"$namespace") > ("$value", e) // Set new current namespace name. ; < my-assert (!"$namespace") > ("$value", e) // Set new current namespace name.
; < definition > NamespaceBody => NamespaceBody' // Process the namespace definition body. ; < definition > NamespaceBody => NamespaceBody' // Process the namespace definition body.
; < end-scope (!"$namespace") > a // Restore old current namespace name. ; < end-scope (!"$namespace") > a // Restore old current namespace name.
; < concat-strings; ifdebug (debug) > ["- Original definition of namespace", " ", e'] ; < concat-strings; ifdebug (debug) > ["- Original definition of namespace", " ", e']
...@@ -73,7 +73,7 @@ rules ...@@ -73,7 +73,7 @@ rules
|NamedNamespaceDefinition[ |NamedNamespaceDefinition[
~ExtensionNamespaceDefinition: ~ExtensionNamespaceDefinition:
|ExtensionNamespaceDefinition[ |ExtensionNamespaceDefinition[
namespace la1 ID la2 { la3 NamespaceBody la4 } ]|~ ]| namespace la1 ID la2 { la3 NamespaceBody' la4 } ]|~ ]|
where < identifier > ID => c // Read identifier (name of N). where < identifier > ID => c // Read identifier (name of N).
; < rewrite (!"$namespace") > "$value" => d // Get current namespace name. ; < rewrite (!"$namespace") > "$value" => d // Get current namespace name.
; < ?list-key (as); !as > d => d' // Extract the list of nested namespace names. ; < ?list-key (as); !as > d => d' // Extract the list of nested namespace names.
...@@ -81,7 +81,7 @@ rules ...@@ -81,7 +81,7 @@ rules
; < print-key > e => e' // Print the current list (this is for debugging only). ; < print-key > e => e' // Print the current list (this is for debugging only).
; < concat-strings; ifdebug (debug) > ["+ Extension of namespace", " ", e'] ; < concat-strings; ifdebug (debug) > ["+ Extension of namespace", " ", e']
; < begin-scope (!"$namespace") > a // Save old current namespace name. ; < begin-scope (!"$namespace") > a // Save old current namespace name.
; < assert (!"$namespace") > ("$value", e) // Set new current namespace name. ; < my-assert (!"$namespace") > ("$value", e) // Set new current namespace name.
; < definition > NamespaceBody => NamespaceBody' // Process the namespace extension body. ; < definition > NamespaceBody => NamespaceBody' // Process the namespace extension body.
; < end-scope (!"$namespace") > a // Restore old current namespace name. ; < end-scope (!"$namespace") > a // Restore old current namespace name.
; < concat-strings; ifdebug (debug) > ["- Extension of namespace", " ", e'] ; < concat-strings; ifdebug (debug) > ["- Extension of namespace", " ", e']
...@@ -101,8 +101,8 @@ rules ...@@ -101,8 +101,8 @@ rules
=> NamespaceName' => NamespaceName'
; Namespace-GetKey => alias) ; Namespace-GetKey => alias)
; < identifier > ID => c ; < identifier > ID => c
; < assert (!d) > (c, alias-kind) ; < my-assert (!d) > (c, alias-kind)
; < assert (!alias-table(d)) > (c, alias) ; < my-assert (!alias-table(d)) > (c, alias)
strategies strategies
......
...@@ -57,8 +57,8 @@ rules ...@@ -57,8 +57,8 @@ rules
; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e ; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e
; < print-key > e => e' ; < print-key > e => e'
; < concat-strings; ifdebug (debug) > ["+ Entering namespace", " ", e'] ; < concat-strings; ifdebug (debug) > ["+ Entering namespace", " ", e']
; < begin-scope (!"$namespace") > ("$value", e) ; < begin-scope (!"$namespace") > a
; < assert (!"$namespace") > ("$value", e) ; < my-assert (!"$namespace") > ("$value", e)
; < resolve > inner => inner' ; < resolve > inner => inner'
; < end-scope (!"$namespace") > a ; < end-scope (!"$namespace") > a
; < concat-strings; ifdebug (debug) > ["- Entering namespace", " ", e'] ; < concat-strings; ifdebug (debug) > ["- Entering namespace", " ", e']
...@@ -84,8 +84,8 @@ rules ...@@ -84,8 +84,8 @@ rules
; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e ; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e
; < print-key > e => e' ; < print-key > e => e'
; < concat-strings; ifdebug (debug) > ["+ Entering namespace", " ", e'] ; < concat-strings; ifdebug (debug) > ["+ Entering namespace", " ", e']
; < begin-scope (!"$namespace") > ("$value", e) ; < begin-scope (!"$namespace") > a
; < assert (!"$namespace") > ("$value", e) ; < my-assert (!"$namespace") > ("$value", e)
; < resolve > inner => inner' ; < resolve > inner => inner'
; < end-scope (!"$namespace") > a ; < end-scope (!"$namespace") > a
; < concat-strings; ifdebug (debug) > ["- Entering namespace", " ", e'] ; < concat-strings; ifdebug (debug) > ["- Entering namespace", " ", e']
......
...@@ -45,16 +45,16 @@ rules ...@@ -45,16 +45,16 @@ rules
; < rewrite (!"$template-parameters") > "$value" => p ; < rewrite (!"$template-parameters") > "$value" => p
; < end-scope (!"$template") > a ; < end-scope (!"$template") > a
; < end-scope (!"$template-parameters") > a ; < end-scope (!"$template-parameters") > a
; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <assert(!d)> (idt, kind)) }) > p ; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <my-assert(!d)> (idt, kind)) }) > p
; < assert (!d) > (c, class-template-kind (e)) // In N, mark C as being a class template. ; < my-assert (!d) > (c, class-template-kind (e)) // In N, mark C as being a class template.
; < ?list-key (as); !as > d => d' // Extract the list of nested namespace names. ; < ?list-key (as); !as > d => d' // Extract the list of nested namespace names.
; < id > template-key (c, e) => f // Form full name of class template. ; < id > template-key (c, e) => f // Form full name of class template.
; < conc; ?x; !list-key (x) > (d', [f]) => g // Append the new namespace name to the current list. ; < conc; ?x; !list-key (x) > (d', [f]) => g // Append the new namespace name to the current list.
; < print-key > g => g' // Print the current list (this is for debugging only). ; < print-key > g => g' // Print the current list (this is for debugging only).
; < concat-strings; ifdebug (debug) > ["+ Definition of template class", " ", g'] ; < concat-strings; ifdebug (debug) > ["+ Definition of template class", " ", g']
; < init-name-space (!e) > a // Initialize symbol table for N. ; < my-init-name-space (!e) > a // Initialize symbol table for N.
; < begin-scope (!"$namespace") > a // Save old current namespace name. ; < begin-scope (!"$namespace") > a // Save old current namespace name.
; < assert (!"$namespace") > ("$value", g) // Set new current namespace name. ; < my-assert (!"$namespace") > ("$value", g) // Set new current namespace name.
; < definition > MemberSpecification-opt => MemberSpecification-opt' // Process the class definition body. ; < definition > MemberSpecification-opt => MemberSpecification-opt' // Process the class definition body.
; < end-scope (!"$namespace") > a // Restore old current namespace name. ; < end-scope (!"$namespace") > a // Restore old current namespace name.
; < concat-strings; ifdebug (debug) > ["- Definition of template class", " ", g'] ; < concat-strings; ifdebug (debug) > ["- Definition of template class", " ", g']
...@@ -73,8 +73,8 @@ rules ...@@ -73,8 +73,8 @@ rules
; < rewrite (!"$template-parameters") > "$value" => p ; < rewrite (!"$template-parameters") > "$value" => p
; < end-scope (!"$template") > a ; < end-scope (!"$template") > a
; < end-scope (!"$template-parameters") > a ; < end-scope (!"$template-parameters") > a
; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <assert(!d)> (idt, kind)) }) > p ; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <my-assert(!d)> (idt, kind)) }) > p
; < assert (!d) > (c, class-template-kind (e)) ; < my-assert (!d) > (c, class-template-kind (e))
; < ?list-key (as); !as > d => d' ; < ?list-key (as); !as > d => d'
; < id > template-key (c, e) => f ; < id > template-key (c, e) => f
; < conc; ?x; !list-key (x) > (d', [f]) => g ; < conc; ?x; !list-key (x) > (d', [f]) => g
......
...@@ -50,14 +50,14 @@ rules ...@@ -50,14 +50,14 @@ rules
; < rewrite (!"$template-parameters") > "$value" => p ; < rewrite (!"$template-parameters") > "$value" => p
; < end-scope (!"$template") > a ; < end-scope (!"$template") > a
; < end-scope (!"$template-parameters") > a ; < end-scope (!"$template-parameters") > a
; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <assert(!d)> (idt, kind)) }) > p ; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <my-assert(!d)> (idt, kind)) }) > p
; < id > template-key (c, e) => f ; < id > template-key (c, e) => f
; < ?list-key (as); !as > d => d' ; < ?list-key (as); !as > d => d'
; < conc; ?x; !list-key (x) > (d', [f]) => g ; < conc; ?x; !list-key (x) > (d', [f]) => g
; < print-key > g => g' ; < print-key > g => g'
; < concat-strings; ifdebug (debug) > ["+ Entering template class", " ", g'] ; < concat-strings; ifdebug (debug) > ["+ Entering template class", " ", g']
; < begin-scope (!"$namespace") > a ; < begin-scope (!"$namespace") > a
; < assert (!"$namespace") > ("$value", g) ; < my-assert (!"$namespace") > ("$value", g)
; < resolve > BaseClause-opt => BaseClause-opt' ; < resolve > BaseClause-opt => BaseClause-opt'
; < resolve > MemberSpecification-opt => MemberSpecification-opt' ; < resolve > MemberSpecification-opt => MemberSpecification-opt'
; < end-scope (!"$namespace") > a ; < end-scope (!"$namespace") > a
......
...@@ -40,8 +40,8 @@ rules ...@@ -40,8 +40,8 @@ rules
; < begin-scope (!"$template-parameters") > a ; < begin-scope (!"$template-parameters") > a
; < resolve > TemplateParameterList => TemplateParameterList' ; < resolve > TemplateParameterList => TemplateParameterList'
; < parameters-decl > TemplateParameterList' => l ; < parameters-decl > TemplateParameterList' => l
; < assert (!"$template") > ("$value", <map({x: ?(_,x); !x})> l) ; < my-assert (!"$template") > ("$value", <map({x: ?(_,x); !x})> l)
; < assert (!"$template-parameters") > ("$value", l) ; < my-assert (!"$template-parameters") > ("$value", l)
; < definition > Declaration => Declaration' ; < definition > Declaration => Declaration'
strategies strategies
......
...@@ -41,9 +41,9 @@ rules ...@@ -41,9 +41,9 @@ rules
; < rewrite (!"$template-parameters") > "$value" => p ; < rewrite (!"$template-parameters") > "$value" => p
; < end-scope (!"$template") > a ; < end-scope (!"$template") > a
; < end-scope (!"$template-parameters") > a ; < end-scope (!"$template-parameters") > a
; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <assert(!d)> (idt, kind)) }) > p ; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <my-assert(!d)> (idt, kind)) }) > p
; < ?list-key (as); !as > d => d' ; < ?list-key (as); !as > d => d'
; < assert (!d) > (c, function-template-kind (e)) ; < my-assert (!d) > (c, function-template-kind (e))
; < id > template-key (c, e) => f ; < id > template-key (c, e) => f
; < conc; ?x; !list-key (x) > (d', [f]) => g ; < conc; ?x; !list-key (x) > (d', [f]) => g
; < print-key > g => g' ; < print-key > g => g'
......
...@@ -46,7 +46,7 @@ rules ...@@ -46,7 +46,7 @@ rules
; < rewrite (!"$template-parameters") > "$value" => p ; < rewrite (!"$template-parameters") > "$value" => p
; < end-scope (!"$template") > a ; < end-scope (!"$template") > a
; < end-scope (!"$template-parameters") > a ; < end-scope (!"$template-parameters") > a
; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <assert(!d)> (idt, kind)) }) > p ; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <my-assert(!d)> (idt, kind)) }) > p
; < id > template-key (c, e) => f ; < id > template-key (c, e) => f
; < ?list-key (as); !as > d => d' ; < ?list-key (as); !as > d => d'
; < conc; ?x; !list-key (x) > (d', [f]) => g ; < conc; ?x; !list-key (x) > (d', [f]) => g
......
...@@ -41,8 +41,8 @@ rules ...@@ -41,8 +41,8 @@ rules
where < begin-scope (!"$template") > a where < begin-scope (!"$template") > a
; < begin-scope (!"$template-parameters") > a ; < begin-scope (!"$template-parameters") > a
; < parameters-decl > TemplateParameterList => TemplateParameterList' ; < parameters-decl > TemplateParameterList => TemplateParameterList'
; < assert (!"$template") > ("$value", <map({x: ?(_,x); !x})> TemplateParameterList') ; < my-assert (!"$template") > ("$value", <map({x: ?(_,x); !x})> TemplateParameterList')
; < assert (!"$template-parameters") > ("$value", TemplateParameterList') ; < my-assert (!"$template-parameters") > ("$value", TemplateParameterList')
; < topdown (not (?amb(xs))) > TemplateParameterList ; < topdown (not (?amb(xs))) > TemplateParameterList
; < resolve > Declaration => Declaration' ; < resolve > Declaration => Declaration'
......
...@@ -40,7 +40,7 @@ rules ...@@ -40,7 +40,7 @@ rules
; < rewrite (!"$namespace") > "$value" => d ; < rewrite (!"$namespace") > "$value" => d
; < print-key > d => d' ; < print-key > d => d'
; < concat-strings ; ifdebug (debug) > ["Type", " ", c, " ", "being defined in namespace", " ", d'] ; < concat-strings ; ifdebug (debug) > ["Type", " ", c, " ", "being defined in namespace", " ", d']
; < assert (!d) > (c, type-kind) ; < my-assert (!d) > (c, type-kind)
TypeDeclarator(s) : a@|DeclaratorId[ ~IdExpression: |IdExpression[ ID ]|~ ]| -> a TypeDeclarator(s) : a@|DeclaratorId[ ~IdExpression: |IdExpression[ ID ]|~ ]| -> a
where s; not([]) => alias where s; not([]) => alias
...@@ -49,8 +49,8 @@ rules ...@@ -49,8 +49,8 @@ rules
; < print-key > d => d' ; < print-key > d => d'
; < print-key > alias => alias' ; < print-key > alias => alias'
; < concat-strings ; ifdebug (debug) > ["Type", " ", c, " ", "being defined in namespace", " ", d', " aliasing to ", alias'] ; < concat-strings ; ifdebug (debug) > ["Type", " ", c, " ", "being defined in namespace", " ", d', " aliasing to ", alias']
; < assert (!d) > (c, type-kind) ; < my-assert (!d) > (c, type-kind)
; < assert (!alias-table(d)) > (c, alias) ; < my-assert (!alias-table(d)) > (c, alias)
strategies strategies
......
...@@ -39,7 +39,7 @@ rules ...@@ -39,7 +39,7 @@ rules
; < rewrite (!"$namespace") > "$value" => d ; < rewrite (!"$namespace") > "$value" => d
; < print-key > d => d' ; < print-key > d => d'
; < concat-strings ; ifdebug (debug) > ["Variable", " ", c, " ", "being defined in namespace", " ", d'] ; < concat-strings ; ifdebug (debug) > ["Variable", " ", c, " ", "being defined in namespace", " ", d']
; < assert (!d) > (c, variable-kind) ; < my-assert (!d) > (c, variable-kind)
strategies strategies
......
...@@ -29,32 +29,49 @@ imports ...@@ -29,32 +29,49 @@ imports
Definition Definition
Keys Keys
Resolve Resolve
ScopedFiniteMap
rules rules
Init : x -> x Init : x -> x
where < assert (!"$namespace") > ("$value", list-key ([])) where < my-assert (!"$namespace") > ("$value", list-key ([]))
Finish : x -> x Finish : x -> x
where < ifdebug (debug) > "" where < ifdebug (debug) > ""
strategies strategies
init = Init init = Init
finish = Finish finish = Finish
afcxx-disambiguate = iowrap (where(< table-create > "$parameters-normalize"); afcxx-disambiguate = io-wrap (symbtable-option,
init-name-space (!"$namespace"); where (< get-config > ("--symtable")
init-name-space (!"$template"); ; ( restore-maplist
begin-scope (!"$namespace"); <+ (
begin-scope (!"$template"); ifdebug (debug (!"create disambiguate symbol tables (file):"))
init; ; < my-table-create > "$parameters-normalize"
definition; ; my-init-name-space (!"$namespace")
finish; ; my-init-name-space (!"$template")
init; ; begin-scope (!"$namespace")
resolve; ; begin-scope (!"$template")
finish; ; init
end-scope (!"$template"); )
end-scope (!"$namespace"); )
exit-name-space (!"$template"); )
exit-name-space (!"$namespace")) ; definition
; finish
; init
; resolve
; finish
; where (< get-config > ("--symtable"); save-maplist)
; end-scope (!"$template")
; end-scope (!"$namespace")
; exit-name-space (!"$template")
; exit-name-space (!"$namespace")
)
symbtable-option =
ArgOption("--symtable"
, where(<set-config> ("--symtable", <id>))
, !"--symtable Specify the symbol file to load"
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment