Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 336
    • Issues 336
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1164

Closed
Open
Created Mar 25, 2014 by Artem Shinkarov@temaOwner

Supporting void with-loops

Bugzilla Link 1120
Created on Mar 25, 2014 16:41
Version svn
OS All
Architecture All

Extended Description

SaC syntax allows void with-loops.  Unfortunately they are not supported by the compiler.  Here are the steps that we have identified (Artem, Bodo) to fix the problem.
1) Adjusting parser.  Currently the parser doesn't support void with-loops.  It has been fixed in the branch called [origin/parser-fix] with a the following syntax adjustment:
A void with-loop requires void statement of the generator which can be expressed as:
with {
  (...): foo ();
}: void;
in which case foo must be void,
with {
  (...) { ... }: void;
}: void;
or
with {
  (...) { ... }: foo ();
}: void;
where foo is void.
2) Flattening requires adjustment.  The problem is that when flattening sees expression like:
with {
  (...): foo ();
}: void;
it flattens it to:
with {
  (...) {tmp = foo ();}: tmp;
}: void;
and obviously dies, as there is no foo which returns one argument.  Solution:
normalize generators of the void with-loop as follows:
(...): foo ();  ->  (...) { foo (); }: void;
(...): { ... }: expr;  -> (...) { ...; expr; }: void
3) Reference parameters are not being resolved properly in the void with-loops. 
use IntStack: all;
int main ()
{
  s = create_stack ();
  with {
    ([0] <= [i] 
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking